/* Responsive CSS - Extracted from style.css */

/* 1. UTILITIES */
@media (max-width: 768px) { .cols-md-1 { --cols: 1; } .cols-md-2 { --cols: 2; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .no-print { display: none !important; }
  body { background: white; color: black; }
  .site-wrapper { display: block; padding: 0; }
}

/* 2. FOOTER */
@media (max-width: 1024px) {
    .pb-footer-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-newsletter { grid-column: span 2; }
}

@media (max-width: 600px) {
    .pb-footer-grid { grid-template-columns: 1fr; }
    .footer-newsletter { grid-column: span 1; }
}

/* 3. HOME CATEGORIES */
@media (max-width: 768px) {
    .pb-category-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .pb-cat-media {
        aspect-ratio: 16/9; /* Video aspect for mobile */
        order: -1; /* Media on top for mobile */
    }
    .pb-cat-text {
        padding: var(--s-4);
        border-right: none;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* 4. RELATED PRODUCTS */
@media (max-width: 1024px) { /* Tablet */
    section.related.products ul.products li.product, 
    section.up-sells.products ul.products li.product {
        flex: 0 0 50%; /* 2 columns */
        width: 50%;
    }
}

@media (max-width: 600px) { /* Mobile */
  .woocommerce ul.products {
    gap: var(--s-5);
  }

  section.related.products ul.products li.product, 
  section.up-sells.products ul.products li.product {
      flex: 0 0 100%; /* 1 column */
      width: 100%;
  }

  .woocommerce ul.products:not(.related):not(.up-sells) {
    grid-template-columns: 1fr; /* Maintain grid for shop loop */
  }
  
  .pb-product-cta-overlay {
    bottom: 0; /* Sempre visibile su mobile */
  }
}

/* 5. SINGLE PRODUCT */
@media (max-width: 768px) {
    .pb-single-product-grid {
        flex-direction: column;
    }
    
    .pb-product-images-stack,
    .woocommerce div.product div.summary {
        width: 100% !important;
        flex: 1 1 100%;
        position: static;
    }
}

/* 6. CART PAGE */
@media (min-width: 768px) {
    .pb-cart-layout,
    .pb-checkout-layout {
        display: grid;
        grid-template-columns: 2fr 2fr; /* Match Cart Layout */
        gap: var(--s-8);
        max-width: 1200px;
        margin: 80px auto 120px;
    }

    /* Checkout Sticky Sidebar (Desktop Only) */
    .pb-checkout-review {
        position: sticky;
        top: 100px;
        height: fit-content;
    }
}

@media (max-width: 600px) {
    .pb-cart-products .shop_table tr.cart_item {
        grid-template-columns: auto 80px 1fr;
        grid-template-rows: auto auto;
        gap: var(--s-2);
    }
    .product-price, .product-subtotal {
        grid-column: 3;
        text-align: left;
    }
}

/* 7. CHECKOUT LAYOUT (Extracted) */
@media (min-width: 768px) {
    .pb-checkout-layout {
        display: grid;
        grid-template-columns: 55% 42%; /* Tuned for slightly wider details */
        justify-content: space-between;
        gap: 3%;
        max-width: 100%;
    }
    .pb-checkout-review {
        position: sticky;
        top: 20px;
        height: fit-content;
        margin-top: 0;
    }
}

/* 8. META AGROS BLOCK (Extracted) */
@media (max-width: 768px) {
    .pb-meta-agros-grid {
        grid-template-columns: 1fr;
    }
    .pb-meta-agros-title {
        font-size: 32px;
    }
}
