/* Shared mobile layout for every Finowings courses page.
   Loaded after page CSS so these rules win at the same specificity. */

html {
    scroll-padding-top: calc(var(--nav-h, 72px) + 4.25rem);
}

img,
video,
iframe {
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .fnav-mobile {
        max-height: calc(100dvh - var(--nav-h) - env(safe-area-inset-top, 0px));
        padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }

    /* Wide course cards stack: photo keeps a 16:9 frame instead of a short crop */
    .wc {
        flex-direction: column;
    }
    .wc-img {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 16 / 9;
    }
    .wc-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .wc-body {
        padding: 1.15rem 1.15rem 1.25rem;
    }
}

@media (max-width: 767.98px) {
    body {
        overflow-x: hidden;
    }

    /* ── Hero banner: full artwork, arrows underneath ── */
    .hero {
        min-height: 0;
        padding: 1.25rem 0 2rem;
        align-items: flex-start;
    }
    .hero-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .hero-hl {
        font-size: clamp(2rem, 9vw, 2.45rem);
        margin-bottom: 0.85rem;
    }
    .hero-desc {
        font-size: 1rem;
        line-height: 1.65;
        margin-bottom: 1.15rem;
        max-width: none;
    }
    .hero-eyebrow {
        margin-bottom: 0.9rem;
        letter-spacing: 0.06em;
    }
    .hero-stats {
        display: grid;
        grid-template-columns: 1fr 1fr;
        padding: 0.35rem 0;
        margin-bottom: 1.15rem;
    }
    .hst-item {
        min-width: 0;
        padding: 0.7rem 0.45rem;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }
    .hst-item:nth-child(odd) {
        border-right: 1px solid rgba(255, 255, 255, 0.07);
    }
    .hst-item:nth-last-child(-n + 2) {
        border-bottom: none;
    }
    .hst-num {
        font-size: 1.35rem;
    }
    .hst-lbl {
        font-size: 0.68rem;
        letter-spacing: 0.04em;
    }
    .hero-btns {
        flex-direction: column;
    }
    .hbtn-prim,
    .hbtn-sec {
        width: 100%;
        min-height: 48px;
        justify-content: center;
        text-align: center;
    }

    .hero-banner-wrap {
        margin-top: 0;
        overflow: visible;
        border-radius: 16px;
    }
    .hero-banner-wrap .owl-stage-outer {
        border-radius: 16px;
        overflow: hidden;
    }
    .hero-banner-wrap .owl-stage-outer,
    .hero-banner-wrap .owl-stage,
    .hero-banner-wrap .owl-item,
    .hero-banner-wrap .header-carousel .owl-carousel-item,
    .hero-banner-wrap .owl-carousel-item {
        min-height: 0 !important;
        height: auto !important;
    }
    .hero-banner-wrap .owl-carousel-item img,
    .hero-banner-wrap .header-carousel .owl-carousel-item img {
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        height: auto !important;
        max-height: none !important;
        object-fit: contain !important;
        display: block;
    }
    .hero-banner-wrap .header-carousel .owl-nav,
    .hero-banner-wrap .owl-nav {
        display: none !important;
    }
    body.light-mode .hst-item,
    body.light-mode .hst-item:nth-child(odd) {
        border-color: rgba(0, 0, 0, 0.08);
    }

    /* ── Sticky section pills sit below the navbar ── */
    .snav {
        top: calc(var(--nav-h, 58px) + env(safe-area-inset-top, 0px));
        padding: 0.55rem 0;
    }
    .snav .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .snav-inner {
        width: 100%;
        max-width: 100%;
        justify-content: flex-start;
        padding: 0.3rem;
        margin: 0;
    }
    .snav-pill {
        min-height: 40px;
        padding: 0.45rem 0.9rem;
        font-size: 0.8rem;
    }

    /* ── Section headings and cards ── */
    .sec-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.4rem;
    }
    .sec-title {
        font-size: clamp(1.45rem, 6vw, 1.75rem);
    }
    .sec-sub {
        font-size: 0.92rem;
    }
    .cwrap {
        padding-top: 1.5rem;
    }
    .csec {
        margin-bottom: 2.75rem;
    }
    .live-sec,
    .rec-sec,
    .elite-sec,
    .combo-sec,
    .free-sec {
        padding: 1.75rem 0 2rem;
    }

    .gc-body {
        padding: 1rem 1rem 1.1rem;
    }
    .gc-title,
    .wc-title {
        font-size: 1rem;
        line-height: 1.4;
    }
    .gc-price,
    .wc-price {
        flex-wrap: wrap;
        gap: 0.4rem 0.55rem;
    }
    .gc-saving {
        margin-left: 0;
    }
    .gc-meta,
    .wc-meta {
        gap: 0.45rem;
    }
    .gc-btns,
    .wc-btns,
    .detail-actions {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .btn-p,
    .btn-o,
    .gc-btns a,
    .gc-btns button,
    .wc-btns a,
    .wc-btns button,
    .detail-actions .btn-p,
    .detail-actions .btn-o,
    .hbtn-prim,
    .hbtn-sec {
        min-height: 44px;
        white-space: normal;
    }
    .plan-tabs {
        gap: 0.4rem;
    }
    .plan-tab {
        min-height: 40px;
        font-size: 0.78rem;
        padding: 0.4rem 0.75rem;
    }
    .va-btn {
        min-height: 44px;
    }

    .gc:hover,
    .wc:hover,
    .tc:hover {
        transform: none;
    }

    /* ── Detail pages ── */
    .detail-hero {
        grid-template-columns: 1fr;
        gap: 1.15rem;
    }
    .detail-hero-media {
        width: 100%;
        max-width: 100%;
        min-height: 0;
        aspect-ratio: 16 / 10;
    }
    .detail-hero-media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .detail-title {
        font-size: clamp(1.3rem, 5.4vw, 1.65rem);
        line-height: 1.25;
    }
    .detail-crumb {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        font-size: 0.78rem;
        margin-bottom: 1rem;
    }
    .detail-crumb .cur {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .detail-actions {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    .detail-actions .btn-p,
    .detail-actions .btn-o {
        width: 100%;
        justify-content: center;
    }
    .detail-sidebar {
        position: static;
        margin-top: 0.5rem;
    }
    .detail-main {
        padding-top: 1.5rem;
    }
    .video-item,
    .detail-session {
        flex-direction: column;
        align-items: flex-start;
    }
    .video-thumbnail,
    .detail-session-thumb {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    .review-form {
        padding: 1.1rem;
        margin-top: 1.25rem;
    }
    .review-form textarea,
    .auth-input,
    .form-control,
    .form-select,
    textarea,
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"] {
        font-size: 16px;
    }

    /* ── Lesson players ── */
    .chapter-sidebar {
        position: static;
        top: auto;
        height: auto;
        max-height: none;
        overflow: visible;
    }
    .chapter-content {
        height: auto;
        max-height: none;
        overflow: visible;
        padding-right: 0;
    }
    .video-list button {
        min-height: 44px;
    }
    .accordion-button {
        min-height: 48px;
    }
    .elite-page-header h1,
    .page-header .display-3,
    .page-header h1 {
        font-size: 1.7rem;
    }
    .page-header {
        padding-top: 1.75rem;
        padding-bottom: 1.75rem;
    }

    /* ── Testimonials sit fully on screen ── */
    .testi {
        padding: 2.5rem 0;
    }
    .testi .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .tc {
        margin: 0;
    }

    /* ── Pagination ── */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    .page-link {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* ── Checkout modal ── */
    .modal-dialog {
        margin: 0.75rem;
        max-width: calc(100vw - 1.5rem);
    }
    .modal-body .form-control,
    .modal-body .form-select {
        min-height: 44px;
    }

    /* ── Footer ── */
    .ft-top {
        padding: 2.25rem 0 1.5rem;
    }
    .ft .row.g-5 {
        --bs-gutter-x: 1rem;
        --bs-gutter-y: 1.6rem;
    }
    .ft-brand img {
        height: 42px;
    }
    .ft-tagline {
        max-width: none;
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }
    .ft-si {
        width: 44px;
        height: 44px;
    }
    .ft-col-title {
        margin-bottom: 0.75rem;
        padding-bottom: 0.55rem;
    }
    .ft-links {
        gap: 0.15rem;
    }
    .ft-links a {
        min-height: 40px;
        padding: 0.35rem 0;
        font-size: 0.92rem;
    }
    .ft-contact-item {
        font-size: 0.92rem;
    }
    .ft-apps {
        margin-top: 0.4rem;
        padding: 1rem;
    }
    .ft-app-btns a img {
        height: 44px;
    }
    .ft-bottom {
        flex-direction: column;
        text-align: center;
        padding: 1rem 0 calc(1.1rem + env(safe-area-inset-bottom, 0px));
        gap: 0.65rem;
    }
    .ft-bottom-links {
        justify-content: center;
        gap: 0.85rem 1.1rem;
    }
    .ft-bottom-links a {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }
    .ft-copy {
        font-size: 0.8rem;
    }
}

@media (max-width: 575.98px) {
    .fnav-inner {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .container,
    .container-fluid,
    .container-xxl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .wc-body,
    .gc-body {
        padding: 0.95rem 0.95rem 1.05rem;
    }
    .gp-new,
    .wp-new {
        font-size: 1.2rem;
    }
    .auth-form-panel {
        padding: 1.15rem 0.85rem calc(1.5rem + env(safe-area-inset-bottom, 0px));
    }
    .auth-card {
        padding: 1.2rem 1rem;
    }
    .auth-phone-row {
        flex-direction: column;
    }
    .auth-select {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .gc-btns,
    .wc-btns {
        grid-template-columns: 1fr;
    }
    .hero-hl {
        font-size: 1.85rem;
    }
    .snav-pill {
        font-size: 0.75rem;
        padding: 0.4rem 0.7rem;
    }
}

@media (hover: none) {
    .gc:hover,
    .wc:hover,
    .btn-p:hover,
    .btn-o:hover {
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-noise,
    .live-sec::before,
    .rec-sec::before,
    .ft::before,
    .fnav::before {
        animation: none;
    }
}
