/*
 * css/mobile.css — FundedBadge Responsive & Mobile Styles
 * Loaded last — highest specificity for overrides.
 *
 * Breakpoints:
 *   2560px  4K
 *   1440px  Laptop L
 *   1024px  Laptop
 *    768px  Tablet
 *    425px  Mobile L
 *    375px  Mobile M
 *    320px  Mobile S
 *
/*
 * css/mobile.css — FundedBadge Responsive & Mobile Styles
 * Loaded last — highest specificity for overrides.
 *
 * Zmiany w tej wersji:
 * - Zastosowano jednostki dvh oraz funkcję clamp() dla płynnych marginesów pionowych
 * - Stopka (Footer) na małych ekranach (≤ 425px) układa się w idealnie wyśrodkowaną kolumnę
 */

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   LAPTOP L (≤ 1440px)
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1440px) {
  #shop .container {
    width: 100% !important;
    max-width: 100%;
  }
  #shop-wizard .container {
    width: 85% !important;
    max-width: 100%;
  }
  .shape-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    display: block;
  }
  .features-grid {
    gap: clamp(8px, 1dvh, 12px);
  }
  .section { 
    padding: clamp(50px, 8dvh, 90px) 0; 
  }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   LAPTOP (≤ 1024px)
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .features-grid {
    gap: clamp(6px, 1.5dvh, 10px);
  }
  #shop .container, #shop-wizard .container {
    width: 100% !important;
    max-width: 100%;
  }
  .container { 
    padding: 0 20px; 
  }
  #hero .container { 
    max-width: 90% !important; 
  }
  /* Footer: 2 + 2 at this size */
  .footer-top { 
    grid-template-columns: 1.4fr 1fr 1fr 1fr !important; 
    gap: clamp(20px, 4dvh, 32px); 
  }
  .shape-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    display: block;
  }
}

