/**
 * FrameCraft Pro — Responsive overrides (v1.0.85).
 * Comprehensive mobile + tablet responsiveness for the SINGLE PRODUCT page.
 *
 * Breakpoints:
 *   - Large desktop    > 1280px (default, see single-product.css)
 *   - Small desktop     1024–1280px
 *   - Tablet            768–1024px
 *   - Large mobile      600–768px
 *   - Small mobile      480–600px
 *   - Tiny mobile       < 480px
 *
 * v1.0.85 FIX: The previous responsive.css set `grid-template-columns` on the
 * .fc-size-row but the base style in single-product.css is `display:flex` (not
 * grid), so the override was a no-op and the size buttons kept overflowing
 * the viewport on mobile. Now we explicitly switch `display:grid` at the
 * breakpoints so the buttons actually stack / wrap.
 */

/* ============= SMALL DESKTOP (<= 1280px) ============= */
@media (max-width: 1280px) {
        :root { --fc-page-padding: 60px; }

        .fc-product-hero { gap: 40px; }
        .fc-title { font-size: 38px; }
}

/* ============= TABLET (<= 1024px) ============= */
@media (max-width: 1024px) {
        :root { --fc-page-padding: 40px; }

        /* Hero collapses to a single column (gallery above info). */
        .fc-product-hero {
                grid-template-columns: 1fr;
                gap: 32px;
                padding-top: 32px;
        }

        /* Gallery: vertical thumb strip becomes a horizontal scroll strip
           above the featured image. */
        .fc-gallery-wrap {
                position: static;
                grid-template-columns: 1fr;
                gap: 12px;
                align-items: start;
        }
        .fc-thumbs {
                flex-direction: row;
                height: auto;
                max-height: none;
                min-height: 0;
                overflow-x: auto;
                overflow-y: hidden;
                padding-bottom: 6px;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
        }
        .fc-thumbs::-webkit-scrollbar { display: none; }
        .fc-thumb {
                width: 72px;
                height: 90px;
                flex: 0 0 72px;
                min-height: 0;
        }

        .fc-title { font-size: 32px; }
        .fc-collection { font-size: 18px; }

        /* v1.0.85 FIX: Size buttons — switch to a 2-column GRID so they wrap
           instead of overflowing. The base style is `display:flex` with
           `flex-wrap:nowrap`, so we MUST override `display` here. */
        .fc-size-row {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 8px;
                flex-wrap: wrap;
        }
        .fc-size-btn {
                flex: none;
                width: 100%;
                min-width: 0;
                padding: 11px 10px;
                font-size: 13px !important;
                white-space: normal;
                text-align: center;
        }
        .fc-size-btn .fc-size-label,
        .fc-size-btn .fc-size-price {
                font-size: 13px !important;
        }

        /* Trust badges: allow wrapping on tablet. */
        .fc-trust-badges { flex-wrap: wrap; }

        /* Related: 3 visible on tablet. */
        .fc-related-slider { --fc-visible-count: 3 !important; }
        .fc-related-grid {
                grid-template-columns: none !important;
                grid-auto-columns: calc((100% - (var(--fc-visible-count, 3) - 1) * 20px) / var(--fc-visible-count, 3));
                gap: 20px;
        }
        .fc-related-title { font-size: 30px; }

        /* Footer: 2-col on tablet. */
        .fc-footer-grid {
                grid-template-columns: 1fr 1fr;
                gap: 32px;
        }
        .fc-footer-newsletter { grid-column: 1 / -1; }
}

