/* EMPOLAS Added to Cart — popup styles v3
   Design: čistá hierarchie, jeden tok, minimum akcentů, čitelnost */
:root {
  --eatc-accent:        #1a6fd4;
  --eatc-green:         #1e9e5c;
  --eatc-green-light:   #f0faf5;
  --eatc-green-bar:     #e0efe6;
  --eatc-red:           #c53030;
  --eatc-gray-50:       #fafbfc;
  --eatc-gray-100:      #f3f4f6;
  --eatc-gray-200:      #e5e7eb;
  --eatc-gray-400:      #9ca3af;
  --eatc-gray-600:      #555;
  --eatc-gray-800:      #1f2937;
  --eatc-radius:        14px;
  --eatc-shadow:        0 8px 40px rgba(0,0,0,.2);
  --eatc-popup-w:       500px;
  --eatc-btn-continue-bg:    transparent;
  --eatc-btn-continue-color: #555;
  --eatc-btn-continue-border:#d1d5db;
  --eatc-btn-cart-bg:    #1a6fd4;
  --eatc-btn-cart-color: #ffffff;
  --eatc-badge-bg:      #c53030;
  --eatc-badge-color:   #ffffff;
}

/* ═══════════════════════════════════════════════
   OVERLAY & LOADER
   ═══════════════════════════════════════════════ */
.eatc-overlay {
  display: none;
  position: fixed;
  /* Explicit values for iOS Safari < 14.5 (inset shorthand not supported) */
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 999999;
  background: rgba(0,0,0,.48);
  align-items: center;
  justify-content: center;
  /* Safe area support for notched iPhones */
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
  padding-left:  max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.eatc-overlay.eatc-visible {
  display: flex;
  animation: eatcFadeIn .15s ease;
}
@keyframes eatcFadeIn { from { opacity:0 } to { opacity:1 } }

.eatc-loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #fff;
  border-radius: var(--eatc-radius);
  box-shadow: var(--eatc-shadow);
  width: 100%;
  max-width: 240px;
  padding: 36px 24px;
  animation: eatcSlideUp .2s cubic-bezier(.22,.68,0,1.2);
}
.eatc-loader-wrap.hidden { display: none; }
.eatc-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--eatc-gray-200);
  border-top-color: var(--eatc-accent);
  border-radius: 50%;
  animation: eatcSpin .7s linear infinite;
}
@keyframes eatcSpin { to { transform: rotate(360deg); } }
.eatc-loader-text { font-size: .9rem; color: #777; font-weight: 500; }

/* Confetti canvas */
#eatc-confetti-canvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 1000000;
  flex: none;
}

/* ═══════════════════════════════════════════════
   POPUP BOX
   ═══════════════════════════════════════════════ */
.eatc-popup {
  background: #fff;
  border-radius: var(--eatc-radius);
  box-shadow: var(--eatc-shadow);
  width: 100%;
  max-width: var(--eatc-popup-w);
  /* dvh fallback for older browsers (iOS Safari < 15.4) */
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: eatcSlideUp .22s cubic-bezier(.22,.68,0,1.1);
  /* Prevent iOS scroll bleed */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.eatc-popup.hidden { display: none; }
@keyframes eatcSlideUp { from { transform:translateY(20px); opacity:0 } to { transform:none; opacity:1 } }
/* Defined globally so older Safari recognizes it (no @keyframes inside @media) */
@keyframes eatcSlideUpMobile {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* Scrollbar */
.eatc-popup::-webkit-scrollbar { width: 5px; }
.eatc-popup::-webkit-scrollbar-track { background: transparent; }
.eatc-popup::-webkit-scrollbar-thumb { background: var(--eatc-gray-200); border-radius: 99px; }

/* ═══════════════════════════════════════════════
   1. HEADER — potvrzení přidání
   ═══════════════════════════════════════════════ */
.eatc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--eatc-gray-200);
  gap: 10px;
  flex-shrink: 0;
}
.eatc-confirm-text {
  font-weight: 700;
  font-size: 1rem;
  color: var(--eatc-green);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.eatc-confirm-text::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: var(--eatc-green);
  color: #fff;
  border-radius: 50%;
  font-size: .75rem;
  font-weight: 800;
  flex-shrink: 0;
}
.eatc-close {
  border: none; background: none; font-size: 1.3rem; cursor: pointer;
  line-height: 1; color: var(--eatc-gray-400); padding: 6px 8px;
  border-radius: 6px; transition: background .15s, color .15s; flex-shrink: 0;
  /* Remove 300ms tap delay on iOS */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.eatc-close:hover { background: var(--eatc-gray-100); color: var(--eatc-gray-800); }

/* ═══════════════════════════════════════════════
   2. PRODUCT ROW
   ═══════════════════════════════════════════════ */
.eatc-product-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;
}
.eatc-product-img-wrap {
  flex-shrink: 0; width: 80px; height: 80px;
  border-radius: 10px; overflow: hidden; background: var(--eatc-gray-100);
  border: 1px solid var(--eatc-gray-200);
}
.eatc-product-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eatc-product-info { flex: 1; min-width: 0; }
.eatc-product-name {
  font-weight: 700; font-size: .95rem; line-height: 1.35;
  color: var(--eatc-gray-800); margin-bottom: 2px;
  overflow-wrap: anywhere;
}
.eatc-product-variant { font-size: .85rem; color: var(--eatc-gray-400); margin-bottom: 5px; }
.eatc-product-price { font-size: .95rem; color: var(--eatc-gray-600); margin-bottom: 10px; }
.eatc-product-price ins { text-decoration: none; font-weight: 700; }
.eatc-product-price del { color: var(--eatc-gray-400); font-size: .85rem; }