/* Zoptymalizowana reguła dla niskich ekranów poziomy (np. telefony w poziomie) */
@media (max-height: 700px) and (min-width: 425px) {
  /* ── Release fixed-height sections so content can breathe ── */
  #hero {
    height: auto !important;
    min-height: 0 !important;
    padding-top: clamp(40px, 10dvh, 80px);
    padding-bottom: clamp(20px, 5dvh, 40px);
  }
  #how-it-works, #shop, #faq, #contact {
    height: auto !important;
    min-height: 0 !important;
    padding: clamp(20px, 6dvh, 48px) 0 !important;
  }
  .combined-viewport-container {
    min-height: 0 !important;
    height: auto !important;
    margin-bottom: 0 !important;
  }

  /* ── Hero: compress vertical spacing ── */
  .hero-badge   { margin-bottom: clamp(4px, 1.5dvh, 8px) !important; margin-top: 0 !important; }
  .hero-sub     { margin-bottom: clamp(10px, 3dvh, 20px); font-size: 0.92rem; }
  .hero-stat    { margin-top: clamp(10px, 3dvh, 20px) !important; padding-top: clamp(10px, 3dvh, 20px) !important; }
  .hero-title   { font-size: clamp(1.8rem, 5vw, 3rem) !important; margin-bottom: clamp(6px, 2dvh, 12px); }
  .hero-inner   { gap: clamp(15px, 4dvh, 40px) !important; padding: clamp(10px, 3dvh, 20px) 0 !important; }

  /* ── How It Works & Shop wizard: tighter ── */
  .step-card { padding: clamp(12px, 3dvh, 20px) 22px !important; }
  .step-num  { font-size: 2.5rem !important; margin-bottom: clamp(2px, 1dvh, 6px) !important; }
  .step-icon { margin-bottom: clamp(4px, 1.5dvh, 8px) !important; }
  .step-nav  { margin-top: clamp(10px, 3dvh, 24px) !important; margin-bottom: clamp(10px, 3dvh, 24px) !important; }
  .panel-inner  { padding: clamp(16px, 4dvh, 28px) 36px !important; }
  .panel-title  { font-size: 2rem !important; margin-bottom: clamp(2px, 1dvh, 6px) !important; }
  .panel-sub    { margin-bottom: clamp(10px, 3dvh, 20px) !important; }
  .wiz-back-btn { margin-bottom: clamp(8px, 2dvh, 14px) !important; }

  /* ── Shape & Size cards: reduce image ── */
  .shape-card-img img { height: clamp(200px, 40dvh, 280px) !important; }
  .size-card-thumb { aspect-ratio: unset !important; }
  #size-grid > button:nth-child(1) .size-card-thumb { height: 80px !important; }
  #size-grid > button:nth-child(2) .size-card-thumb { height: 100px !important; }
  #size-grid > button:nth-child(3) .size-card-thumb { height: 120px !important; }
  #size-grid > button:nth-child(4) .size-card-thumb { height: 140px !important; }

  /* ── Upload & Review step ── */
  .upload-zone { padding: clamp(12px, 3dvh, 24px) !important; }
  .upload-icon { font-size: 1.5rem !important; margin-bottom: clamp(2px, 1dvh, 6px) !important; }
  .review-summary { padding: clamp(8px, 2dvh, 14px) !important; }
  .shop-hero { padding: clamp(50px, 12dvh, 90px) 0 clamp(20px, 5dvh, 40px) !important; }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   Tablet (≤ 768px)
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  html { font-size: 15px; }
  body { overflow-x: hidden; }
  .section { padding: clamp(36px, 8dvh, 56px) 0; }
  .section-sm { padding: clamp(24px, 5dvh, 36px) 0; }
  .section-title { font-size: clamp(1.7rem, 7vw, 2.8rem) !important; }

  /* Navbar */
  #navbar { padding: 0 16px; height: 64px; }
  .nav-links, .btn-signin { display: none; }
  .btn-menu { display: flex !important; }
  .cart-count { min-width: 18px; height: 18px; font-size: 10px; line-height: 18px; }

  /* Hero */
  #hero .container { max-width: 94% !important; padding-right: 0; margin-right: 0;}
  .hero-inner { grid-template-columns: 1fr 1fr !important; gap: 10px !important; padding-top: 0px; }
  .hero-content { text-align: left; }
  .hero-title { font-size: clamp(2rem, 9vw, 3.5rem) !important; line-height: 1.1; margin-bottom: clamp(10px, 2dvh, 15px); }
  .hero-sub { font-size: 0.94rem; margin-bottom: clamp(15px, 3dvh, 25px); }
  .hero-cta { justify-content: left; flex-wrap: wrap; gap: 12px;}
  .hero-cta .btn-primary, .hero-cta .btn-outline { width: 250px; justify-content: center;}
  .plaque-main {width: 390px !important;}
  .plaque-showcase {max-width: 390px; margin: 0 auto;}

  .plaque-main img, .product-img img, .shape-card-img img, .size-card-thumb img {
    object-fit: contain !important;
    width: 100%;
  }

  /* How It Works */
  #how-it-works { padding-top: clamp(40px, 8dvh, 60px); }
  #how-it-works .section-title { font-size: clamp(1.5rem, 6vw, 2.2rem) !important; }
  #how-it-works .section-sub { font-size: 0.82rem; margin-bottom: clamp(20px, 4dvh, 30px); }
  .steps-grid { grid-template-columns: 1fr !important; gap: 2px !important; border-radius: 8px; }
  .step-card { padding: clamp(20px, 4dvh, 28px) 24px !important; }
  .step-num { font-size: 3.5rem !important; margin-bottom: clamp(4px, 1.5dvh, 10px) !important; }
  .step-icon { width: 40px !important; height: 40px !important; margin-bottom: clamp(6px, 2dvh, 14px) !important; }
  .step-title { font-size: 1.3rem !important; margin-bottom: clamp(4px, 1dvh, 8px); }
  .step-arrow { display: none !important; }

  /* Shop / Products */
  .product-img img { height: auto !important; max-height: 200px; object-fit: contain !important; }
  div.product-footer > a { display: flex; justify-content: center; align-items: center; }
  .product-price { font-size: 1.6rem !important;}
  .product-img img { width: 100%; height: 100%; object-fit: cover !important; display: block; }
  .features-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .reviews-grid { grid-template-columns: 1fr !important; gap: 16px; }

  /* Contact & Footer */
  .form-row { grid-template-columns: 1fr !important; }
  .contact-grid { grid-template-columns: 1fr !important; gap: 40px; }
  .footer-top {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    gap: clamp(20px, 4dvh, 34px) 0px !important;
    text-align: center;
  }
  body > footer > div > div.footer-top > div.footer-brand > a,
  body > footer > div > div.footer-top > div.footer-brand > div {
    justify-content: center;
    margin-top: clamp(10px, 2dvh, 20px);
  }
  .footer-brand { grid-column: 1 / -1 !important; }
  .footer-col { grid-row: 2 !important; text-align: center; }
  .footer-bottom { flex-direction: column !important; text-align: center; gap: 10px; }
  .footer-bottom > div { justify-content: center; }

  /* SHOP WIZARD */
  #shop-wizard .container { max-width: 98% !important; padding: 0 12px; }
  #panel-1 > div.panel-inner > h2, #panel-2 > div.panel-inner > h2, 
  #panel-3 > div.panel-inner > h2, #panel-4 > div.panel-inner > h2 { font-size: 3rem !important; }
  .panel-sub { margin-bottom: clamp(12px, 2.5dvh, 20px); }
  
  .shape-grid { display: flex !important; flex-direction: column !important; gap: 14px !important; }
  .shape-card-img { width: 600px !important; height: clamp(200px, 40dvh, 600px) !important; overflow: hidden !important; }
  .shape-card { padding: 4px !important; gap: 1px !important}
  .shape-card-name { font-size: 1.7rem !important; margin-bottom: 4px; }
  .shape-card-choose { display: none !important; }

  .size-card { grid-template-columns: 220px 1fr !important; }
  .size-card-thumb { width: 200px !important; height: 200px !important; overflow: hidden !important; justify-content: center !important; }
  .size-card-thumb img { object-fit: cover !important; object-position: center; width: 100% !important; height: 100% !important; justify-content: center !important; }
  .size-card-body { height: unset !important; padding: 8px !important; margin-left: 0; }

  .upload-panel-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .upload-zone { padding: clamp(20px, 4dvh, 28px) 16px !important; }

  .review-grid { display: flex !important; flex-direction: column !important; gap: 20px !important; align-items: flex-start; }
  .review-sidebar { width: 100%; flex: 0 0 100%; }
  .review-summary { padding: clamp(12px, 2.5dvh, 16px) !important; width: 100%; max-width: 600px; margin: 0 auto; }
  .review-cert-preview { display: none }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   MOBILE L (≤ 425px) - NAPRAWIONY FOOTER & UKŁAD
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 425px) {
  html { font-size: 14px; }
  .section { padding: clamp(40px, 8dvh, 48px) 0; }
  .container { padding: 0 14px; }

  /* Hero */
  .hero-title { font-size: clamp(1.9rem, 10vw, 2.8rem) !important; }
  .hero-inner { display: flex; flex-direction: column; align-items: center; }
  .hero-content { margin-right: 0; text-align: center; } /* Wyśrodkowano na małym ekranie */
  .hero-badge { width: 100%; max-width: 300px; margin: 0 auto clamp(10px, 2.5dvh, 15px) !important;}
  .hero-cta { flex-direction: column; align-items: center; width: 100%; }
  .hero-cta .btn-primary, .hero-cta .btn-outline { width: 100%; justify-content: center; }
  .hero-visual { display: none }
  
  .step-card { padding: clamp(16px, 3.5dvh, 22px) 18px !important; }
  .step-num { font-size: 3rem !important; }

  .features-grid { grid-template-columns: 1fr !important; gap: 12px; }

  /* Wizard */
  .panel-inner { padding: clamp(14px, 3dvh, 20px) 14px !important; }
  .panel-title { font-size: clamp(1.3rem, 6vw, 1.8rem) !important; }
  .step-nav-dot { width: 26px; height: 26px; font-size: 0.58rem; }
  .shape-card-img { width: 80px !important; height: 80px !important; }
  .size-grid { grid-template-columns: 1fr !important; }
  .size-card { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 12px !important; }
  .size-card-thumb { width: 80px !important; height: 80px !important; flex-shrink: 0; }

  /* FOOTER FIX (Mobile L -> Mobile S) */
  .footer-top { 
    display: flex !important; 
    flex-direction: column !important; 
    align-items: center !important; 
    text-align: center !important; 
    gap: clamp(24px, 5dvh, 40px) !important; 
  }
  .footer-brand { 
    grid-column: auto !important; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
  }
  .footer-brand p { text-align: center; }
  .footer-col { 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
  }
  .footer-col h5 { font-size: 0.9rem; margin-bottom: clamp(10px, 2dvh, 16px); }
  .footer-col ul { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  
  /* Shop hero */
  .shop-hero { padding-top: clamp(60px, 10dvh, 76px); }
  #shop { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   MOBILE M (≤ 375px)
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 375px) {
  html { font-size: 13px; }
  #navbar { padding: 0 10px; height: 58px; }
  .hero-title { font-size: clamp(1.7rem, 11vw, 2.3rem) !important; }
  .hero-badge { margin-bottom: clamp(15px, 4dvh, 30px); }

  .step-nav-label { display: none !important; }
  .step-nav-connector { min-width: 8px; }
  .step-nav-dot { width: 24px; height: 24px; font-size: 0.55rem; }

  .panel-title { font-size: 1.4rem !important; }
  .features-grid { grid-template-columns: 1fr !important; gap: 12px; }
  .feature-card { padding: clamp(14px, 3dvh, 20px); }
  
  #how-it-works .section-title { font-size: 2.5rem !important; }
  .step-nav { justify-content: center; margin-bottom: clamp(14px, 3dvh, 20px); }
  .shop-hero { padding-bottom: clamp(30px, 6dvh, 52px); }
  #shop-wizard { padding-bottom: clamp(20px, 4dvh, 32px); }
  
  .shape-card-img { width: 120px !important; height: 120px !important; }
  .shape-card-body { padding: 14px 10px 14px 8px; }
  
  .size-card-thumb { width: 100px !important; height: 80px !important; }
  .size-card { padding: 4px !important; }
  .wiz-back-btn { margin-bottom: clamp(6px, 1.5dvh, 8px); }

  .review-row { padding: 10px 8px; }
}

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   MOBILE S (≤ 320px)
══════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 320px) {
  /* Bardzo małe ekrany - marginesy zwężają się do absolutnego minimum dzięki clamp() */
  .hero-title { font-size: 1.5rem !important; }
  .section { padding: clamp(24px, 6dvh, 32px) 0; }
  .panel-inner { padding: clamp(10px, 2dvh, 16px) 10px !important; }
  .shape-card-img { width: 90px !important; height: 90px !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOUCH DEVICES — no hover stuck states
═══════════════════════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  .product-card:hover { transform: none !important; }
  .fan-panel { transform: none !important; }
  .shape-card, .size-card { -webkit-tap-highlight-color: rgba(201,168,76,0.15); }
  .btn-primary, .btn-outline, .btn-add,
  .woocommerce button.button, .woocommerce a.button { min-height: 44px; }
  .btn-cart, .btn-menu { min-width: 44px; min-height: 44px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT
═══════════════════════════════════════════════════════════════════════════ */
@media print {
  #navbar, .mobile-menu, .back-top, #toast, .btn-menu,
  .btn-cart, .marquee-section, canvas { display: none !important; }
  body { background: white; color: black; }
  .container { max-width: 100%; padding: 0; }
}