/* === Physical Gold IRA - Mobile Fix v1 === */

/* ===== HEADER: Hide nav links on mobile, show burger ===== */
@media (max-width: 768px) {
    .jaai-topbar { display: none !important; }

    .jaai-header__inner {
        padding: 0 14px !important;
        height: 59px !important;
    }

    .jaai-nav {
        display: none !important;
    }

    .jaai-header__cta {
        display: none !important;
    }

    .jaai-burger {
        display: flex !important;
        z-index: 10001 !important;
    }

    .jaai-logo {
        font-size: 15px !important;
    }
    .jaai-logo svg {
        width: 22px !important;
        height: 22px !important;
    }

    /* Mobile nav as modal overlay */
    .jaai-mobile-nav {
        display: none;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(30,27,53,0.97) !important;
        z-index: 10000 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        padding: 79px 27px 21px !important;
    }
    .jaai-mobile-nav.is-open {
        display: flex !important;
    }
    .jaai-mobile-nav a {
        display: block !important;
        width: 100% !important;
        max-width: 320px !important;
        text-align: center !important;
        padding: 19px 24px !important;
        color: #fff !important;
        font-size: 18px !important;
        font-weight: 600 !important;
        border-bottom: 1px solid rgba(255,255,255,0.1) !important;
        text-decoration: none !important;
    }
    .jaai-mobile-nav a:last-child {
        border-bottom: none !important;
    }
    .jaai-mobile-nav a:hover {
        background: rgba(255,255,255,0.1) !important;
        border-radius: 7px !important;
    }

    /* Burger X state */
    .jaai-burger.is-open .jaai-burger__line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px) !important;
    }
    .jaai-burger.is-open .jaai-burger__line:nth-child(2) {
        opacity: 0 !important;
    }
    .jaai-burger.is-open .jaai-burger__line:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -7px) !important;
    }
}

