/* ============================================================
   RCN Mobile UI Sweep
   Targets: 768px, 480px, 414px, 375px, 320px
   Loaded after overrides.css so we can win specificity easily.
   ============================================================ */

/* ─────────────────────────────────────────────
   GLOBAL — touch targets, font sizing, scrolling
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    /* Buttons — bigger tap targets */
    body.rcn-theme .rcn-btn,
    body.rcn-theme .rcn-btn-sm {
        min-height: 40px !important;
        padding: 10px 14px !important;
        font-size: 14px !important;
    }
    body.rcn-theme .rcn-btn-lg {
        min-height: 48px !important;
        padding: 13px 18px !important;
        font-size: 15px !important;
    }
    body.rcn-theme .rcn-btn-sm {
        min-height: 34px !important;
        padding: 7px 10px !important;
        font-size: 12.5px !important;
    }

    /* Inputs — bigger tap targets and prevent iOS zoom-in (font ≥ 16px) */
    body.rcn-theme .rcn-input,
    body.rcn-theme .rcn-textarea,
    body.rcn-theme select.rcn-input,
    body.rcn-theme input.rcn-input,
    body.rcn-theme textarea.rcn-textarea {
        font-size: 16px !important;
        min-height: 44px !important;
        padding: 12px 14px !important;
    }
    body.rcn-theme textarea.rcn-textarea { min-height: 96px !important; }

    /* Container padding */
    body.rcn-theme .rcn-container-wide {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    /* Section vertical padding */
    body.rcn-theme .rcn-section { padding: 36px 0 !important; }
}

/* ─────────────────────────────────────────────
   HEADER — collapse to compact mobile bar
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    body.rcn-theme .rcn-header__nav-main {
        display: none !important;
    }
    body.rcn-theme .rcn-header__mobile-toggle {
        display: inline-flex !important;
    }
}
@media (max-width: 768px) {
    body.rcn-theme .rcn-header { padding: 0 !important; }
    body.rcn-theme .rcn-header__inner {
        padding: 8px 14px !important;
        gap: 10px !important;
    }
    body.rcn-theme .rcn-header__logo img {
        max-height: 32px !important;
        width: auto !important;
    }
    /* Hide "Sell" button text, keep just icon on phones */
    body.rcn-theme .rcn-header__sell-btn span:not(.rcn-icon) {
        display: none !important;
    }
    body.rcn-theme .rcn-header__sell-btn {
        padding: 8px 10px !important;
        min-width: 40px !important;
    }
}