/* ============= LARGE MOBILE (<= 768px) ============= */
@media (max-width: 768px) {
        :root { --fc-page-padding: 24px; }

        .fc-product-hero {
                gap: 24px;
                padding-top: 24px;
                padding-bottom: 40px;
        }

        /* Breadcrumb: smaller + less padding. */
        .fc-breadcrumb { padding: 10px 0; font-size: 11px; }
        .fc-breadcrumb .fc-sep { margin: 0 4px; }

        .fc-title { font-size: 28px; line-height: 1.25; }
        .fc-collection { font-size: 16px; margin-bottom: 6px; }

        .fc-info-header { margin-bottom: 14px; }

        /* Description + read more. */
        .fc-description { font-size: 13px !important; margin-bottom: 18px; line-height: 1.6 !important; }
        .fc-read-more { font-size: 10px; margin-top: 14px !important; }

        /* Option blocks: tighter spacing + taller touch targets. */
        .fc-option-block { margin-bottom: 16px; }
        .fc-option-label { font-size: 12px; margin-bottom: 6px; }

        /* Select dropdown: taller for touch. */
        .fc-select { height: 44px; font-size: 14px; padding: 0 38px 0 14px; }

        /* Size buttons: keep 2-col grid but slightly bigger touch area. */
        .fc-size-row {
                display: grid;
                grid-template-columns: 1fr 1fr;
                gap: 8px;
        }
        .fc-size-btn {
                padding: 12px 10px;
                font-size: 13px !important;
                white-space: normal;
        }

        /* Upload row: stack vertically, full-width button. */
        .fc-upload-row {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
        }
        .fc-btn-upload {
                width: 100%;
                justify-content: center;
                padding: 12px 16px;
        }
        .fc-upload-side {
                padding-top: 0;
                align-items: center;
        }
        .fc-expert-suggestion { font-size: 11px; }

        .fc-privacy-notice { font-size: 12px; line-height: 1.5; margin-top: 10px; }

        /* ATC button: taller touch target. */
        .fc-atc-block { margin-top: 18px; }
        .fc-btn-atc { height: 48px; font-size: 14px !important; }
        .fc-btn { padding: 13px 20px; font-size: 12px !important; }

        /* Trust badges: wrap with smaller text. */
        .fc-trust-badges {
                flex-wrap: wrap;
                gap: 6px 10px;
                margin-top: 14px;
        }
        .fc-trust-badges li { font-size: 12px; white-space: normal; }
        .fc-trust-badges li + li::before { margin-right: 6px; }

        /* Accordion headers: bigger touch target. */
        .fc-accordion-header { padding: 14px 0; font-size: 14px; }
        .fc-accordion-content { font-size: 13px; line-height: 1.6; }

        /* "Why this frame" section — single column. */
        .fc-why-section { padding: 24px var(--fc-page-padding) 48px; }
        .fc-why-title { font-size: 26px; margin-bottom: 20px; }
        .fc-why-subtitle { font-size: 15px; margin-bottom: 24px !important; }
        .fc-why-grid { grid-template-columns: 1fr; gap: 28px; }
        .fc-why-block-body { min-height: 0; }

        /* Related: 2 visible. */
        .fc-related-section { padding: 40px var(--fc-page-padding) 60px; }
        .fc-related-slider { --fc-visible-count: 2 !important; }
        .fc-related-heading-row { margin-bottom: 20px; gap: 12px; }
        .fc-related-title { font-size: 24px; }
        .fc-related-grid {
                grid-template-columns: none !important;
                grid-auto-columns: calc((100% - (var(--fc-visible-count, 2) - 1) * 16px) / var(--fc-visible-count, 2));
                gap: 16px;
        }
        .fc-related-title-row h3 { font-size: 16px; }
        .fc-related-price { font-size: 13px; }
        .fc-related-nav { width: 32px; height: 32px; }

        /* Footer: single column. */
        .fc-footer { padding: 48px 0 24px; margin-top: 32px; }
        .fc-footer-grid {
                grid-template-columns: 1fr;
                gap: 28px;
                padding-bottom: 28px;
        }
        .fc-newsletter-form { max-width: 100%; }
        .fc-newsletter-form input { height: 42px; font-size: 13px; }
        .fc-newsletter-form button { height: 42px; padding: 0 16px; font-size: 11px; }

        /* Guidance / size-guide modal: nearly full width, scrollable. */
        .fc-guidance-modal-content {
                padding: 28px 20px 24px;
                width: calc(100% - 24px);
                max-height: 92vh;
        }
        .fc-guidance-modal-title { font-size: 20px !important; padding-right: 36px; }
        .fc-guidance-modal-subtitle { font-size: 12px; margin-bottom: 18px; }
        .fc-guidance-form { gap: 14px; }
        .fc-guidance-field input,
        .fc-guidance-field textarea { padding: 10px 12px; font-size: 16px; }
        .fc-btn-guidance-submit { height: 46px; font-size: 13px !important; }

        /* Adjustment controls: stay 2-col. */
        .fc-adjust-row { grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 0 0; }
}