/* ===== COMPANY TABLE: Card layout on mobile ===== */
@media (max-width: 768px) {
    .fb-companies-table-wrapper {
        overflow-x: visible !important;
        padding: 0 9px !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        background: transparent !important;
    }

    .fb-companies-table {
        display: block !important;
        width: 100% !important;
    }
    .fb-companies-table thead {
        display: none !important;
    }
    .fb-companies-table tbody {
        display: flex !important;
        flex-direction: column !important;
        gap: 14px !important;
    }
    .fb-companies-table tr.fb-company-row {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        background: #fff !important;
        border: 1px solid #dde1f1 !important;
        border-radius: 19px !important;
        padding: 21px 18px !important;
        box-shadow: 0 3px 12px rgba(0,0,0,0.06) !important;
        text-align: center !important;
    }
    .fb-companies-table td {
        display: block !important;
        border: none !important;
        padding: 5px 0 !important;
        width: 100% !important;
        text-align: center !important;
    }

    /* Rank badge */
    .fb-td-rank {
        display: block !important;
        order: -1 !important;
    }
    .fb-rank-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 28px !important;
        height: 28px !important;
        background: linear-gradient(135deg, #1e1025, #0f273a) !important;
        color: #fff !important;
        border-radius: 50% !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        margin-bottom: 5px !important;
    }

    /* Company logo - 40% width */
    .fb-td-company { order: 0 !important; }
    .fb-company-info {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 10px !important;
    }
    .fb-company-logo {
        width: 40vw !important;
        max-width: 160px !important;
        max-height: none !important;
        min-height: auto !important;
        height: auto !important;
        object-fit: contain !important;
        border-radius: 12px !important;
    }
    .fb-company-name {
        font-size: 14px !important;
        font-weight: 700 !important;
        color: #1a1c2e !important;
        height: auto !important;
        overflow: visible !important;
        line-height: 1.3 !important;
    }
    .fb-company-badge {
        font-size: 11px !important;
        padding: 2px 13px !important;
        background: linear-gradient(135deg, #ae8410, #db9f16) !important;
        color: #fff !important;
        border-radius: 17px !important;
        display: inline-block !important;
    }

    /* Rating */
    .fb-td-rating { order: 1 !important; margin-top: 10px !important; }
    .fb-rating-box {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }
    .fb-star { font-size: 18px !important; }
    .fb-star-full { color: #ecbb13 !important; }
    .fb-star-half { color: #f3cb21 !important; }
    .fb-star-empty { color: #dbdddb !important; }
    .fb-rating-value {
        font-size: 14px !important;
        font-weight: 600 !important;
        color: #5c5158 !important;
        margin-top: 5px !important;
    }

    /* Minimum */
    .fb-td-minimum {
        order: 2 !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #211c28 !important;
        margin-top: 5px !important;
    }
    .fb-td-minimum::before {
        content: 'Minimum: ' !important;
        font-weight: 400 !important;
        color: #878090 !important;
        font-size: 13px !important;
    }

    /* BBB */
    .fb-td-bbb {
        display: block !important;
        order: 3 !important;
    }
    .fb-bbb-badge {
        display: inline-block !important;
        background: #e8f5e9 !important;
        color: #367835 !important;
        padding: 1px 14px !important;
        border-radius: 5px !important;
        font-weight: 600 !important;
        font-size: 13px !important;
    }
    .fb-td-bbb::before {
        content: 'BBB Rating: ' !important;
        font-weight: 400 !important;
        color: #909081 !important;
        font-size: 13px !important;
    }

    /* Features */
    .fb-td-features {
        display: block !important;
        order: 4 !important;
        margin-top: 6px !important;
    }
    .fb-features-list {
        list-style: none !important;
        padding: 0 !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 5px !important;
    }
    .fb-features-list li {
        background: #f0f4ff !important;
        padding: 5px 9px !important;
        border-radius: 22px !important;
        font-size: 15px !important;
        color: #2e3730 !important;
    }

    /* Action buttons */
    .fb-td-action {
        order: 5 !important;
        margin-top: 12px !important;
        width: 100% !important;
    }
    .fb-action-buttons {
        display: flex !important;
        flex-direction: row !important;
        gap: 11px !important;
        justify-content: center !important;
        align-items: center !important;
    }
    .fb-btn-primary, .fb-btn-primary-visit {
        padding: 10px 27px !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        background: linear-gradient(135deg, #1f2026, #12243b) !important;
        color: #fff !important;
        border-radius: 7px !important;
        text-decoration: none !important;
        display: inline-block !important;
    }
    .fb-btn-review {
        padding: 14px 31px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        background: transparent !important;
        color: #20182f !important;
        border: 2px solid #131534 !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        display: inline-block !important;
    }
}

/* ===== FIX design-overhaul conflicts for card layout ===== */
@media (max-width: 768px) {
    /* Override design-overhaul hiding company names - triple class for max specificity */
    .fb-companies-table-wrapper .fb-companies-table .fb-company-row .fb-company-name,
    .fb-companies-table .fb-company-row td .fb-company-name,
    .fb-company-row td.fb-td-company .fb-company-name {
        font-size: 15px !important;
        line-height: 1.3 !important;
        height: auto !important;
        overflow: visible !important;
        margin: 3px 0 0 !important;
        padding: 0 !important;
        font-weight: 700 !important;
        color: #1c1125 !important;
    }

    /* Override design-overhaul logo sizes for cards */
    .fb-companies-table-wrapper .fb-company-row .fb-company-logo,
    .fb-companies-table .fb-company-row img.fb-company-logo {
        min-height: auto !important;
        max-height: none !important;
        width: 40vw !important;
        max-width: 160px !important;
        height: auto !important;
        object-fit: contain !important;
    }

    /* FORCE show all card cells - override nth-child hiding from design-overhaul */
    .fb-companies-table-wrapper .fb-companies-table .fb-company-row td,
    .fb-companies-table .fb-company-row td.fb-td-bbb,
    .fb-companies-table .fb-company-row td.fb-td-features,
    .fb-companies-table .fb-company-row td.fb-td-rating,
    .fb-companies-table .fb-company-row td.fb-td-minimum,
    .fb-companies-table .fb-company-row td.fb-td-company,
    .fb-companies-table .fb-company-row td.fb-td-action,
    .fb-companies-table tbody tr.fb-company-row td:nth-child(1),
    .fb-companies-table tbody tr.fb-company-row td:nth-child(2),
    .fb-companies-table tbody tr.fb-company-row td:nth-child(3),
    .fb-companies-table tbody tr.fb-company-row td:nth-child(4),
    .fb-companies-table tbody tr.fb-company-row td:nth-child(5),
    .fb-companies-table tbody tr.fb-company-row td:nth-child(6),
    .fb-companies-table tbody tr.fb-company-row td:nth-child(7) {
        display: block !important;
    }

    /* Hide rank column only */
    .fb-companies-table .fb-company-row td.fb-td-rank,
    .fb-companies-table tbody tr.fb-company-row td:nth-child(1) {
        display: none !important;
    }

    /* Mobile nav overlay fully opaque */
    .jaai-mobile-nav.is-open {
        background: rgba(26,18,51,0.98) !important;
    }

    /* Compact header row - override design-overhaul grid */
    .jaai-header__inner {
        display: flex !important;
        grid-template-columns: unset !important;
    }

    /* Override design-overhaul hiding content max-width */
    .fb-companies-table-wrapper {
        max-width: 100% !important;
    }
}

/* ===== HERO: Compact on mobile ===== */
@media (max-width: 768px) {
    .jaai-hero {
        padding: 24px 13px 14px !important;
    }
    .jaai-hero__title {
        font-size: 22px !important;
        line-height: 1.2 !important;
        margin-bottom: 11px !important;
    }
    .jaai-hero__subtitle {
        font-size: 14px !important;
        margin-bottom: 14px !important;
    }
    .jaai-hero__badge { display: none !important; }
    .jaai-hero__trust { display: none !important; }
    .jaai-hero__actions { display: none !important; }
    .jaai-stats { display: none !important; }
    .jaai-process { padding: 19px 8px !important; }
}

/* ===== CONTENT: Edge-to-edge on mobile ===== */
@media (max-width: 768px) {
    .jaai-content__inner,
    .jaai-article,
    .jaai-content,
    main,
    #guide,
    .sob-content,
    .sob-guide {
        padding-left: 10px !important;
        padding-right: 11px !important;
        max-width: 100% !important;
    }
    .jaai-article__body {
        padding: 0 !important;
    }
    .jaai-article__body h2 {
        font-size: 20px !important;
    }
    .jaai-article__body p {
        font-size: 15px !important;
        line-height: 1.7 !important;
    }
}

/* ===== STICKY FOOTER: Compact with close button ===== */
#stickyFoot {
    padding: 10px 19px !important;
    gap: 12px !important;
    transition: transform 0.3s ease !important;
}
#stickyFoot.is-hidden {
    transform: translateY(100%) !important;
}
#stickyFoot img {
    height: 32px !important;
    border-radius: 6px !important;
}
#stickyFoot span {
    font-size: 11px !important;
}
#stickyFoot a[href*="gokiiit"] {
    padding: 11px 15px !important;
    font-size: 15px !important;
    border-radius: 7px !important;
}
.sticky-close-btn {
    position: absolute !important;
    top: -10px !important;
    right: 8px !important;
    width: 24px !important;
    height: 24px !important;
    border-radius: 50% !important;
    background: #fff !important;
    border: 1px solid #e3d6d4 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #5f6e62 !important;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1) !important;
    z-index: 10 !important;
}
@media (max-width: 600px) {
    #stickyFoot {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        padding: 7px 10px !important;
        gap: 7px !important;
        align-items: center !important;
    }
    #stickyFoot img { height: 28px !important; }
    #stickyFoot > span { display: none !important; }
    #stickyFoot a[href*="gokiiit"] {
        padding: 5px 16px !important;
        font-size: 15px !important;
        white-space: nowrap !important;
    }
    body { padding-bottom: 50px !important; }
}

