/* ==========================================================================
   RESPONSIVE — TUTTI i media query in un unico posto
   ==========================================================================
   Breakpoints:
   - sm:  576px  (landscape phone)
   - md:  768px  (tablet)
   - lg:  992px  (desktop)
   - xl:  1200px (large desktop)
   ========================================================================== */

/* ══════════════════════════════════════════════════════════════════════
   TABLET (max-width: 992px)
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 992px) {
    /* Header */
    .fc-header__nav { display: none; }
    .fc-menu-toggle { display: flex; }

    .fc-header {
        height: var(--header-height-mobile);
    }

    /* Menu mobile aperto */
    .fc-header__nav.is-open {
        display: block;
        position: absolute;
        top: var(--header-height-mobile);
        right: var(--space-4);
        background: var(--color-white);
        box-shadow: var(--shadow-lg);
        border-radius: var(--border-radius);
        min-width: 200px;
        z-index: var(--z-dropdown);
        padding: var(--space-2) 0;
    }

    .fc-header__nav.is-open .fc-nav__list {
        flex-direction: column;
        gap: 0;
    }

    .fc-header__nav.is-open .fc-nav__list li a {
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--color-border-light);
    }

    .fc-header__nav.is-open .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: var(--space-4);
    }

    /* Shop grid: 2 colonne */
    .woocommerce ul.products {
        grid-template-columns: repeat(var(--shop-columns-tablet), 1fr);
    }

    /* Sidebar: drawer laterale su tablet/mobile */
    .fc-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85vw;
        max-width: 360px;
        height: 100vh;
        z-index: var(--z-overlay, 1000);
        overflow-y: auto;
        background: var(--color-white);
        box-shadow: var(--shadow-lg);
        padding: var(--space-6) var(--space-4);
        transition: left 0.3s ease;
    }

    .fc-sidebar.is-open {
        left: 0;
    }

    .fc-sidebar__close {
        display: block;
        position: absolute;
        top: var(--space-3);
        right: var(--space-3);
        background: none;
        border: none;
        font-size: 28px;
        color: var(--color-text-muted);
        cursor: pointer;
        line-height: 1;
        padding: var(--space-1);
    }

    .fc-sidebar__close:hover {
        color: var(--color-text);
    }

    /* Overlay dietro sidebar */
    .fc-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: calc(var(--z-overlay, 1000) - 1);
    }

    .fc-sidebar-overlay.is-visible {
        display: block;
    }

    /* Pulsante "Filtri" nella toolbar */
    .fc-filter-toggle-btn {
        display: inline-flex;
        align-items: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-3);
        border: 1px solid var(--color-border);
        border-radius: var(--border-radius-sm);
        background: var(--color-white);
        color: var(--color-text);
        font-size: var(--font-size-sm);
        cursor: pointer;
        flex-shrink: 0;
        transition: all var(--transition-fast);
    }

    .fc-filter-toggle-btn:hover {
        border-color: var(--color-primary);
        color: var(--color-primary);
    }

    .fc-filter-toggle-btn .fc-active-count {
        background: var(--color-primary);
        color: var(--color-white);
        border-radius: var(--border-radius-full);
        width: 20px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 11px;
        font-weight: var(--font-weight-bold);
    }

    .fc-shop-layout {
        flex-direction: column;
    }

    /* Trust bar: 2x2 */
    .fc-trust-bar__items {
        flex-wrap: wrap;
    }

    .fc-trust-bar__item {
        flex: 0 0 calc(50% - var(--space-2));
    }

    /* Footer grid: 2 colonne */
    .fc-footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Blog grid: 2 colonne */
    .fc-posts {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Checkout: singola colonna */
    .woocommerce form.checkout {
        grid-template-columns: 1fr;
    }

    .woocommerce form.checkout #order_review {
        grid-column: 1;
    }

    /* Account login: singola colonna */
    .woocommerce-account #customer_login {
        grid-template-columns: 1fr;
    }

    /* Prodotto singolo: stack verticale */
    .woocommerce div.product div.images,
    .woocommerce div.product div.summary {
        width: 100%;
        float: none;
    }

    /* Related products: 2 colonne */
    .woocommerce div.product .related ul.products {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ══════════════════════════════════════════════════════════════════════
   MOBILE (max-width: 768px)
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Header sticky */
    .fc-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: var(--z-header);
    }

    /* Offset per header fisso */
    .fc-main {
        padding-top: var(--header-height-mobile);
    }

    /* Shop grid: 1 colonna su mobile */
    .woocommerce ul.products {
        grid-template-columns: 1fr;
    }

    /* Trust bar: verticale */
    .fc-trust-bar__items {
        flex-direction: column;
    }

    .fc-trust-bar__item {
        flex: none;
    }

    /* Hero piu' basso */
    .fc-hero {
        min-height: var(--hero-height-mobile);
    }

    .fc-hero__title {
        font-size: var(--font-size-2xl);
    }

    /* Footer: singola colonna */
    .fc-footer__grid {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .fc-footer__bottom-inner {
        flex-direction: column;
        gap: var(--space-2);
        text-align: center;
    }

    /* Blog: singola colonna */
    .fc-posts {
        grid-template-columns: 1fr;
    }

    /* Tipografia mobile */
    h1 { font-size: var(--font-size-2xl); }
    h2 { font-size: var(--font-size-xl); }
    h3 { font-size: var(--font-size-lg); }

    .fc-page__title { font-size: var(--font-size-2xl); }
    .fc-shop-header__title { font-size: var(--font-size-xl); }

    /* Toast mobile: full-width */
    .fc-toast {
        left: var(--space-2);
        right: var(--space-2);
        max-width: none;
    }

    /* Carrello: tabella scroll */
    .woocommerce table.shop_table {
        display: block;
        overflow-x: auto;
    }

    /* Account nav: full-width sopra */
    .woocommerce-MyAccount-navigation {
        width: 100%;
        float: none;
        margin-bottom: var(--space-4);
    }

    .woocommerce-MyAccount-content {
        margin-left: 0;
    }

    /* Vista lista: compatta su tablet */
    .fc-list-view ul.products li.product {
        grid-template-columns: 80px 1fr;
        padding: 8px 12px;
    }

    .fc-list-view ul.products li.product a img {
        width: 80px;
        min-width: 80px;
        height: 80px;
    }

    .fc-info-line {
        padding-left: 96px;
    }

    /* Toolbar: stack su tablet */
    .fc-shop-toolbar {
        flex-wrap: wrap;
    }

    .fc-product-search {
        flex: 1 1 100%;
        order: 1;
    }

    .fc-view-toggle {
        order: 2;
    }

    .fc-shop-toolbar .woocommerce-ordering {
        order: 3;
        flex: 1;
    }

    /* Sidebar price filter */
    .fc-sidebar__price-inputs {
        flex-wrap: wrap;
    }

    /* 404 actions */
    .fc-404__actions {
        flex-direction: column;
        align-items: center;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   SMALL MOBILE (max-width: 480px)
   ══════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
    .fc-container {
        padding-left: var(--space-3);
        padding-right: var(--space-3);
    }

    .woocommerce div.product form.cart .single_add_to_cart_button {
        width: 100%;
    }

    .fc-post-card__thumb img {
        height: 150px;
    }

    /* Lista: immagine piu' piccola su small mobile */
    .fc-list-view ul.products li.product {
        grid-template-columns: 70px 1fr;
        padding: 6px 10px;
        gap: 0 10px;
    }

    .fc-list-view ul.products li.product a img {
        width: 70px;
        min-width: 70px;
        height: 70px;
    }

    .fc-list-view ul.products li.product .woocommerce-loop-product__title {
        font-size: 12px;
    }

    .fc-list-view ul.products li.product .price {
        font-size: 15px;
    }

    .fc-info-line {
        padding-left: 80px;
        font-size: 10px;
    }

    .fc-search-form__field {
        height: 42px;
        font-size: 14px;
    }

    .fc-search-form__btn {
        width: 44px;
    }
}