/* Qty */
.eatc-qty-control {
  display: flex; align-items: center;
  border: 1px solid var(--eatc-gray-200); border-radius: 8px;
  width: -webkit-fit-content; width: fit-content; overflow: hidden;
}
.eatc-qty-btn {
  border: none; background: var(--eatc-gray-100); cursor: pointer;
  font-size: 1.15rem; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  transition: background .12s; color: var(--eatc-gray-800);
  /* Remove iOS tap delay */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eatc-qty-btn:hover:not(:disabled) { background: var(--eatc-gray-200); }
.eatc-qty-btn:disabled { cursor: not-allowed; opacity: .4; }
.eatc-qty-val {
  padding: 0 14px; font-weight: 700; font-size: 1rem;
  min-width: 34px; text-align: center;
  display: flex; align-items: center; justify-content: center;
}
.eatc-qty-spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--eatc-gray-200); border-top-color: var(--eatc-accent);
  border-radius: 50%; animation: eatcSpin .6s linear infinite;
}

/* ═══════════════════════════════════════════════
   3. HIGHLIGHT BOX
   ═══════════════════════════════════════════════ */
.eatc-highlight-box {
  padding: 10px 20px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.eatc-highlight-box::before {
  font-size: 1rem; flex-shrink: 0; margin-top: 1px; line-height: 1;
}
.eatc-highlight-box.eatc-highlight-primary::before  { content: '📦'; }
.eatc-highlight-box.eatc-highlight-secondary::before { content: 'ℹ️'; }
.eatc-highlight-box-text {
  flex: 1; font-size: .88rem; line-height: 1.5; color: var(--eatc-gray-600);
}
/* Obrana proti globálnímu CSS webu (např. `.page div.doruceni { display:none }`),
   které by skrylo obsah shortcodu/vlastní HTML uvnitř highlight boxu popupu */
#eatc-overlay .eatc-highlight-box-text div,
#eatc-overlay .eatc-highlight-box-text span,
#eatc-overlay .eatc-highlight-box-text p,
#eatc-overlay .eatc-highlight-box-text strong,
#eatc-overlay .eatc-highlight-box-text b,
#eatc-overlay .eatc-highlight-box-text em {
  display: inline !important;
  visibility: visible !important;
  opacity: 1 !important;
}
.eatc-highlight-box-text strong { font-weight: 700; color: var(--eatc-gray-800); }
.eatc-highlight-heading {
  display: block; font-size: .88rem; font-weight: 700;
  margin-bottom: 2px; color: var(--eatc-gray-800);
}
/* Highlight box uvnitř patičky (pozice „nad CTA" / „nad trust lištou") —
   patička má vlastní padding, box dostane kompaktnější tvar */
.eatc-footer .eatc-highlight-box {
  padding: 10px 12px;
  border-radius: 8px;
}