/* ===== FAQ ACCORDION ===== */
.sob-faq-item, .jaai-faq-item {
    background: #fff !important;
    border: 1px solid #dfede7 !important;
    border-radius: 10px !important;
    margin-bottom: 11px !important;
    overflow: hidden !important;
}
.sob-faq-question, .jaai-faq-question {
    padding: 19px 17px !important;
    margin: 0 !important;
    cursor: pointer !important;
    user-select: none !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #1d1d2e !important;
    background: #fafbfc !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    transition: background 0.2s !important;
}
.sob-faq-question:hover { background: #f0f2f5 !important; }
.sob-faq-question::after {
    content: '+' !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #af7d0a !important;
    flex-shrink: 0 !important;
    margin-left: 12px !important;
    transition: transform 0.3s !important;
}
.sob-faq-item.active .sob-faq-question::after {
    content: '−' !important;
}
.sob-faq-answer {
    max-height: 0 !important;
    overflow: hidden !important;
    transition: max-height 0.35s ease, padding 0.35s ease !important;
    padding: 0 21px !important;
}
.sob-faq-item.active .sob-faq-answer {
    max-height: 500px !important;
    padding: 15px 23px !important;
}
.sob-faq-answer p {
    color: #4c5c6c !important;
    line-height: 1.7 !important;
    font-size: 15px !important;
}

/* ===== IMAGES IN CONTENT ===== */
.content-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    margin: 27px 0;
    box-shadow: 0 4px 17px rgba(0,0,0,0.08);
}