/* ─────────────────────────────────────────────
   HERO SEARCH — stacked form, scrollable tabs
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-hero { padding: 60px 0 36px !important; min-height: auto !important; }
    body.rcn-theme .rcn-hero__title {
        font-size: clamp(24px, 7vw, 36px) !important;
        line-height: 1.15 !important;
        text-wrap: balance;
    }
    body.rcn-theme .rcn-hero__subtitle {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }
    body.rcn-theme .rcn-hero__badge {
        font-size: 11px !important;
        padding: 6px 12px !important;
    }
    body.rcn-theme .rcn-hero__search {
        margin-top: 20px !important;
        border-radius: 14px !important;
    }
    /* Tabs — horizontal scroll, smaller padding */
    body.rcn-theme .rcn-hero__tabs--six {
        grid-template-columns: none !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    body.rcn-theme .rcn-hero__tabs--six::-webkit-scrollbar { display: none; }
    body.rcn-theme .rcn-hero__tab {
        flex: 0 0 auto !important;
        padding: 12px 14px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }
    body.rcn-theme .rcn-hero__tab span { font-size: 12.5px !important; }

    /* Form: stack fields */
    body.rcn-theme .rcn-hero__form-fields {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    body.rcn-theme .rcn-hero__form { padding: 14px !important; }

    /* Chips: scroll horizontally */
    body.rcn-theme .rcn-hero__chips {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scrollbar-width: none;
        padding: 12px 0 4px !important;
        -webkit-overflow-scrolling: touch;
    }
    body.rcn-theme .rcn-hero__chips::-webkit-scrollbar { display: none; }
    body.rcn-theme .rcn-chip {
        flex: 0 0 auto !important;
        padding: 7px 12px !important;
        font-size: 12px !important;
    }
}

/* ─────────────────────────────────────────────
   TRUST STRIP — 2 cols on mobile, smaller text
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-trust-strip { padding: 24px 0 !important; }
    body.rcn-theme .rcn-trust-strip__grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }
    body.rcn-theme .rcn-trust-strip__item strong { font-size: 13px !important; }
    body.rcn-theme .rcn-trust-strip__item span { font-size: 11px !important; }
}
@media (max-width: 480px) {
    body.rcn-theme .rcn-trust-strip__grid {
        grid-template-columns: 1fr !important;
    }
}

/* ─────────────────────────────────────────────
   CATEGORY GRID — responsive
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    body.rcn-theme .rcn-cat-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 768px) {
    body.rcn-theme .rcn-cat-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    body.rcn-theme .rcn-cat-tile { aspect-ratio: 4/3 !important; }
    body.rcn-theme .rcn-cat-tile h3 { font-size: 14px !important; }
    body.rcn-theme .rcn-cat-tile p { font-size: 11px !important; }
}

/* ─────────────────────────────────────────────
   LISTING GRID — cards
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    body.rcn-theme .rcn-listing-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 600px) {
    body.rcn-theme .rcn-listing-grid {
        grid-template-columns: 1fr !important;
        gap: 14px !important;
    }
    body.rcn-theme .rcn-listing-card__title { font-size: 14px !important; }
    body.rcn-theme .rcn-listing-card__price { font-size: 16px !important; }
}

/* ─────────────────────────────────────────────
   SINGLE LISTING — sidebar stacks, gallery
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    body.rcn-theme .rcn-single-listing__layout {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    body.rcn-theme .rcn-single-listing__right {
        position: static !important;
    }
}
@media (max-width: 768px) {
    body.rcn-theme .rcn-gallery__hero { aspect-ratio: 4/3 !important; }
    body.rcn-theme .rcn-gallery__nav,
    body.rcn-theme .rcn-gallery__prev,
    body.rcn-theme .rcn-gallery__next {
        width: 38px !important;
        height: 38px !important;
    }
    body.rcn-theme .rcn-gallery__thumb {
        width: 64px !important;
        height: 48px !important;
    }
    body.rcn-theme .rcn-specs-strip {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 14px !important;
    }
    body.rcn-theme .rcn-specs-strip__item span { font-size: 9px !important; }
    body.rcn-theme .rcn-specs-strip__item strong { font-size: 12.5px !important; }

    /* Action buttons row */
    body.rcn-theme .rcn-listing-panel { padding: 16px !important; }
    body.rcn-theme .rcn-listing-panel__actions {
        gap: 4px !important;
        padding-bottom: 12px !important;
    }
    body.rcn-theme .rcn-listing-panel__act {
        flex: 1 !important;
        padding: 8px 4px !important;
        font-size: 12px !important;
        justify-content: center !important;
    }
    body.rcn-theme .rcn-listing-panel__title,
    body.rcn-theme h1.rcn-listing-panel__title {
        font-size: 18px !important;
    }
    body.rcn-theme .rcn-listing-panel__price {
        font-size: 22px !important;
    }

    /* Listing tabs scroll */
    body.rcn-theme .rcn-listing-tabs .rcn-tabs {
        overflow-x: auto !important;
        scrollbar-width: none;
    }
    body.rcn-theme .rcn-listing-tabs .rcn-tabs::-webkit-scrollbar { display: none; }
    body.rcn-theme .rcn-tab {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
    }

    /* Tabs content padding */
    body.rcn-theme .rcn-tabs__content { padding: 16px !important; }
    body.rcn-theme .rcn-spec-table th,
    body.rcn-theme .rcn-spec-table td {
        padding: 10px 6px !important;
        font-size: 12.5px !important;
    }
    body.rcn-theme .rcn-features {
        grid-template-columns: 1fr !important;
    }
}