/* ═══════════════════════════════════════════════
   4. FREE SHIPPING BAR
   ═══════════════════════════════════════════════ */
.eatc-freeship {
  padding: 14px 20px 16px;
  background: var(--eatc-green-light);
  border-top: 1px solid var(--eatc-gray-200);
}
.eatc-freeship-message {
  font-size: .93rem; font-weight: 600; color: var(--eatc-gray-800);
  margin-bottom: 10px; line-height: 1.4;
}
.eatc-freeship-message .eatc-freeship-amount {
  font-weight: 800; color: var(--eatc-green);
}
.eatc-freeship-message.reached { color: var(--eatc-green); font-weight: 700; margin-bottom: 0; }

/* Podtržený odkaz "Pokračovat v nákupu" ve free-shipping zprávě */
.eatc-freeship-continue {
  display: block;
  margin-top: 4px;
  width: -webkit-fit-content; width: fit-content;
  font-size: .85rem; font-weight: 600;
  color: var(--eatc-gray-600);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eatc-freeship-continue:hover { color: var(--eatc-gray-800); }

.eatc-freeship-bar {
  height: 14px;
  background: var(--eatc-green-bar);
  border-radius: 99px;
  overflow: hidden;
  position: relative;
}
.eatc-freeship-fill {
  height: 100%;
  background: linear-gradient(90deg, #22a860, #34d87a);
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  width: 0%;
  position: relative;
}
.eatc-freeship-bar:not(.reached-bar) .eatc-freeship-fill::after {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.35) 50%, transparent 100%);
  animation: eatcShimmer 2.2s ease-in-out infinite;
}
@keyframes eatcShimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
/* Stav "limit dosažen" — bar se skrývá (JS), zůstává jen zpráva.
   Třídy ponechány pro zpětnou kompatibilitu s cachovaným JS. */
.eatc-freeship-bar.reached-bar,
.eatc-freeship-fill.reached-fill { display: none; }

/* Legacy elements hidden */
.eatc-freeship-top,
.eatc-freeship-icon,
.eatc-freeship-bar-wrap,
.eatc-freeship-pct { display: none; }
.eatc-freeship-ticker { display: none; height: 0; overflow: hidden; }
.eatc-freeship-ticker-track {
  display: flex; white-space: nowrap;
  animation: eatcTicker var(--eatc-ticker-speed, 18s) linear infinite;
}
@keyframes eatcTicker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
.eatc-ticker-item {
  display: inline-flex; align-items: center;
  font-size: .82rem; font-weight: 600; color: #3d7a5a; padding: 0 20px;
}

/* ═══════════════════════════════════════════════
   5. CROSS-SELL SECTION
   ═══════════════════════════════════════════════ */
.eatc-upsell-section {
  padding: 14px 20px 0;
  border-top: 1px solid var(--eatc-gray-200);
}
.eatc-upsell-heading {
  font-weight: 600; font-size: .85rem; color: var(--eatc-gray-400);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px;
}
.eatc-upsell-track-wrap { position: relative; padding: 0 2px; }
.eatc-upsell-track { overflow: hidden; }
.eatc-upsell-slider {
  display: flex; gap: 0; transition: transform .3s ease; padding-bottom: 14px;
}
.eatc-upsell-card {
  flex: 0 0 50%; padding: 0 5px; box-sizing: border-box;
  display: flex; flex-direction: column;
}
.eatc-upsell-card-inner {
  border: 1px solid var(--eatc-gray-200); border-radius: 10px; padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
  position: relative; background: #fff; height: 100%;
  transition: border-color .15s;
}
.eatc-upsell-card-inner:hover { border-color: var(--eatc-gray-400); }
.eatc-upsell-card.single { flex: 0 0 100%; }
.eatc-upsell-card img {
  width: 100%; height: 110px; object-fit: contain; object-position: center;
  border-radius: 7px; background: var(--eatc-gray-50); display: block; flex-shrink: 0;
}
.eatc-upsell-card-link { display: block; text-decoration: none; }
.eatc-upsell-card-name {
  font-size: .84rem; font-weight: 600; line-height: 1.3; color: var(--eatc-gray-800);
  text-decoration: none; display: block;
  overflow-wrap: anywhere;
}
.eatc-upsell-card-name:hover { color: var(--eatc-accent); }