/* ============= SMALL MOBILE (<= 600px) ============= */
@media (max-width: 600px) {
        :root { --fc-page-padding: 20px; }

        .fc-product-hero {
                gap: 20px;
                padding-top: 20px;
                padding-bottom: 36px;
        }

        .fc-breadcrumb { padding: 8px 0; font-size: 10px; }

        .fc-title { font-size: 24px; line-height: 1.25; }
        .fc-collection { font-size: 14px; margin-bottom: 6px; }

        /* Gallery thumbs: smaller still. */
        .fc-gallery-wrap { gap: 10px; }
        .fc-thumbs { padding-bottom: 4px; }
        .fc-thumb { width: 60px; height: 76px; flex: 0 0 60px; }

        /* Size buttons: single column — no overflow possible. */
        .fc-size-row {
                display: grid;
                grid-template-columns: 1fr;
                gap: 8px;
        }
        .fc-size-btn {
                padding: 12px 14px;
                font-size: 13px !important;
                white-space: normal;
                justify-content: space-between;
        }

        .fc-read-more { margin-top: 12px !important; }

        /* Trust badges: full stack with no pipe separators. */
        .fc-trust-badges {
                flex-direction: column;
                align-items: flex-start;
                gap: 6px;
        }
        .fc-trust-badges li + li::before { display: none; }
        .fc-trust-badges li { font-size: 12px; }

        .fc-atc-block { margin-top: 16px; }
        .fc-accordions { margin-top: 18px; }

        /* Related section: tighter padding. */
        .fc-related-section { padding: 32px var(--fc-page-padding) 48px; }
        .fc-related-heading-row { margin-bottom: 16px; }
        .fc-related-title { font-size: 22px; }

        .fc-footer { padding: 40px 0 20px; margin-top: 24px; }

        /* Guidance modal: minimal side margins. */
        .fc-guidance-modal-content {
                width: calc(100% - 16px);
                padding: 24px 18px 22px;
        }
}

/* ============= TINY MOBILE (<= 480px) ============= */
@media (max-width: 480px) {
        :root { --fc-page-padding: 16px; }

        .fc-title { font-size: 22px; }

        /* Related: 1 visible — cards become full width. */
        .fc-related-slider { --fc-visible-count: 1 !important; }
        .fc-related-grid {
                grid-template-columns: none !important;
                grid-auto-columns: 100%;
                gap: 14px;
        }

        /* Size buttons: smaller text to fit the narrow column. */
        .fc-size-btn {
                padding: 10px 12px;
                font-size: 12px !important;
        }
        .fc-size-btn .fc-size-label,
        .fc-size-btn .fc-size-price {
                font-size: 12px !important;
        }

        /* Upload + ATC buttons: full width. */
        .fc-btn-upload { width: 100%; padding: 12px 14px; font-size: 11px !important; }
        .fc-btn-atc { height: 46px; font-size: 13px !important; }

        /* Footer newsletter: stack input + button. */
        .fc-newsletter-form { flex-direction: column; gap: 8px; }
        .fc-newsletter-form input { width: 100%; border-right: 1px solid #EAEAEA; }
        .fc-newsletter-form button { width: 100%; }
}

/* ============= VERY TINY (<= 360px) ============= */
@media (max-width: 360px) {
        :root { --fc-page-padding: 12px; }
        .fc-title { font-size: 20px; }
        .fc-collection { font-size: 13px; }
        .fc-related-title { font-size: 20px; }
}

/* ============= WIDE DESKTOP (>= 1500px) ============= */
@media (min-width: 1500px) {
        :root { --fc-container-w: 1440px; }
        .fc-title { font-size: 44px; }
}

/* ============= PRINT (admin order PDFs etc.) ============= */
@media print {
        .fc-footer, .fc-related-section, .fc-trust-badges, .fc-accordions {
                display: none !important;
        }
        .fc-product-hero {
                grid-template-columns: 1fr;
        }
}
