/* ============================================================
   lokalne-uslugi-single.css — Ranking Firm (Single Page)
   Extracted from lokalne-uslugi-single.php
   ============================================================ */

/* Page */
.rank-page {
    background: var(--bg);
    min-height: 100vh;
    padding-bottom: 60px;
}

/* Breadcrumbs */
.rank-breadcrumbs {
    padding: 15px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.rank-breadcrumbs a {
    color: var(--primary);
    text-decoration: none;
}

.rank-breadcrumbs .sep {
    margin: 0 8px;
}

/* Header */
.rank-header {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rank-header h1 {
    font-size: 26px;
    font-weight: 900;
    margin: 0 0 8px;
    color: var(--text);
    line-height: 1.3;
}

.rank-header-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.rank-header-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rank-lead {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

/* ============================================================
   TOP Table
   ============================================================ */
.rank-top-heading {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-top-heading i {
    color: var(--warning);
}

.rank-top-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 25px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rank-top-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 14px;
    overflow: hidden;
    min-width: 580px;
}

.rank-top-table th {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: white;
    padding: 14px 18px;
    text-align: left;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.rank-top-table td {
    padding: 14px 18px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    vertical-align: middle;
}

.rank-top-table tr:last-child td {
    border-bottom: none;
}

.rank-top-table tr:hover td {
    background: #f8f9ff;
}

.rank-pos {
    font-weight: 900;
    font-size: 18px;
    color: var(--primary);
}

.rank-pos-1 {
    color: var(--warning);
}

.rank-pos-2 {
    color: #adb5bd;
}

.rank-pos-3 {
    color: #cd7f32;
}

.rank-score {
    font-weight: 800;
    font-size: 16px;
    color: var(--primary);
}

.rank-google {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ============================================================
   Business Card
   ============================================================ */
.biz-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border-left: 5px solid var(--primary);
}

.biz-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
}

.biz-card-pos {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.biz-card-pos-1 {
    background: linear-gradient(135deg, var(--warning), #ff9800);
}

.biz-card-pos-2 {
    background: linear-gradient(135deg, #adb5bd, #6c757d);
}

.biz-card-pos-3 {
    background: linear-gradient(135deg, #cd7f32, #a0522d);
}

.biz-card-pos-other {
    background: linear-gradient(135deg, var(--primary), #4a4a8a);
}

.biz-card h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 5px;
    color: var(--text);
}

.biz-card-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.biz-card-desc h3,
.biz-card-desc h4 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin: 16px 0 8px;
}

.biz-card-desc ul,
.biz-card-desc ol {
    padding-left: 20px;
    margin: 8px 0;
}

.biz-card-desc li {
    margin-bottom: 4px;
}

/* Details Grid */
.biz-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.biz-details-left,
.biz-details-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.biz-detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: #555;
}

.biz-detail-item i {
    width: 18px;
    color: var(--primary);
    text-align: center;
    flex-shrink: 0;
}

.biz-detail-item strong {
    color: var(--text);
}

/* Advantages */
.biz-advantages {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.biz-advantages li {
    background: #f0f7ff;
    color: #1a5276;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* Business Hours */
.biz-hours {
    background: var(--bg);
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.biz-hours summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.biz-hours ul {
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
}

.biz-hours li {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.biz-hours li:last-child {
    border-bottom: none;
}

/* Map */
.biz-map {
    height: 220px;
    border-radius: 12px;
    margin-top: 15px;
    z-index: 1;
}

/* Score Box */
.biz-score-box {
    background: linear-gradient(135deg, #f8f9ff, #eef0ff);
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
}

.biz-score-val {
    font-size: 28px;
    font-weight: 900;
    color: var(--primary);
}

.biz-score-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ============================================================
   Banners
   ============================================================ */
.rank-banner {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 25px;
    color: white;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.rank-banner h3 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 10px;
}

.rank-banner p {
    font-size: 13px;
    opacity: 0.8;
    margin: 0 0 15px;
    line-height: 1.6;
}

.rank-banner-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--warning);
    color: #1a1a2e;
    font-weight: 700;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
}

/* Diploma CTA (primary banner) */
.banner-diploma-cta {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    border-radius: 16px;
    padding: 30px 24px;
    text-align: center;
    color: white;
    margin-bottom: 16px;
}

.banner-diploma-cta .banner-emoji {
    font-size: 40px;
    margin-bottom: 8px;
}

.banner-diploma-cta h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 8px;
}

.banner-diploma-cta p {
    font-size: 14px;
    opacity: 0.8;
    margin: 0 0 18px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.banner-diploma-btn {
    display: inline-block;
    padding: 14px 36px;
    background: linear-gradient(135deg, #c0a050, #e6c870);
    color: #1a1a2e;
    font-weight: 800;
    font-size: 15px;
    border-radius: 10px;
    text-decoration: none;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(192, 160, 80, 0.4);
}

.banner-diploma-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192, 160, 80, 0.5);
}

.banner-diploma-cta .banner-hint {
    font-size: 11px;
    opacity: 0.5;
    margin: 12px 0 0;
}

/* Advertising CTA (secondary banner) */
.banner-ad-cta {
    background: white;
    border-radius: 14px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
}

.banner-ad-cta h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}

.banner-ad-cta p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.banner-ad-btn {
    display: inline-block;
    padding: 10px 22px;
    background: #1a1a2e;
    color: white;
    font-weight: 700;
    font-size: 13px;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}

.banner-ad-btn:hover {
    background: #0f3460;
}

/* ============================================================
   "Inne firmy" Section
   ============================================================ */
.other-biz-section {
    margin-top: 30px;
}

.other-biz-section h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.other-biz-section h2 i {
    color: var(--text-secondary);
}

.other-biz-section>p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 20px;
    line-height: 1.6;
}

.other-biz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.other-biz-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.other-biz-card h4 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: var(--text);
}

.other-biz-card .ob-category {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 10px;
}

.other-biz-card .ob-category .verified {
    color: var(--success);
    margin-left: 6px;
}

.other-biz-card .ob-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 13px;
}

.other-biz-card .ob-rating span {
    color: #999;
}

.other-biz-card .ob-details {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.other-biz-card .ob-details i {
    width: 16px;
    color: var(--primary);
    opacity: 0.6;
}

.other-biz-card .ob-details a {
    color: var(--primary);
    text-decoration: underline;
    font-weight: 500;
}

/* ============================================================
   Services / FAQ / Related / SEO Text / How Ranking
   ============================================================ */
.rank-services {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rank-services h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 15px;
}

.rank-services-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rank-service-tag {
    background: var(--bg);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

/* FAQ */
.rank-faq {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rank-faq h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 20px;
}

.rank-faq-item {
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 0;
}

.rank-faq-item:last-child {
    border-bottom: none;
}

.rank-faq-item h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--text);
    cursor: pointer;
}

.rank-faq-item p {
    font-size: 14px;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

/* SEO Text */
.rank-seo {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rank-seo h2,
.rank-seo h3 {
    font-weight: 800;
    color: var(--text);
}

.rank-seo h2 {
    font-size: 18px;
    margin: 0 0 15px;
}

.rank-seo h3 {
    font-size: 16px;
    margin: 20px 0 10px;
}

.rank-seo p {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
}

/* Related */
.rank-related {
    background: white;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.rank-related h2 {
    font-size: 18px;
    font-weight: 800;
    margin: 0 0 15px;
}

.rank-related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rank-related-tag {
    background: white;
    padding: 8px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.rank-related-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

/* How ranking */
.rank-how {
    background: #f8f9ff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
}

.rank-how h2 {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 12px;
}

.rank-how p {
    font-size: 13px;
    line-height: 1.7;
    color: #666;
    margin: 0;
}

/* ============================================================
   Diploma Modal
   ============================================================ */
.diploma-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(3px);
}

.diploma-modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalIn 0.3s ease;
}

.diploma-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.diploma-modal h3 {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 5px;
    color: #1a1a2e;
}

.diploma-modal .modal-desc {
    font-size: 13px;
    color: #888;
    margin: 0 0 20px;
}

.diploma-modal-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.diploma-modal-item {
    display: block;
    padding: 12px 14px;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.diploma-modal-item:hover {
    border-color: #1a1a2e;
    background: #f8f9ff;
}

.diploma-modal-item .dm-name {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.4;
}

.diploma-modal-item .dm-pos {
    color: #c0a050;
    margin-right: 4px;
}

.diploma-modal-item .dm-score {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

.diploma-modal .modal-hint {
    font-size: 11px;
    color: #bbb;
    margin: 18px 0 0;
    text-align: center;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 768px) {
    .rank-page {
        padding-bottom: 30px;
    }

    .rank-breadcrumbs {
        font-size: 11px;
        padding: 10px 0;
        overflow-x: auto;
        white-space: nowrap;
    }

    .rank-header {
        padding: 20px 16px;
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .rank-header h1 {
        font-size: 20px;
    }

    .rank-header-meta {
        gap: 10px;
        font-size: 11px;
    }

    .rank-lead {
        font-size: 13px;
        line-height: 1.6;
    }

    /* TOP Table → scrollable */
    .rank-top-wrapper {
        margin-bottom: 16px;
        border-radius: 12px;
    }

    .rank-top-table th {
        padding: 10px 12px;
        font-size: 11px;
    }

    .rank-top-table td {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Business Cards */
    .biz-card {
        padding: 18px 14px;
        margin-bottom: 14px;
        border-radius: 12px;
    }

    .biz-card h3 {
        font-size: 17px;
    }

    .biz-card-header {
        gap: 10px;
        margin-bottom: 14px;
    }

    .biz-card-pos {
        width: 40px;
        height: 40px;
        font-size: 16px;
        border-radius: 10px;
    }

    .biz-card-desc {
        font-size: 13px;
        line-height: 1.7;
        margin-bottom: 14px;
    }

    .biz-details {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 14px;
    }

    .biz-detail-item {
        font-size: 12px;
    }

    .biz-advantages li {
        padding: 5px 10px;
        font-size: 11px;
    }

    .biz-score-box {
        padding: 12px 14px;
        flex-wrap: wrap;
        gap: 10px;
    }

    .biz-score-val {
        font-size: 22px;
    }

    .biz-map {
        height: 180px;
    }

    /* Banners */
    .banner-diploma-cta {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .banner-diploma-cta .banner-emoji {
        font-size: 32px;
    }

    .banner-diploma-cta h3 {
        font-size: 17px;
    }

    .banner-diploma-cta p {
        font-size: 13px;
    }

    .banner-diploma-btn {
        padding: 12px 24px;
        font-size: 13px;
    }

    .banner-ad-cta {
        padding: 16px;
        border-radius: 12px;
        flex-direction: column;
        align-items: flex-start;
    }

    .banner-ad-cta h3 {
        font-size: 14px;
    }

    .banner-ad-btn {
        width: 100%;
        text-align: center;
    }

    /* Make TOP table a block layout on mobile */
    .rank-top-wrapper {
        box-shadow: none;
        background: transparent;
        overflow: visible;
        margin-bottom: 25px;
    }

    .rank-top-table,
    .rank-top-table tbody,
    .rank-top-table tr,
    .rank-top-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .rank-top-table thead {
        display: none;
        /* Hide headers on mobile */
    }

    .rank-top-table tr {
        background: white;
        border-radius: 12px;
        margin-bottom: 12px;
        padding: 15px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
        border: 1px solid #f0f0f0;
    }

    .rank-top-table tr:hover td {
        background: transparent;
    }

    .rank-top-table td {
        padding: 6px 0;
        border: none;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .rank-top-table td:first-child {
        border-bottom: 1px solid #f0f0f0;
        padding-bottom: 10px;
        margin-bottom: 10px;
        justify-content: flex-start;
        gap: 15px;
    }

    /* Use pseudo elements for mobile labels */
    .rank-top-table td:nth-child(3)::before {
        content: "Ocena Rankingu:";
        font-size: 11px;
        font-weight: 700;
        color: #888;
        text-transform: uppercase;
    }

    .rank-top-table td:nth-child(4)::before {
        content: "Ocena Google:";
        font-size: 11px;
        font-weight: 700;
        color: #888;
        text-transform: uppercase;
    }

    .rank-top-table td:nth-child(5)::before {
        content: "Opinie:";
        font-size: 11px;
        font-weight: 700;
        color: #888;
        text-transform: uppercase;
    }

    /* Fix the specific cell layouts for mobile block view */
    .rank-top-table td:nth-child(2) {
        display: inline-block;
        /* business name is inline with position */
    }

    .rank-top-table tr td:first-child {
        display: flex;
    }

    .rank-top-table tr td:nth-child(2) {
        display: none;
        /* Hide standard name cell because we'll pull it up visually */
    }

    /* Re-arrange cell 1 to include name */
    .rank-top-table td:first-child::after {
        content: attr(data-name);
        font-weight: 700;
        font-size: 15px;
        color: #1a1a2e;
    }

    /* Better styling for the Google ranking cell */
    .rank-google {
        justify-content: flex-end;
    }

    .rank-banner {
        grid-template-columns: 1fr;
        padding: 20px 16px;
    }

    /* Inne firmy */
    .other-biz-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .other-biz-card {
        padding: 14px;
    }

    /* Sections */
    .rank-services,
    .rank-faq,
    .rank-related,
    .rank-seo {
        padding: 18px;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .rank-services h2,
    .rank-faq h2,
    .rank-related h2,
    .rank-seo h2 {
        font-size: 16px;
    }

    .rank-faq-item h3 {
        font-size: 14px;
    }

    .rank-faq-item p {
        font-size: 13px;
    }

    .rank-service-tag,
    .rank-related-tag {
        padding: 6px 12px;
        font-size: 12px;
    }

    .rank-how {
        padding: 18px;
        border-radius: 12px;
    }

    .rank-how h2 {
        font-size: 15px;
    }

    .rank-how p {
        font-size: 12px;
    }

    /* Modal */
    .diploma-modal {
        padding: 20px 16px;
        width: 95%;
        max-height: 85vh;
        border-radius: 12px;
    }

    .diploma-modal h3 {
        font-size: 17px;
    }

    .diploma-modal-item {
        padding: 10px 12px;
    }

    .diploma-modal-item .dm-name {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .rank-header h1 {
        font-size: 18px;
    }

    .rank-header {
        padding: 16px 14px;
    }

    .biz-card {
        padding: 14px 12px;
    }

    .biz-card h3 {
        font-size: 15px;
    }

    .biz-card-pos {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }

    .banner-diploma-cta {
        padding: 20px 14px;
    }

    .banner-diploma-cta h3 {
        font-size: 15px;
    }

    .banner-diploma-btn {
        padding: 10px 20px;
        font-size: 12px;
    }

    .other-biz-section h2 {
        font-size: 16px;
    }
}