/* ─────────────────────────────────────────────
   SELL WIZARD — form layout on mobile
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-sell-form { padding: 18px 14px !important; }
    body.rcn-theme .rcn-sell-section { padding: 18px 14px !important; }
    body.rcn-theme .rcn-sell-section__title { font-size: 17px !important; }
    /* Three-col grid → one-col */
    body.rcn-theme .rcn-sell-grid-3,
    body.rcn-theme .rcn-sell-grid-2 {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    /* Type selector tiles */
    body.rcn-theme .rcn-sell-type-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    body.rcn-theme .rcn-sell-type__icon img {
        max-width: 64px !important;
        max-height: 64px !important;
    }
    body.rcn-theme .rcn-sell-type__label {
        font-size: 12px !important;
    }
    /* Price field: keep amount big but compact */
    body.rcn-theme .rcn-sell-price-row {
        flex-direction: column !important;
        gap: 8px !important;
    }
    body.rcn-theme .rcn-sell-price-amount {
        width: 100% !important;
        font-size: 22px !important;
        text-align: center !important;
    }
    body.rcn-theme .rcn-sell-price-currency {
        width: 100% !important;
    }
    /* Conversion chips wrap */
    body.rcn-theme .rcn-sell-price-conversion {
        flex-wrap: wrap !important;
        justify-content: center !important;
    }
    /* Sticky submit on small screens */
    body.rcn-theme .rcn-sell-submit-row {
        position: sticky !important;
        bottom: 0 !important;
        background: #fff !important;
        padding: 14px !important;
        margin: 16px -14px -14px !important;
        border-top: 1px solid #e5e7eb !important;
        z-index: 5 !important;
    }
}

/* ─────────────────────────────────────────────
   USER DASHBOARD — already responsive, polish
   ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    body.rcn-theme .rcn-user-area__main {
        grid-template-columns: 1fr !important;
    }
    body.rcn-theme .rcn-user-sidebar { position: static !important; margin-bottom: 16px !important; }
}
@media (max-width: 768px) {
    body.rcn-theme .rcn-user-area { padding: 12px 0 32px !important; }
    body.rcn-theme .rcn-user-content { padding: 16px !important; }
    body.rcn-theme .rcn-mylistings-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    body.rcn-theme .rcn-mylistings-stat { padding: 12px !important; }
    body.rcn-theme .rcn-mylistings-stat__num { font-size: 22px !important; }
    body.rcn-theme .rcn-mylistings-stat__lbl { font-size: 11px !important; }

    /* Listing row: stack image above content */
    body.rcn-theme .rcn-mylisting-row {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    body.rcn-theme .rcn-mylisting-row__image {
        width: 100% !important;
        max-height: 200px !important;
    }
    body.rcn-theme .rcn-mylisting-row__actions {
        flex-direction: row !important;
        flex-wrap: wrap !important;
    }
    body.rcn-theme .rcn-mylisting-row__actions .rcn-btn {
        flex: 1 1 calc(50% - 4px) !important;
        min-width: 0 !important;
    }
}

/* ─────────────────────────────────────────────
   STAFF PANEL — tabs scroll, cards stack
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-staff__container { padding: 12px !important; }
    body.rcn-theme .rcn-staff__tabs {
        overflow-x: auto !important;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
    }
    body.rcn-theme .rcn-staff__tabs::-webkit-scrollbar { display: none; }
    body.rcn-theme .rcn-staff__tab {
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        padding: 10px 14px !important;
        font-size: 13px !important;
    }
    /* Diagnostics grid */
    body.rcn-theme .rcn-diag-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }
    body.rcn-theme .rcn-diag-card { padding: 14px 16px !important; }
    body.rcn-theme .rcn-diag-big { font-size: 26px !important; }
    body.rcn-theme .rcn-diag-msgs { font-size: 12px !important; }
    body.rcn-theme .rcn-diag-msgs th,
    body.rcn-theme .rcn-diag-msgs td { padding: 6px 8px !important; }
}

/* ─────────────────────────────────────────────
   ARCHIVE / FILTERS
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-archive__layout {
        grid-template-columns: 1fr !important;
    }
    body.rcn-theme .rcn-archive__filters {
        position: static !important;
    }
    body.rcn-theme .rcn-archive__filter-toggle {
        display: inline-flex !important;
        width: 100% !important;
        justify-content: center !important;
        margin-bottom: 12px !important;
    }
    body.rcn-theme .rcn-archive__sort {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    body.rcn-theme .rcn-archive__sort select {
        flex: 1 !important;
    }
}

/* ─────────────────────────────────────────────
   FOOTER — stack columns
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-footer { padding: 36px 0 24px !important; }
    body.rcn-theme .rcn-footer__columns {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }
    body.rcn-theme .rcn-footer__heading { font-size: 12px !important; }
    body.rcn-theme .rcn-footer__bottom {
        flex-direction: column !important;
        gap: 12px !important;
        text-align: center !important;
    }
}
@media (max-width: 480px) {
    body.rcn-theme .rcn-footer__columns {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
        text-align: center !important;
    }
    body.rcn-theme .rcn-footer__brand { text-align: center !important; }
}

/* ─────────────────────────────────────────────
   CONTACT MODAL — fullscreen on small phones
   ───────────────────────────────────────────── */