/* ===== GENERAL IMPROVEMENTS ===== */
.jaai-footer {
    padding: 30px 15px 19px !important;
}
@media (max-width: 768px) {
    .jaai-footer__grid {
        grid-template-columns: 1fr !important;
        gap: 26px !important;
    }
}

/* Review page improvements */
.jaai-review-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 19px;
    padding: 32px 17px;
}
.jaai-review-logo {
    max-height: 78px;
    border-radius: 11px;
}
.jaai-review-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 21px 0;
}
@media (max-width: 480px) {
    .jaai-review-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
.jaai-review-card {
    background: #f8f9fa;
    border: 1px solid #e2e6e9;
    border-radius: 12px;
    padding: 17px;
    text-align: center;
}
.jaai-review-card-icon {
    font-size: 24px;
    margin-bottom: 7px;
}
.jaai-review-card-title {
    font-size: 12px;
    color: #82898d;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.jaai-review-card-value {
    font-size: 20px;
    font-weight: 700;
    color: #231531;
}
.jaai-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 19px;
    margin: 24px 0;
}
@media (max-width: 600px) {
    .jaai-pros-cons { grid-template-columns: 1fr; }
}
.jaai-pros, .jaai-cons {
    background: #fff;
    border-radius: 10px;
    padding: 19px;
    border: 2px solid #e3def3;
}
.jaai-pros h3 { color: #27cc57; }
.jaai-cons h3 { color: #ea4741; }
.jaai-fees-table table {
    width: 100%;
    border-collapse: collapse;
}
.jaai-fees-table th, .jaai-fees-table td {
    padding: 9px 18px;
    border-bottom: 2px solid #ebe7ed;
    text-align: left;
}
.jaai-fees-table thead { background: #f8f9fa; }
.jaai-cta-box {
    background: linear-gradient(135deg, #1d1125, #0e293a);
    color: #fff;
    padding: 32px;
    border-radius: 17px;
    text-align: center;
    margin: 30px 0;
}
.jaai-cta-box h3 { color: #fff; margin-bottom: 7px; }
.jaai-cta-box p { color: rgba(255,255,255,0.8); margin-bottom: 19px; }
.jaai-cta-box .jaai-btn {
    display: inline-block;
    padding: 11px 34px;
    background: linear-gradient(135deg, #bc8a0b, #d3a525);
    color: #fff;
    border-radius: 13px;
    font-weight: 700;
    text-decoration: none;
}