/* Star rating + počet recenzí pod názvem produktu */
.eatc-upsell-card-rating {
  display: flex; align-items: center; gap: 5px;
  font-size: .76rem; color: var(--eatc-gray-400); line-height: 1;
}
.eatc-stars {
  position: relative; display: inline-block;
  font-size: .8rem; line-height: 1; letter-spacing: 1px;
  color: var(--eatc-gray-200);
}
.eatc-stars::before { content: '★★★★★'; }
.eatc-stars-fill {
  position: absolute; top: 0; left: 0;
  overflow: hidden; white-space: nowrap; color: #f5a623;
}
.eatc-stars-fill::before { content: '★★★★★'; }
.eatc-upsell-card-price {
  font-size: .84rem; color: var(--eatc-gray-600); line-height: 1.4;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 4px;
}
.eatc-upsell-card-price ins {
  text-decoration: none; font-weight: 700; color: var(--eatc-gray-800); order: 2;
}
.eatc-upsell-card-price del ~ ins { color: var(--eatc-red); }
.eatc-upsell-card-price del { color: var(--eatc-gray-400); font-size: .78rem; order: 1; }
.eatc-upsell-card-price del .woocommerce-Price-amount { color: var(--eatc-gray-400); }
.eatc-upsell-card-price .woocommerce-price-suffix {
  font-size: .72rem; color: var(--eatc-gray-400); font-weight: 400; order: 3; white-space: nowrap;
}

.eatc-badges-wrap {
  position: absolute; top: 8px; right: 8px;
  display: flex; flex-direction: column; gap: 3px; align-items: flex-end;
}
.eatc-badge {
  font-size: .7rem; font-weight: 600; padding: 2px 7px; line-height: 1.4;
  background: var(--eatc-badge-bg); color: var(--eatc-badge-color);
  border-radius: 4px; max-width: 100%; overflow-wrap: anywhere; text-align: right;
}

/* Cross-sell add-to-cart button — zelený, výraznější, ale stále čistý */
.eatc-upsell-btn {
  margin-top: auto; padding: 9px 10px; border-radius: 7px;
  border: 1px solid rgba(30,158,92,.5); background: var(--eatc-green-light);
  color: var(--eatc-green); font-size: .82rem; font-weight: 700;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
  text-align: center; display: block; text-decoration: none; width: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eatc-upsell-btn:hover { background: var(--eatc-green); border-color: var(--eatc-green); color: #fff; }
.eatc-upsell-btn.added {
  background: var(--eatc-green-light); border-color: var(--eatc-green);
  color: var(--eatc-green); pointer-events: none;
}
.eatc-upsell-btn.loading { opacity: .5; pointer-events: none; }

/* Slider arrows */
.eatc-slider-prev, .eatc-slider-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: #fff; border: 1px solid var(--eatc-gray-200);
  border-radius: 50%; width: 30px; height: 30px; font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,.1); z-index: 2; color: var(--eatc-gray-600);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eatc-slider-prev:hover, .eatc-slider-next:hover { border-color: var(--eatc-gray-400); }
.eatc-slider-prev { left: -4px; }
.eatc-slider-next { right: -4px; }

/* ═══════════════════════════════════════════════
   6. FOOTER — mezisoučet + CTA
   ═══════════════════════════════════════════════ */
.eatc-footer {
  padding: 16px 20px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px;
  border-top: 1px solid var(--eatc-gray-200);
  flex-shrink: 0;
  /* Sticky uvnitř scrollovatelného popupu — CTA tlačítka jsou vždy viditelná,
     i když cross-sell produkty obsah natáhnou přes max-height */
  position: sticky;
  bottom: 0;
  background: #fff;
  z-index: 5;
  /* Krátký tmavší stín nahoru — signalizuje, že nad patičkou je
     scrollovatelný obsah. Krátká tmavší vrstva + jemný delší rozptyl. */
  box-shadow: 0 -2px 6px rgba(0,0,0,.14), 0 -8px 18px rgba(0,0,0,.05);
}
.eatc-items-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .85rem; color: var(--eatc-gray-600);
  margin-bottom: -6px; /* opticky blíž k hodnotě košíku */
}
.eatc-items-row .eatc-items-val { font-weight: 600; color: var(--eatc-gray-800); }
.eatc-subtotal-row {
  display: flex; justify-content: space-between; font-size: .95rem; align-items: center;
}
.eatc-subtotal-label { color: var(--eatc-gray-600); font-weight: 500; }
.eatc-subtotal-val { font-weight: 600; font-size: 1.1rem; color: var(--eatc-gray-800); }
/* Sleva v košíku — původní hodnota přeškrtnutá, aktuální červeně */
.eatc-subtotal-val .eatc-subtotal-regular {
  font-size: .85rem; font-weight: 400; color: var(--eatc-gray-400);
  text-decoration: line-through; margin-right: 7px;
}
.eatc-subtotal-val .eatc-subtotal-regular .woocommerce-Price-amount { color: var(--eatc-gray-400); }
.eatc-subtotal-val .eatc-subtotal-discounted,
.eatc-subtotal-val .eatc-subtotal-discounted .woocommerce-Price-amount { color: var(--eatc-red); font-weight: 700; }
.eatc-savings-badge {
  background: #fef2f2; color: var(--eatc-red);
  border: 1px solid rgba(197,48,48,.15); border-radius: 7px;
  padding: 6px 12px; font-size: .85rem; font-weight: 600; text-align: center;
}

