/* =============================================
   PRINTORA – RESPONSIVE DESIGN SYSTEM
   Breakpoints:
   - Mobile Small : ≤ 480px
   - Mobile       : ≤ 768px
   - Tablet       : ≤ 1024px
   - Desktop Wide : ≥ 1280px
   ============================================= */

/* ---- GLOBAL: Container ---- */
.container {
  width: 100%;
  padding: 0 1.5rem;
}

/* ---- RESPONSIVE 2-COLUMN CONTENT SECTIONS ---- */
/* Used for wide side-by-side content sections that have inline style= grids */
@media (max-width: 1024px) {
  .resp-2col-section {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 1rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.875rem;
  }
}

/* ---- GLOBAL: Sections ---- */
@media (max-width: 768px) {
  .section {
    padding: 3.5rem 0;
  }
}

@media (max-width: 480px) {
  .section {
    padding: 2.5rem 0;
  }
}

/* ---- HEADER / NAV ---- */
@media (max-width: 1024px) {
  .nav-links {
    gap: 1rem;
  }

  .nav-badge {
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    border-radius: 10px;
  }
}

@media (max-width: 768px) {
  header {
    height: 64px;
  }

  .nav-links {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }
}

/* ---- HERO (index.php) ---- */
.hero-section {
  padding: clamp(3rem, 8vw, 8rem) 0 clamp(2rem, 6vw, 6rem);
}

@media (max-width: 768px) {
  .hero-section {
    padding: 2.5rem 0 2rem;
  }

  .hero-main-title {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
    line-height: 1.15;
    margin-bottom: 1rem;
  }

  .hero-sub-wrap {
    margin-bottom: 2rem !important;
  }

  .hero-sub-wrap p {
    font-size: 1rem !important;
    line-height: 1.55;
  }

  .btn-hero {
    width: 100%;
    justify-content: center;
    max-width: 360px;
  }
}

@media (max-width: 480px) {
  .hero-main-title {
    font-size: clamp(1.7rem, 9vw, 2.2rem);
  }

  .btn-hero {
    font-size: 0.95rem !important;
    padding: 0.8rem 1.5rem !important;
  }
}

/* ---- GRIDS ---- */
/* grid-3: 3-col → 2-col (tablet) → 1-col (mobile) */
@media (max-width: 1024px) {
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .grid-3 {
    grid-template-columns: 1fr !important;
  }
}

/* grid-2: already 1-col at ≤992px in style.css – tablet supplement */
@media (max-width: 1024px) and (min-width: 993px) {
  .grid-2,
  .grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

/* ---- PRODUCT CARDS (homepage cards) ---- */
@media (max-width: 768px) {
  .card-premium {
    padding: 1.75rem;
  }

  .card-title-hc {
    font-size: 1.3rem !important;
  }

  .hp-card-header {
    flex-direction: column;
    gap: 0.75rem;
  }

  .price-big {
    font-size: 1.8rem !important;
  }
}

@media (max-width: 480px) {
  .card-premium {
    padding: 1.25rem;
  }
}

/* ---- PERK CARDS (Perché Scegliere) ---- */
@media (max-width: 768px) {
  .perk-card {
    padding: 2rem 1.25rem;
  }
}

/* ---- PRODUCT PAGES – COMMON main-grid (2-col configurator) ---- */
/* Already handled per-page but we add a fallback here for any other usage */
@media (max-width: 1024px) {
  .main-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }

  .sticky-side {
    position: relative !important;
    top: 0 !important;
  }
}

/* ---- PRODUCT PAGE CONFIG CARD ---- */
@media (max-width: 768px) {
  .config-card {
    padding: 1.5rem !important;
    border-radius: 20px !important;
  }
}

@media (max-width: 480px) {
  .config-card {
    padding: 1.25rem !important;
    border-radius: 16px !important;
  }
}