@media (max-width: 600px) {
    body.rcn-theme .rcn-contact-modal {
        align-items: flex-end !important;
        padding: 0 !important;
    }
    body.rcn-theme .rcn-contact-modal__panel {
        width: 100% !important;
        max-width: none !important;
        max-height: 92vh !important;
        border-radius: 16px 16px 0 0 !important;
        margin: 0 !important;
    }
    body.rcn-theme .rcn-contact-modal__body { padding: 18px !important; }
    body.rcn-theme .rcn-contact-modal__head { padding: 16px 18px !important; }
    body.rcn-theme .rcn-contact-modal__privacy {
        font-size: 12.5px !important;
        padding: 10px !important;
    }
}

/* ─────────────────────────────────────────────
   LOGIN / REGISTER
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-login-main {
        padding: 24px 0 !important;
    }
    body.rcn-theme .rcn-login-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
    body.rcn-theme .rcn-login-card { padding: 22px !important; }
    body.rcn-theme .rcn-login-card h2 { font-size: 18px !important; }
}

/* ─────────────────────────────────────────────
   CURRENCY SWITCHER PILL — reposition on phone
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme #rcn-currency-switcher {
        bottom: 12px !important;
        right: 12px !important;
        padding: 7px 10px !important;
        font-size: 12px !important;
    }
    body.rcn-theme #rcn-currency-switcher__dropdown {
        right: 0 !important;
        max-height: 60vh !important;
    }
}

/* ─────────────────────────────────────────────
   PAGINATION — bigger tap targets
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-pagination a,
    body.rcn-theme .rcn-pagination span {
        min-width: 40px !important;
        min-height: 40px !important;
        padding: 9px 12px !important;
        font-size: 13.5px !important;
    }
}

/* ─────────────────────────────────────────────
   BECOME DEALER / FORMS GENERAL
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-dealer-apply { padding: 24px 14px !important; }
    body.rcn-theme .rcn-dealer-apply h1 { font-size: 22px !important; }
    body.rcn-theme .rcn-dealer-form-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ─────────────────────────────────────────────
   GALLERY FULLSCREEN — adjust for portrait
   ───────────────────────────────────────────── */
@media (max-width: 768px) {
    body.rcn-theme .rcn-gallery__overlay { padding: 16px !important; }
    body.rcn-theme .rcn-gallery__overlay img {
        max-width: 96vw !important;
        max-height: 80vh !important;
    }
    body.rcn-theme .rcn-gallery__close {
        width: 40px !important;
        height: 40px !important;
        top: 12px !important;
        right: 12px !important;
    }
    body.rcn-theme .rcn-gallery__overlay .rcn-gallery__prev { left: 8px !important; }
    body.rcn-theme .rcn-gallery__overlay .rcn-gallery__next { right: 8px !important; }
}

/* ─────────────────────────────────────────────
   320–375px — very small phones
   ───────────────────────────────────────────── */
@media (max-width: 375px) {
    body.rcn-theme .rcn-hero__title {
        font-size: 22px !important;
    }
    body.rcn-theme .rcn-mylistings-stats {
        grid-template-columns: 1fr !important;
    }
    body.rcn-theme .rcn-listing-panel__actions {
        flex-wrap: wrap !important;
    }
    body.rcn-theme .rcn-listing-panel__act span {
        display: none !important;  /* icon-only buttons */
    }
    body.rcn-theme .rcn-listing-panel__act {
        padding: 8px 6px !important;
    }
}

/* ─────────────────────────────────────────────
   PRINT — clean, no nav/footer
   ───────────────────────────────────────────── */
@media print {
    body.rcn-theme .rcn-header,
    body.rcn-theme .rcn-footer,
    body.rcn-theme #rcn-currency-switcher,
    body.rcn-theme .rcn-listing-panel__actions,
    body.rcn-theme .rcn-listing-panel__cta,
    body.rcn-theme .rcn-contact-section,
    body.rcn-theme .rcn-gallery__overlay {
        display: none !important;
    }
    body.rcn-theme .rcn-single-listing__layout {
        grid-template-columns: 1fr !important;
    }
    body.rcn-theme * {
        box-shadow: none !important;
    }
}
