/* Phone layout fixes. The same file is used by every storefront copy: it only
   uses the colour tokens from style.css, so each site keeps its own palette. */

/* Bottom tab bar (layout.html): phones only. */
.tabbar { display: none; }

@media (max-width: 720px) {
  /* Product rows: one comfortable card plus a peek of the next, instead of
     every card shrinking to its 200px minimum. */
  .product-row { grid-auto-columns: min(78%, 300px); gap: 12px; }
  .row-head { align-items: flex-end; gap: 12px; }
  .row-head .section-title { font-size: 1.3rem; }
  .show-more { white-space: nowrap; font-size: 0.92rem; }

  /* Tighter vertical rhythm so sections don't feel stretched. */
  .section { padding-block: 44px; }
  .section-tight { padding-block: 24px; }
  .section-head { margin-bottom: 22px; }
  .section-title { font-size: 1.45rem; }
  .section-subtitle { font-size: 0.98rem; }
  .hero { padding-block: 36px 44px; }
  .hero h1 { font-size: 1.85rem; margin: 14px 0 10px; }
  .hero-subtitle { font-size: 1rem; margin-bottom: 22px; }
  .trust-list { margin-top: 22px; gap: 8px 16px; font-size: 0.88rem; }
  .page-hero { padding-block: 32px; }
  .page-title { font-size: 1.7rem; }

  /* Cards: readable text, buttons that don't wrap awkwardly. */
  .card-body { padding: 14px; }
  .card-title { font-size: 1.02rem; }
  .duration-pill { font-size: 0.85rem; padding: 6px 12px; }
  .product-card .btn { font-size: 0.95rem; padding-block: 11px; white-space: nowrap; }

  /* Product page */
  .detail-media { max-width: none; }
  .detail-title { font-size: 1.5rem; }
  .detail-actions .btn { width: 100%; }
  .detail-note { padding: 14px; }

  /* Shop toolbar: search on its own line, sort below it. */
  .shop-toolbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .shop-toolbar select { width: 100%; }
  .chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }

  /* FAQ and steps */
  .faq-item summary { font-size: 0.98rem; padding-block: 14px; }
  .step { padding: 20px; }

  /* Footer: centred, comfortable tap targets. */
  .site-footer { text-align: start; }
  .footer-links li a { display: inline-block; padding-block: 4px; }
  .contact-block .btn { width: 100%; justify-content: center; }

  /* Black Friday panel and product page plans */
  .hero-inner { gap: 28px; }
  .bf-panel { padding: 18px; border-radius: 16px; }
  .bf-title { font-size: 1.15rem; }
  .bf-plan { grid-template-columns: 1fr auto; row-gap: 8px; }
  .bf-plan-label { grid-column: 1 / -1; }
  .bf-plan-add { justify-self: end; }
  .plan-option { padding: 12px; gap: 10px; }
}

@media (max-width: 480px) {
  /* Countdown strip on one line: drop the sentence, keep tag + timer. */
  #bf-bar-title { display: none; }
  .bf-bar-inner { flex-wrap: nowrap; padding-block: 6px; font-size: 0.85rem; }

  .header-inner { min-height: 60px; }
  .whatsapp-float { inset-block-end: 14px; inset-inline-end: 14px; }
}

@media (max-width: 360px) {
  .container { padding-inline: 12px; }
  .hero h1 { font-size: 1.6rem; }
}

/* ---------- Phone app layout: bottom tab bar, lighter header, thumb-sized controls ---------- */
@media (max-width: 720px) {
  :root { --tabbar-h: 62px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; inset-inline: 0; bottom: 0; z-index: 28; /* under the cart overlay (30) and drawer (40) */
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: saturate(1.4) blur(12px);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -6px 20px rgba(27, 20, 51, 0.06);
  }
  .tabbar-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-width: 0; padding: 6px 2px; border: 0; background: none; font: inherit;
    font-size: 0.72rem; font-weight: 600; line-height: 1.2; color: var(--text-muted);
    text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .tabbar-item span:not(.tabbar-icon) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar-item .icon { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar-wa .icon { fill: currentColor; stroke: none; }
  .tabbar-item:active { transform: scale(0.94); }
  .tabbar-icon { position: relative; display: grid; place-items: center; }
  .tabbar-count {
    position: absolute; top: -6px; inset-inline-end: -10px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 999px; background: var(--brand); color: #fff; font-size: 0.68rem; line-height: 18px; text-align: center;
  }
  .tabbar-count.hidden { display: none; }
  .tabbar-wa { color: #128c4a; }
  [data-page="home"] .tabbar [data-tab="home"],
  [data-page="shop"] .tabbar [data-tab="shop"],
  [data-page="product"] .tabbar [data-tab="shop"],
  [data-page="account"] .tabbar [data-tab="account"] { color: var(--brand); }
  [data-page="home"] .tabbar [data-tab="home"] .icon,
  [data-page="shop"] .tabbar [data-tab="shop"] .icon,
  [data-page="product"] .tabbar [data-tab="shop"] .icon,
  [data-page="account"] .tabbar [data-tab="account"] .icon { stroke-width: 2.3; }

  /* The tab bar has cart, account and WhatsApp, so the header keeps menu, logo, search and language. */
  .header-actions .account-btn, .header-actions .cart-btn { display: none; }
  .whatsapp-float { display: none; }
  .header-actions .btn, .menu-toggle { min-width: 44px; min-height: 44px; }

  /* Things pinned to the bottom sit above the tab bar. */
  .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px); max-width: calc(100vw - 24px); }

  /* Product page: Buy now / Add to cart stay in reach while reading the plans. */
  .detail-actions {
    position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 5;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    margin-inline: -16px; padding: 10px 16px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
  }
  .detail-actions .btn { width: 100%; min-height: 48px; }
  .detail-actions > :only-child { grid-column: 1 / -1; }

  /* iPhone zooms the page when a field under 16px is tapped; 16px stops that. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea { font-size: 16px !important; }

  /* Comfortable tap targets. */
  .btn { min-height: 44px; }
  .chip, .duration-pill { min-height: 38px; }
  .plan-option, .tier-option { min-height: 52px; }

  /* Panels that slide in (cart, login) use the full phone width. */
  .cart-drawer, .drawer { width: 100% !important; max-width: 100% !important; }
  dialog, .modal { max-width: calc(100vw - 16px); }
}
