﻿/* ═══════════════════════════════════════════════════════════════════════════
   mobile.css — Coaster Kiosk · phones and tablets (portrait)
   ───────────────────────────────────────────────────────────────────────────
   • Only applies BELOW 992px, so it never touches the kiosk (kiosk-1080.css)
     or the desktop layout. Remove its <link> to go back to the old mobile look.
   • Loaded after kiosk-1080.css in _Layout.cshtml and _LoginLayout.cshtml.
   • "html body" selectors: the views have their own <style> blocks in the page
     body (loaded after this file), so the extra specificity lets these win.
   • Layout and sizing only — no business logic.
   ═══════════════════════════════════════════════════════════════════════════ */

/* the cart badge is phone-only */
.cart-badge {
    display: none;
}

.cart-icon-wrap {
    display: inline-flex;
}

@media (max-width: 991.98px) {

    /* ═════════════════════════ 1. TOKENS + BASE ═════════════════════════ */
    :root {
        --m-pad: 16px; /* page side margin   */
        --m-gap: 12px; /* grid gap           */
        --m-touch: 44px; /* minimum tap target */
        --m-touch-lg: 52px; /* primary actions    */
    }

    html {
        overflow-x: hidden;
    }

        /* "clip", not "hidden": hidden on <body> would break the sticky header */
        html body {
            max-width: 100%;
            overflow-x: clip;
        }

            html body .container-fluid.px-4:has(> main#main) {
                padding-left: 0 !important;
                padding-right: 0 !important;
            }

            html body img {
                max-width: 100%;
            }

            /* the full header is too tall to stay pinned on a phone: it scrolls away like a normal
       mobile site (the catalog toolbar is what stays pinned — section 6) */
            html body header[role="banner"] {
                box-shadow: none;
                position: static;
            }

            /* ═════════════════════════ 2. DARK TOP BAR ══════════════════════════ */

            html body .cc-announcement {
                flex-wrap: wrap;
                font-size: 11px;
                gap: 4px 10px;
                justify-content: space-between;
                min-height: 0;
                padding: 6px var(--m-pad);
            }

            html body .cc-legal-links,
            html body .cc-announcement-tools {
                position: static;
                transform: none;
            }

                html body .cc-legal-links a {
                    align-items: center;
                    display: inline-flex;
                    min-height: 32px;
                }

            html body .cc-terms-banner {
                flex-basis: 100%;
                order: 3;
                padding: 0 0 2px;
            }

            html body .cc-terms-text {
                display: none;
            }

            html body .cc-terms-link {
                font-size: 13px;
                min-height: 36px;
            }

            html body .cc-announcement-link {
                min-height: 36px;
                padding: 0 10px;
            }

                html body .cc-announcement-link .label-text {
                    display: none;
                }

            /* ═════════════════════════ 3. HEADER ════════════════════════════════
       row 1: logo · store · cart     row 2: search     row 3: nav (wraps) */

            html body .topbar,
            html body .topbar .container-fluid {
                min-height: 0;
            }

                html body .topbar .container-fluid {
                    align-items: center;
                    flex-wrap: wrap;
                    gap: 10px !important;
                    padding: 10px var(--m-pad);
                }

            html body .brand {
                min-width: 0;
                order: 1;
            }

            html body .brand-logo {
                height: 36px;
            }

            html body .btn-cart-summary,
            html body .cart-btn {
                flex-shrink: 0;
                font-size: 13px;
                margin-left: auto;
                min-height: var(--m-touch);
                order: 2;
                padding: 0 12px;
                white-space: nowrap;
            }

            html body .search-form {
                flex: 0 0 100%;
                max-width: none;
                min-width: 0;
                order: 3;
            }

                html body .search-form .form-control,
                html body .topbar .form-control {
                    font-size: 16px; /* 16px+ stops iPhone zooming in on tap */
                    min-height: var(--m-touch);
                    min-width: 0;
                    width: 100%;
                }

                html body .search-form .btn,
                html body .topbar .btn-danger {
                    min-height: var(--m-touch);
                    min-width: var(--m-touch);
                }

            html body .search-suggestions {
                max-height: 60vh;
            }

            /* nav: ONE row of pills you swipe sideways. The open category's panel is pulled out of the
       strip (position: fixed, placed by TopNav's script) so the strip can't cut it off. */
            html body .catbar-inline {
                border-top: 1px solid var(--cc-line);
                flex: 0 0 100%;
                margin: 0 calc(var(--m-pad) * -1) !important;
                max-width: none;
                order: 4;
                overflow: visible;
                padding: 8px 0 2px;
                width: calc(100% + 2 * var(--m-pad));
            }

                /* every category visible, nothing to swipe: pills wrap (tablets) / 4 × 2 grid (phones, below) */
                html body .catbar-inline .catbar-list {
                    flex-wrap: wrap !important;
                    gap: 6px;
                    overflow: visible;
                    padding: 0 var(--m-pad) 6px !important;
                }

                    html body .catbar-inline .catbar-list > li {
                        flex: 0 0 auto;
                    }

                html body .catbar-inline .catbar-link {
                    background: var(--cc-gray) !important;
                    border: 1.5px solid var(--cc-line) !important;
                    border-radius: 999px;
                    font-size: 14px !important;
                    min-height: 40px !important;
                    padding: 0 14px !important;
                }

                    /* current page, or the one whose panel is open: red outline (Deals keeps blue) */
                    html body .catbar-inline .catbar-link.is-active,
                    html body .catbar-inline .catbar-link[aria-expanded="true"] {
                        background: #fff !important;
                        border-color: var(--cc-red) !important;
                        color: var(--cc-red) !important;
                    }

                    html body .catbar-inline .catbar-link.catbar-link-deals.is-active,
                    html body .catbar-inline .catbar-link.catbar-link-deals[aria-expanded="true"] {
                        border-color: var(--cc-blue) !important;
                        color: var(--cc-blue) !important;
                    }

                /* the open panel: full width just under the pills (top comes from --m-dd-top, set by TopNav's script) */
                html body .catbar-inline .dropdown-menu.dropdown-menu-thumb.show {
                    border-radius: 12px;
                    box-shadow: 0 16px 36px rgba(6,31,60,.18);
                    inset: var(--m-dd-top, 180px) 12px auto 12px !important;
                    margin: 0 !important;
                    max-height: calc(100vh - var(--m-dd-top, 180px) - 12px);
                    max-width: none;
                    overflow-y: auto;
                    padding: 6px 12px !important;
                    position: fixed !important;
                    transform: none !important;
                    width: auto !important;
                    z-index: 1050;
                }

                /* panel rows: thumbnail · name · › */
                html body .catbar-inline .mega-tiles {
                    display: block;
                    grid-template-columns: none;
                }

                    html body .catbar-inline .mega-tiles > li + li {
                        border-top: 1px solid var(--cc-line);
                    }

            html body .catbar-list .dropdown-menu-thumb .mega-tile {
                align-items: center;
                border-radius: 8px;
                flex-direction: row;
                gap: 14px;
                height: auto;
                min-height: 60px;
                padding: 8px 6px;
                text-align: left;
            }

                html body .catbar-list .dropdown-menu-thumb .mega-tile::after {
                    color: var(--cc-muted);
                    content: "\F285"; /* bootstrap-icons chevron-right */
                    font-family: "bootstrap-icons";
                    font-size: 15px;
                    margin-left: auto;
                }

            html body .catbar-inline .mega-tile-img {
                aspect-ratio: auto;
                border-radius: 8px;
                flex: 0 0 56px;
                font-size: 22px;
                height: 44px;
                width: 56px;
            }

            html body .catbar-inline .mega-tile-text {
                font-size: 15px;
                font-weight: 700;
                line-height: 1.25;
            }

            html body .thumb-item {
                min-height: var(--m-touch);
            }

            /* ═════════════════════════ 4. SHARED BUTTONS ═════════════════════════ */

            html body .btn-kiosk-primary,
            html body .btn-kiosk-outline-light {
                justify-content: center;
                min-height: var(--m-touch-lg);
            }

            /* ═════════════════════════════ 5. HOME ═══════════════════════════════
       Photo on top, text below; room tiles 2 per row.                    */

            html body .hero {
                grid-template-columns: 1fr;
                height: auto;
                min-height: 0;
            }

            html body .hero-image-wrap {
                aspect-ratio: 16 / 10;
                height: auto;
                max-height: none;
                min-height: 0;
                order: -1;
            }

            html body .hero-image {
                height: 100%;
                object-fit: cover;
                width: 100%;
            }

            html body .hero-copy {
                padding: 22px var(--m-pad) 26px;
            }

            html body .hero h1 {
                font-size: clamp(28px, 7.5vw, 40px);
                margin-bottom: 10px;
            }

            html body .hero-intro {
                font-size: 16px;
                margin-bottom: 18px;
            }

            html body .hero-links .btn-kiosk-primary {
                width: 100%;
            }

            html body .home-section {
                padding: 22px var(--m-pad);
            }

            html body .section-heading h2 {
                font-size: 26px;
            }

            html body .section-heading p {
                font-size: 15px;
            }

            html body .room-grid {
                gap: var(--m-gap);
                grid-auto-flow: row;
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            html body .room-card-label {
                font-size: 16px;
                min-height: 48px;
            }

            html body .na-banner {
                grid-template-columns: 1fr;
            }

            html body .na-media {
                min-height: 160px;
                order: -1;
            }

            html body .na-copy {
                padding: 20px var(--m-pad) 24px;
            }

                html body .na-copy h2 {
                    font-size: 30px;
                }

            html body .merch-row {
                gap: var(--m-gap);
                grid-template-columns: 1fr;
                padding: 16px;
            }

            html body .merch-photos {
                gap: 10px;
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }

            /* ══════════════════════ 6. CATALOG + SEARCH ═════════════════════════
       Filters open from the "Filters" button; 2 cards per row.           */

            html body .catalog-page-header {
                padding: 18px var(--m-pad);
            }

                html body .catalog-page-header.has-hero {
                    justify-content: flex-end;
                    min-height: 260px;
                    padding: 18px var(--m-pad);
                }

                    html body .catalog-page-header h1,
                    html body .catalog-page-header.has-hero h1 {
                        font-size: clamp(28px, 7.5vw, 38px);
                        margin-bottom: 6px;
                    }

                    html body .catalog-page-header p,
                    html body .catalog-page-header.has-hero p {
                        font-size: 15px;
                    }

            html body .catalog-breadcrumb {
                flex-wrap: wrap;
                font-size: 13px;
            }

            html body .catalog-page {
                grid-template-columns: 1fr;
            }

            /* filter panel (opened by the Filters button): full width, its own scroll */
            html body .catalog-sidebar.is-open {
                border-bottom: 1px solid var(--cc-line);
                max-height: 70vh;
                overflow-y: auto;
                padding: 16px var(--m-pad) !important;
            }

            html body .filter-group-toggle,
            html body .filter-group-title {
                color: var(--cc-navy);
                font-size: 14px;
                font-weight: 900;
                letter-spacing: .06em;
                min-height: var(--m-touch);
            }

                html body .filter-group-toggle .bi {
                    font-size: 16px;
                }

            html body .filter-option {
                font-size: 15px;
                font-weight: 700;
                min-height: var(--m-touch);
            }

            /* toolbar: the only thing pinned on a phone (top of the screen, since the header scrolls away) */
            html body .catalog-toolbar {
                flex-wrap: wrap;
                gap: 8px 10px;
                min-height: 0;
                padding: 8px var(--m-pad);
                position: sticky;
                top: 0 !important;
                z-index: 30;
            }

                html body .catalog-toolbar > div:first-child,
                html body .catalog-toolbar-right {
                    flex-wrap: wrap;
                    gap: 8px;
                }

            html body .catalog-toolbar-right {
                flex: 1 1 auto;
                justify-content: flex-end;
            }

            html body #btnFilterToggle {
                align-items: center;
                display: inline-flex;
                font-size: 14px;
                font-weight: 700;
                gap: 6px;
                min-height: var(--m-touch);
                padding: 0 14px;
            }

            html body .toolbar-sort select {
                font-size: 14px;
                max-width: 46vw;
                min-height: var(--m-touch);
            }

            html body .active-filters {
                padding: 8px var(--m-pad);
            }

            html body .catalog-grid {
                gap: var(--m-gap);
                grid-template-columns: repeat(2, minmax(0, 1fr));
                padding: var(--m-gap) var(--m-pad) 24px;
            }

                html body .catalog-grid.is-list {
                    grid-template-columns: 1fr;
                }

            /* ════════════════════ 7. PRODUCT CARD (every page) ═══════════════════ */

            html body .prod-card {
                display: flex;
                flex-direction: column;
                height: 100%;
                min-width: 0;
            }

            html body .prod-card-img-wrap {
                padding: 8px 8px 0;
            }

            html body .prod-card-imgwrap img {
                object-fit: contain;
            }

            html body .prod-card-body {
                gap: 3px;
                min-width: 0;
                padding: 10px 12px 12px;
            }

            html body .prod-card-collection {
                overflow: hidden;
                text-overflow: ellipsis;
                white-space: nowrap;
            }

            html body .prod-card-title {
                -webkit-box-orient: vertical;
                -webkit-line-clamp: 2;
                display: -webkit-box;
                font-size: 14px;
                line-height: 1.3;
                min-height: calc(2 * 1.3em);
                overflow: hidden;
                word-break: break-word;
            }

            html body .swatch-color {
                height: 30px;
                width: 30px;
            }

            html body .swatch-pill {
                max-width: 100%;
                min-height: 34px;
                overflow: hidden;
                padding: 0 10px;
                text-overflow: ellipsis;
            }

            html body .prod-card-price {
                margin-top: auto;
            }

            html body .prod-card-price-val,
            html body .prod-card-lease-val {
                font-size: 20px;
            }

            html body .prod-card-price-promo {
                font-size: 21px;
            }

            /* two buttons don't fit side by side on a phone card: stack them */
            html body .prod-card-actions {
                display: grid;
                gap: 6px;
                grid-template-columns: 1fr;
                margin-top: 10px;
            }

            html body .prod-card-btn {
                font-size: 13px;
                min-height: var(--m-touch);
                padding: 0 8px;
            }

            html body .prod-card-promo-badge {
                left: 14px;
                padding: 4px 8px;
                top: 14px;
            }

                html body .prod-card-promo-badge strong {
                    font-size: 14px;
                }

            html body .prod-card-new-badge {
                right: 14px;
                top: 14px;
            }

            /* list view on a phone: image on the left, everything else stacked */
            html body .catalog-grid.is-list .prod-card-body {
                display: flex;
                flex-direction: column;
            }

            html body .catalog-grid.is-list .prod-card-img-wrap {
                flex: 0 0 110px;
            }

            html body .catalog-grid.is-list .prod-card-imgwrap {
                width: 94px;
            }

            /* ══════════════════════════ 8. PRODUCT PAGE ═════════════════════════ */

            html body .pdp-breadcrumb {
                font-size: 13px;
                min-height: 44px;
                padding: 0 var(--m-pad);
            }

                html body .pdp-breadcrumb > span[aria-current] {
                    max-width: 60vw;
                    overflow: hidden;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

            html body .product-detail {
                gap: 20px;
                grid-template-columns: 1fr;
                padding: 0 var(--m-pad) 32px;
            }

            html body .pdp-gallery {
                position: static;
            }

            html body .pdp-gallery-primary {
                aspect-ratio: 1 / 1;
                height: auto;
                min-height: 0;
            }

                html body .pdp-gallery-primary img,
                html body .pdp-gallery-video {
                    max-height: 100%;
                    object-fit: contain;
                }

            html body .pdp-thumb-carousel-wrap {
                padding: 0 44px;
            }

            html body .pdp-gallery-thumb {
                flex: 0 0 72px;
            }

            html body .pdp-carousel-btn {
                font-size: 20px;
                height: 40px;
                width: 40px;
            }

            html body .pdp-tab-btn {
                min-height: 52px;
                padding-right: 14px;
            }

            html body .pdp-name {
                font-size: clamp(24px, 6.5vw, 32px);
            }

            html body .pdp-price {
                font-size: 28px;
            }

            html body .pdp-price-promo {
                font-size: 30px;
            }

            html body .pdp-swatch-color {
                height: 40px;
                width: 40px;
            }

            html body .pdp-swatch-pill {
                min-height: var(--m-touch);
            }

            html body .pdp-cart-row {
                display: grid;
                gap: 8px;
                grid-template-columns: 80px 1fr;
            }

            html body .pdp-qty,
            html body .pdp-add-btn {
                min-height: var(--m-touch-lg);
                width: 100%;
            }

            /* wide inventory table scrolls inside itself */
            html body .pdp-inv-table {
                display: block;
                overflow-x: auto;
                white-space: nowrap;
            }

            html body .pdp-below {
                padding: 0 var(--m-pad);
            }

            html body .pdp-showroom-help {
                margin: 0 calc(var(--m-pad) * -1);
                padding: 32px var(--m-pad);
            }

                html body .pdp-showroom-help h2 {
                    font-size: 28px;
                }

            html body .pdp-related {
                padding: 28px 0;
            }

            html body .pdp-related-title {
                font-size: 24px;
            }

            html body .pdp-carousel-wrap {
                padding: 0 32px;
            }

            html body .pdp-carousel-btn.prev {
                left: -4px;
            }

            html body .pdp-carousel-btn.next {
                right: -4px;
            }

            html body .pdp-carousel .prod-card,
            html body .pdp-carousel .skeleton-card {
                flex: 0 0 calc(50% - 8px);
                min-width: 0;
            }

            /* ═════════════════════════════ 9. CHECKOUT ══════════════════════════
       One column: items first, the quote panel below them.               */

            html body .q-page {
                padding: 0 var(--m-pad) 28px;
            }

            html body .q-grid {
                gap: 16px;
                grid-template-columns: 1fr;
            }

            html body .q-title {
                font-size: 28px;
            }

            html body .q-list {
                max-height: none;
                overflow: visible;
            }

            html body .q-item {
                gap: 12px;
                grid-template-columns: 88px minmax(0, 1fr);
                padding: 12px;
            }

                /* price + qty drop under the name/details */
                html body .q-item > :last-child {
                    grid-column: 1 / -1;
                }

            html body .q-item-name {
                font-size: 16px;
            }

            html body .q-side {
                max-height: none;
                overflow: visible;
                position: static;
            }

            html body .q-form-wrap {
                max-height: none;
            }

            html body .q-btn,
            html body .q-input,
            html body .q-select {
                min-height: var(--m-touch);
            }

            html body .q-input,
            html body .q-select {
                font-size: 16px;
            }
            /* no iPhone zoom on focus */

            /* ═══════════════════════ 10. MODALS + OVERLAYS ══════════════════════ */

            html body .modal-dialog {
                margin: 8px auto;
                max-width: calc(100vw - 16px);
            }

            html body .modal-content {
                display: flex;
                flex-direction: column;
                max-height: calc(100vh - 16px);
                overflow: hidden;
            }

            html body .modal-header,
            html body .modal-footer {
                flex-shrink: 0;
            }

            html body .modal-body {
                flex: 1 1 auto;
                min-height: 0;
                overflow-y: auto;
                overscroll-behavior: contain;
            }

            html body .modal-footer {
                flex-wrap: wrap;
                gap: 8px;
            }

                html body .modal-footer .btn {
                    flex: 1 1 auto;
                    min-height: var(--m-touch);
                }

            html body dialog {
                max-height: calc(100vh - 16px);
                max-width: calc(100vw - 16px);
                overflow: auto;
            }

            /* ═══════════════════════ 11. LEGAL PAGES ════════════════════════════ */

            html body .pol-wrap {
                padding: 20px var(--m-pad) 40px;
            }

            html body .pol-title {
                font-size: 30px;
            }

            html body .pol-card {
                padding: 18px 16px;
            }

            html body .pol-body {
                font-size: 15px;
            }

            html body .pol-switch a {
                align-items: center;
                display: inline-flex;
                min-height: var(--m-touch);
            }

            /* ═══════════════════════ 12. LOGIN + LOCATION ═══════════════════════ */

            html body:has(.login-wrap) {
                align-items: stretch;
                padding: 0;
            }

            html body .login-wrap {
                border-radius: 0;
                grid-template-columns: 1fr;
                max-width: none;
                min-height: 100vh;
            }

            html body .login-left {
                display: none;
            }

            html body .login-right {
                padding: 32px 22px;
            }

            html body .login-input {
                font-size: 16px;
                min-height: var(--m-touch-lg);
            }

            html body .login-row {
                align-items: flex-start;
                flex-direction: column;
                gap: 8px;
            }

            html body .login-remember,
            html body .login-help-link {
                align-items: center;
                display: inline-flex;
                min-height: var(--m-touch);
            }

            html body .login-btn {
                min-height: var(--m-touch-lg);
            }
}

/* ═══════════════ SMALL PHONES (under 380px wide) ════════════════════════ */
@media (max-width: 379.98px) {
    html body .catalog-grid,
    html body .room-grid {
        grid-template-columns: 1fr;
    }

    html body .pdp-carousel .prod-card,
    html body .pdp-carousel .skeleton-card {
        flex-basis: 80%;
    }

    html body .view-toggle {
        display: none;
    }
}


/* ═══════════════ PHONES (under 576px) — compact header + toolbar ════════════════ */
@media (max-width: 575.98px) {
    /* cart = navy icon + red count badge (no dark box, no text); total is on the cart page */
    html body .btn-cart-summary {
        background: transparent !important;
        color: var(--cc-navy) !important;
        justify-content: center;
        min-height: var(--m-touch);
        min-width: var(--m-touch);
        padding: 0 !important;
    }

        html body .btn-cart-summary:hover,
        html body .btn-cart-summary:focus {
            background: var(--cc-gray) !important;
            color: var(--cc-navy) !important;
        }

        html body .btn-cart-summary .btn-user-info {
            display: none;
        }

        html body .btn-cart-summary .bi-cart3 {
            font-size: 26px;
            line-height: 1;
        }

    html body .cart-icon-wrap {
        display: inline-flex;
        position: relative;
    }

    html body .cart-badge {
        align-items: center;
        background: var(--cc-red);
        border: 2px solid #fff;
        border-radius: 999px;
        color: #fff;
        display: inline-flex;
        font-size: 11px;
        font-weight: 800;
        height: 20px;
        justify-content: center;
        line-height: 1;
        min-width: 20px;
        padding: 0 5px;
        position: absolute;
        right: -10px;
        top: -8px;
    }

        html body .cart-badge[hidden] {
            display: none;
        }

    html body .brand {
        flex: 1 1 0;
    }

    /* toolbar on one line: count · Filters · sort · in-stock */
    html body .catalog-toolbar {
        flex-wrap: nowrap;
    }

        html body .catalog-toolbar > div:first-child {
            flex: 0 1 auto;
            min-width: 0;
        }

    html body .catalog-count {
        font-size: 13px;
        white-space: nowrap;
    }

        html body .catalog-count #showingRange {
            display: none;
        }
    /* "· Showing 20 of 106" */

    html body .catalog-toolbar-right {
        flex-wrap: nowrap;
        gap: 6px;
    }

    html body .view-toggle {
        display: none;
    }

    html body #btnFilterToggle {
        padding: 0 10px;
    }

    html body .toolbar-sort select {
        max-width: 34vw;
        padding: 0 6px;
    }
}


/* ═══════════════ PHONES: all 8 categories in a 4 × 2 grid ═══════════════ */
@media (max-width: 575.98px) {
    html body .catbar-inline .catbar-list {
        display: grid !important;
        gap: 6px;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

        html body .catbar-inline .catbar-list > li {
            min-width: 0;
        }

    html body .catbar-inline .catbar-link {
        font-size: 12.5px !important;
        justify-content: center;
        line-height: 1.15;
        min-height: 44px !important;
        padding: 4px 6px !important;
        text-align: center;
        white-space: normal;
        width: 100%;
    }

        /* the dropdown caret takes room a 4-across pill doesn't have */
        html body .catbar-inline .catbar-link.dropdown-toggle::after {
            display: none;
        }
}