/* ---- PRESET GRID (banner & index) ---- */
@media (max-width: 600px) {
  .preset-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 380px) {
  .preset-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---- FIELD ROW (2-col input row) ---- */
@media (max-width: 600px) {
  .field-row {
    grid-template-columns: 1fr !important;
    gap: 1rem;
  }
}

/* ---- BUTTONS ---- */
@media (max-width: 768px) {
  .btn-lg {
    padding: 1rem 1.75rem;
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .btn.w-full,
  .btn-lg.w-full {
    font-size: 0.95rem;
    padding: 0.9rem 1.25rem;
  }
}

/* ---- GALLERY GRIDS (product pages) ---- */
/* Banner / Rollup / DTF gallery sections use grid-cols-3 */
@media (max-width: 1024px) {
  .gallery-grid,
  .gallery-cols-3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 600px) {
  .gallery-grid,
  .gallery-cols-3 {
    grid-template-columns: 1fr !important;
  }
}

/* ---- REVIEW CARDS ---- */
@media (max-width: 768px) {
  .review-item {
    padding: 1.5rem;
  }
}

/* ---- CHECKOUT GRID ---- */
/* Already 1-col at ≤1100px in style.css; ensure summary card is not sticky on mobile */
@media (max-width: 768px) {
  .summary-card {
    position: static !important;
    top: auto !important;
  }
}

/* ---- CART ITEMS ---- */
@media (max-width: 480px) {
  .item-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-thumb {
    width: 100%;
    height: 160px;
    border-radius: 12px;
  }
}

/* ---- FOOTER ---- */
/* Already handled in style.css. Supplement for mid-range tablets */
@media (max-width: 860px) and (min-width: 601px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

@media (max-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }

  .footer-branding {
    grid-column: span 1 !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }
}

/* ---- FAQ ACCORDION ---- */
@media (max-width: 768px) {
  .faq-header {
    padding: 1rem 1.25rem;
    font-size: 0.9rem;
  }

  .faq-content p {
    font-size: 0.8rem;
  }
}

/* ---- SECTION TITLES ---- */
@media (max-width: 768px) {
  .section-title {
    font-size: clamp(1.6rem, 7vw, 2.5rem) !important;
    margin-bottom: 1rem;
  }

  .text-sub {
    font-size: 0.95rem !important;
  }
}

/* ---- OVERFLOW SAFETY (global) ---- */
* {
  max-width: 100%;
}

img {
  max-width: 100%;
  /* Removed global height:auto to avoid breaking fixed-dimension logos. 
     Specific responsive images should use a utility class or be handled individually. */
}

video,
iframe {
  max-width: 100%;
  height: auto;
}

/* ---- SWIPER (testimonials / reviews) ---- */
@media (max-width: 768px) {
  .swiper-button-next,
  .swiper-button-prev {
    display: none !important;
  }
}

/* ---- COMPARISON TABLE (dtf.php) ---- */
@media (max-width: 768px) {
  .comparison-table {
    font-size: 0.78rem;
  }

  .comparison-table th,
  .comparison-table td {
    padding: 0.75rem 0.5rem;
  }
}

/* ---- DELIVERY / INFO ROW ---- */
@media (max-width: 480px) {
  .delivery-row,
  .info-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

/* ---- BENEFIT GRID BOXED (banner hero) ---- */
@media (max-width: 1024px) {
  .benefit-grid-boxed {
    grid-template-columns: repeat(3, 1fr);
    padding: 2.5rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .benefit-grid-boxed {
    grid-template-columns: 1fr !important;
    margin-top: -3rem;
    margin-left: 1rem;
    margin-right: 1rem;
    padding: 2rem 1.25rem;
    gap: 2rem;
  }
}

/* ---- RIVENDITORE SECTION (dtf.php) ---- */
@media (max-width: 768px) {
  .rivenditore-section {
    grid-template-columns: 1fr !important;
    padding: 2rem 1.25rem !important;
    gap: 1.5rem !important;
    margin-top: 3rem !important;
  }
}

/* ---- PROGETTI / STEPS / QUALITA GRIDS (dtf.php) ---- */
@media (max-width: 768px) {
  .progetti-grid,
  .steps-grid,
  .qualita-grid,
  .qualita-v2-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
  }

  .app-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 480px) {
  .app-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ---- ROLLUP: main-rollup-grid ---- */
@media (max-width: 1024px) {
  .main-rollup-grid {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
    padding-left: 0 !important;
  }
}

/* ---- DESKTOP WIDE: Fluid scaling (container-max CSS variable handles max-width) ---- */
@media (min-width: 1440px) {
  .container {
    /* max-width is governed by --container-max: min(90vw, 1800px) in style.css */
    padding: 0 clamp(1.25rem, 1.5vw, 2rem); /* Reduced padding to enlarge content */
  }
}

/* ---- FULL HD & UP (≥ 1920px): Scale typography for large monitors ---- */
@media (min-width: 1920px) {
  .container {
    max-width: min(95vw, 2200px); /* Even wider for ultra-wide monitors */
    padding: 0 1.5rem;
  }
  
  .hero-main-title {
    font-size: clamp(4rem, 4.5vw, 6.5rem);
  }

  .section-title {
    font-size: clamp(2.5rem, 4vw, 5rem) !important;
  }

  .text-sub {
    font-size: clamp(1rem, 1.4vw, 1.6rem) !important;
    max-width: 900px;
  }

  .nav-links {
    gap: clamp(1.5rem, 2vw, 4rem);
  }

  .footer-grid {
    grid-template-columns: 2.5fr 1fr 1fr 2fr;
    gap: clamp(2rem, 3.5vw, 6rem);
  }
}

/* ---- 4K (≥ 2560px): Hard cap to avoid over-stretching ---- */
@media (min-width: 2560px) {
  .container {
    max-width: 2400px; /* Extended from 1900px for true ultra-wide feel */
  }
}

/* ---- FORM ROWS ---- */
@media (max-width: 600px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ---- PRICE BAR / PRICE SUMMARY ---- */
@media (max-width: 480px) {
  .price-summary-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .price-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .total-price {
    font-size: 1.5rem;
  }
}

/* ---- QUANTITÀ BOX ---- */
@media (max-width: 480px) {
  .qty-row {
    flex-direction: column;
    align-items: stretch;
  }
}

/* ---- WHATSAPP BOX ---- */
@media (max-width: 480px) {
  .whatsapp-box {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
}

/* ---- TOGGLE ROWS ---- */
@media (max-width: 480px) {
  .toggle-info .t-name {
    font-size: 0.8rem;
  }

  .toggle-info .t-desc {
    font-size: 0.68rem;
  }
}

/* ---- UTILITY: Hide overflow on narrow screens ---- */
@media (max-width: 480px) {
  body {
    overflow-x: hidden;
  }
}