.eatc-cta-wrap { display: flex; flex-direction: column; gap: 8px; }

.eatc-btn-cart {
  padding: 14px 16px; border-radius: 10px; border: none;
  background: var(--eatc-btn-cart-bg); color: var(--eatc-btn-cart-color);
  font-weight: 700; font-size: 1rem; text-align: center; text-decoration: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); transition: filter .15s, box-shadow .15s;
  line-height: 1.25;
  overflow-wrap: anywhere;
  /* Min touch target for mobile */
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eatc-btn-cart:hover {
  filter: brightness(1.08); box-shadow: 0 4px 16px rgba(0,0,0,.18);
  color: var(--eatc-btn-cart-color);
}

.eatc-btn-continue {
  padding: 11px 16px; border-radius: 8px;
  border: 1px solid var(--eatc-btn-continue-border);
  background: var(--eatc-btn-continue-bg); color: var(--eatc-btn-continue-color);
  font-weight: 600; font-size: .88rem; cursor: pointer;
  transition: background .15s; text-align: center;
  line-height: 1.25;
  overflow-wrap: anywhere;
  min-height: 44px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eatc-btn-continue:hover { background: var(--eatc-gray-100); }

.eatc-trust { font-size: .8rem; color: var(--eatc-gray-400); text-align: center; padding-top: 4px; }

/* ─── Infobox button (ⓘ) ───────────────────────────────────── */
.eatc-info-btn {
  position: absolute; top: 8px; left: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--eatc-gray-400);
  background: #fff;
  color: var(--eatc-gray-400);
  font-size: .72rem;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, color .15s;
  z-index: 3;
  line-height: 1;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.eatc-info-btn:hover {
  border-color: var(--eatc-accent);
  color: var(--eatc-accent);
}

/* Infobox jako centrovaný panel — nikdy se neořezává, čitelný na všech zařízeních */
.eatc-infobox-popup {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 48px));
  max-height: 70vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--eatc-gray-200);
  border-radius: 10px;
  padding: 14px 36px 14px 16px;
  font-size: .86rem;
  line-height: 1.55;
  color: var(--eatc-gray-600);
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  z-index: 1000002;
  animation: eatcFadeIn .12s ease;
}
.eatc-infobox-text { overflow-wrap: anywhere; }
.eatc-infobox-text p { margin: 0 0 8px; }
.eatc-infobox-text p:last-child { margin-bottom: 0; }
.eatc-infobox-close {
  position: absolute; top: 6px; right: 8px;
  border: none; background: none;
  font-size: 1.1rem; color: var(--eatc-gray-400);
  cursor: pointer; line-height: 1; padding: 4px;
  touch-action: manipulation;
}
.eatc-infobox-close:hover { color: var(--eatc-gray-800); }

/* ═══════════════════════════════════════════════
   RESPONSIVE — TABLET (≤ 768px)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Loader vždy uprostřed obrazovky */
  .eatc-overlay.eatc-loading {
    align-items: center;
    padding: 16px;
  }

  /* Popup vyjíždí od spodního okraje */
  .eatc-overlay.eatc-showing {
    align-items: flex-end;
    padding: 0;
  }

  .eatc-popup {
    border-radius: var(--eatc-radius) var(--eatc-radius) 0 0;
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    animation: eatcSlideUpMobile .25s cubic-bezier(.22,.68,0,1.1);
  }

  .eatc-footer {
    /* Ensure footer isn't hidden behind home indicator on iPhone */
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }

  .eatc-upsell-card { flex: 0 0 60%; }

  /* Šipky carouselu výš — nad obrázkem, aby nepřekrývaly název produktu */
  .eatc-slider-prev,
  .eatc-slider-next { top: 65px; }

  .eatc-product-img-wrap { width: 70px; height: 70px; }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — MOBILE (≤ 480px)
   ═══════════════════════════════════════════════ */
@media (max-width: 480px) {
  .eatc-header { padding: 14px 16px; }

  .eatc-product-row { padding: 14px 16px; gap: 12px; }
  .eatc-product-img-wrap { width: 64px; height: 64px; }
  .eatc-product-name { font-size: .9rem; }
  .eatc-product-price { font-size: .88rem; margin-bottom: 8px; }

  .eatc-highlight-box { padding: 10px 16px; }

  .eatc-freeship { padding: 12px 16px 14px; }
  .eatc-freeship-message { font-size: .88rem; }

  .eatc-upsell-section { padding: 12px 16px 0; }
  /* One card at a time on small mobile */
  .eatc-upsell-card { flex: 0 0 80%; }
  .eatc-upsell-card img { height: 90px; }

  .eatc-footer { padding: 14px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); gap: 10px; }
  .eatc-btn-cart { padding: 13px 14px; font-size: .95rem; }
  .eatc-btn-continue { padding: 10px 14px; font-size: .85rem; }

  /* Bigger tap targets for qty on mobile */
  .eatc-qty-btn { width: 42px; height: 42px; }

  /* Slider arrows — menší na mobilu, výš (nad obrázkem), nepřekrývají název */
  .eatc-slider-prev,
  .eatc-slider-next {
    width: 26px;
    height: 26px;
    font-size: .95rem;
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    background: rgba(255,255,255,.95);
    top: 55px;
  }
  .eatc-slider-prev { left: 2px; }
  .eatc-slider-next { right: 2px; }
}

/* ═══════════════════════════════════════════════
   VERY SMALL (≤ 360px) — ultra-compact
   ═══════════════════════════════════════════════ */
@media (max-width: 360px) {
  .eatc-product-img-wrap { width: 56px; height: 56px; }
  .eatc-upsell-card { flex: 0 0 90%; }
  .eatc-btn-cart { font-size: .9rem; padding: 12px; }
}

/* ═══════════════════════════════════════════════
   IOS BODY-LOCK — applied via JS class
   ═══════════════════════════════════════════════ */
body.eatc-locked {
  /* Position-fixed trick prevents bounce on iOS Safari.
     overflow:hidden stops any residual scroll; no scrollbar on iOS so no layout jump. */
  position: fixed;
  width: 100%;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   LARGE SCREENS (≥ 1200px)
   ═══════════════════════════════════════════════ */
@media (min-width: 1200px) {
  :root { --eatc-popup-w: 520px; }
}

/* ═══════════════════════════════════════════════
   ACCESSIBILITY — keyboard focus & reduced motion
   ═══════════════════════════════════════════════ */
.eatc-close:focus-visible,
.eatc-qty-btn:focus-visible,
.eatc-btn-cart:focus-visible,
.eatc-btn-continue:focus-visible,
.eatc-upsell-btn:focus-visible,
.eatc-slider-prev:focus-visible,
.eatc-slider-next:focus-visible,
.eatc-info-btn:focus-visible,
.eatc-upsell-card-link:focus-visible,
.eatc-upsell-card-name:focus-visible {
  outline: 2px solid var(--eatc-accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .eatc-overlay.eatc-visible,
  .eatc-popup,
  .eatc-loader-wrap,
  .eatc-infobox-popup { animation: none; }
  .eatc-upsell-slider { transition: none; }
  .eatc-freeship-fill { transition: none; }
  .eatc-freeship-bar:not(.reached-bar) .eatc-freeship-fill::after { animation: none; }
}
