/* =====================================================================
   CandyApple — mobile.css
   Mobile experience designed to feel like a native app (max-width: 768px)
   - app top bar, slide-in drawer, bottom tab navigation
   - thumb-first touch targets, snap carousels, safe-area support
   ===================================================================== */

@media (max-width: 768px) {
  :root {
    --gutter: 16px;
    --header-h: 60px;
    --announce-h: 34px;
    --bottomnav-h: 62px;
  }

  body {
    font-size: 15.5px;
    padding-bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom, 0px));
    -webkit-tap-highlight-color: transparent;
  }

  h1 { font-size: 28px; }
  h2 { font-size: 23px; }

  .section { padding: 46px 0; }
  .section-tight { padding: 34px 0; }
  .section-head { margin-bottom: 26px; }

  /* ---------- announcement: compact ticker ---------- */
  .announce-bar {
    font-size: 11.8px;
    letter-spacing: 0.03em;
    padding: 6px 12px;
    min-height: var(--announce-h);
  }

  /* ---------- app top bar ---------- */
  .site-header {
    box-shadow: 0 6px 24px rgba(74, 44, 29, 0.18);
  }
  .header-inner {
    min-height: var(--header-h);
    gap: 8px;
  }
  .brand { gap: 8px; margin: 0 auto; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-name { font-size: 20px; }
  .brand-tag { font-size: 8px; letter-spacing: 0.24em; margin-top: 2px; }

  .menu-btn {
    order: -1;
    margin-left: -8px;
    flex: 0 0 auto;
  }
  .header-actions { margin-left: 0; gap: 0; flex: 0 0 auto; }
  .header-actions .icon-btn { width: 40px; height: 40px; }
  .account-btn { display: none; }

  .search-bar form { padding: 10px 0; gap: 8px; }
  .search-bar input { padding: 11px 16px; font-size: 15px; }

  /* ---------- drawer: full-screen app menu ---------- */
  .drawer {
    width: min(88vw, 350px);
    border-radius: 0 var(--r-l) var(--r-l) 0;
  }
  .drawer-head { padding: 18px; }
  .drawer-head .brand-name { font-size: 21px; }
  .drawer-nav a,
  .drawer-nav .drawer-group {
    padding: 15px 20px;
    font-size: 16px;
    min-height: 52px;
  }
  .drawer-sub a { padding: 12px 20px 12px 52px; }

  /* ---------- hero ---------- */
  .hero-inner {
    padding: 40px 0 46px;
    gap: 30px;
    text-align: center;
  }
  .hero-sub { margin-left: auto; margin-right: auto; }
  .hero-ctas { justify-content: center; }
  .hero-ctas .btn { flex: 1; min-width: 150px; }
  .hero-stats {
    justify-content: space-around;
    gap: 14px;
    margin-top: 32px;
    padding-top: 22px;
  }
  .hero-stat b { font-size: 25px; }
  .hero-art { order: -1; }
  .hero-art img { width: min(78%, 320px); }
  .hero-chip-1 { top: 2%; left: 0; font-size: 12px; padding: 9px 13px; }
  .hero-chip-2 { bottom: 6%; right: 0; font-size: 12px; padding: 9px 13px; }

  /* ---------- category cards ---------- */
  .cat-grid { gap: 12px; }
  .cat-card-body { padding: 13px 14px 15px; }
  .cat-card-name { font-size: 16px; }
  .cat-card-arrow { width: 34px; height: 34px; }

  /* ---------- product cards: dense app grid ---------- */
  .grid-products { gap: 11px; }
  .product-body { padding: 11px 12px 13px; gap: 6px; }
  .product-cat { font-size: 10.5px; }
  .product-name { font-size: 14.5px; }
  .product-desc { display: none; }
  .price { font-size: 15.5px; }
  .price-old { font-size: 12.5px; }
  .product-actions .btn {
    padding: 9px 8px;
    font-size: 12.5px;
    gap: 5px;
  }
  .product-flag { top: 7px; left: 7px; }
  .product-flag .badge { padding: 3px 9px; font-size: 10.5px; }

  /* ---------- rails: snap carousels ---------- */
  .rail {
    grid-auto-columns: minmax(168px, 62%);
    gap: 11px;
    margin: 0 calc(var(--gutter) * -1);
    padding: 0 var(--gutter) 12px;
  }

  /* ---------- USP ---------- */
  .usp-strip { gap: 11px; }
  .usp-item { padding: 16px 14px; gap: 7px; }
  .usp-icon { width: 40px; height: 40px; border-radius: 12px; }
  .usp-item h3 { font-size: 15px; }
  .usp-item p { font-size: 12.5px; }

  /* ---------- promo band ---------- */
  .promo-band {
    padding: 30px 22px;
    border-radius: var(--r);
    text-align: center;
  }
  .promo-band p { margin-left: auto; margin-right: auto; }
  .promo-band .btn { width: 100%; }
  .grid-quotes { gap: 12px; }

  /* ---------- page hero ---------- */
  .page-hero { padding: 34px 0 38px; }
  .page-hero .breadcrumb { font-size: 12.5px; margin-bottom: 12px; }

  /* ---------- catalog ---------- */
  .catalog-toolbar { gap: 12px; margin-bottom: 18px; }
  .toolbar-row { gap: 10px; }
  .sort-select { padding: 10px 36px 10px 14px; font-size: 13.5px; }
  .result-count { font-size: 13.5px; }
  .search-form-inline { width: 100%; min-width: 0; }
  .search-form-inline input { font-size: 15px; }

  .chip-row { gap: 8px; }
  .chip { padding: 9px 15px; font-size: 13.5px; min-height: 40px; }

  .cat-hero { margin-bottom: 22px; border-radius: var(--r); }
  .cat-hero-media { aspect-ratio: 16 / 10; }
  .cat-hero-body { padding: 20px 18px 22px; }
  .subcat-row { gap: 7px; margin-bottom: 20px; }
  .subcat-row .chip { font-size: 13px; }

  /* ---------- product detail ---------- */
  .pdp { gap: 22px; }
  .pdp-main-img { border-radius: var(--r); }
  .pdp-title { font-size: 25px; }
  .pdp-price { margin-top: 14px; padding: 13px 0; }
  .pdp-price .price { font-size: 26px; }
  .pdp-buy { flex-wrap: nowrap; gap: 10px; }
  .pdp-buy .btn-primary { min-width: 0; flex: 1; }
  .qty-stepper button { width: 42px; height: 48px; }
  .pdp-thumb { width: 60px; height: 60px; }

  /* ---------- cart ---------- */
  .cart-item {
    grid-template-columns: 76px 1fr;
    padding: 12px;
    gap: 12px;
  }
  .cart-item-media { width: 76px; height: 76px; }
  .cart-item-name { font-size: 15px; }
  .cart-item-row { margin-top: 9px; }
  .cart-item .qty-stepper button { width: 36px; height: 36px; }
  .cart-item .qty-stepper input { width: 38px; }
  .summary-card { padding: 18px 16px; border-radius: var(--r); }
  .cart-layout .btn-block-mobile { width: 100%; }

  /* ---------- checkout / forms ---------- */
  .form-card { padding: 20px 16px; }
  .form-card h3 { font-size: 17.5px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .pay-option { padding: 14px; }
  .bank-box dt { min-width: 100px; }

  .field input,
  .field select,
  .field textarea,
  .input { font-size: 16px; } /* prevents iOS zoom on focus */

  .btn {
    padding: 14px 24px;
    font-size: 15px;
    min-height: 48px;
  }
  .btn-sm { padding: 11px 18px; min-height: 42px; font-size: 14px; }
  .btn-lg { padding: 15px 26px; min-height: 52px; }

  /* ---------- auth ---------- */
  .auth-wrap {
    padding: 30px 16px 46px;
    align-items: start;
  }
  .auth-card {
    padding: 30px 20px;
    border-radius: var(--r-l);
    max-width: 420px;
  }
  .auth-brand img { width: 54px; }
  .auth-card h1 { font-size: 24px; }

  .otp-inputs input {
    width: 46px;
    height: 56px;
    font-size: 22px;
  }

  /* ---------- account / orders ---------- */
  .account-menu {
    margin: 0 calc(var(--gutter) * -1);
    padding: 8px var(--gutter);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    scrollbar-width: none;
  }
  .account-menu::-webkit-scrollbar { display: none; }
  .account-menu a,
  .account-menu button { padding: 10px 14px; min-height: 42px; }

  .profile-card { padding: 20px 16px; }
  .profile-avatar { width: 56px; height: 56px; font-size: 22px; }
  .order-card-head { padding: 13px 15px; }
  .order-card-body { padding: 14px 15px; }
  .order-card-foot { padding: 13px 15px; }

  /* ---------- about / contact ---------- */
  .stat-band {
    padding: 30px 18px;
    gap: 20px 12px;
    border-radius: var(--r);
  }
  .value-card { padding: 22px 18px; }
  .contact-line { padding: 14px 15px; }
  .contact-line .icon { width: 40px; height: 40px; padding: 9px; }
  .map-frame iframe { height: 260px; }

  /* ---------- footer ---------- */
  .site-footer { margin-top: 46px; }
  .footer-grid {
    gap: 0;
    padding: 0 0 26px;
  }
  .footer-col {
    border-bottom: 1px solid rgba(250, 245, 236, 0.14);
  }
  .footer-col:last-child { border-bottom: 0; }
  .footer-col h4 {
    font-size: 15.5px;
    margin-bottom: 0;
    padding: 17px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }
  .footer-col h4::after { display: none; }
  .footer-col h4 .icon {
    transition: transform 0.3s var(--ease);
    color: var(--pistachio);
  }
  .footer-col.is-collapsed h4 .icon { transform: rotate(-90deg); }
  .footer-col .footer-inner {
    padding-bottom: 20px;
    display: grid;
    gap: 14px;
  }
  .footer-col.is-collapsed .footer-inner { display: none; }
  .footer-about { gap: 12px; }
  .footer-bottom { padding: 18px 0; font-size: 12.5px; }

  /* ---------- whatsapp widget ---------- */
  .wa-widget {
    right: 14px;
    bottom: calc(var(--bottomnav-h) + 14px + env(safe-area-inset-bottom, 0px));
  }
  .wa-fab { width: 54px; height: 54px; }
  .wa-panel { width: min(86vw, 300px); }

  /* ---------- bottom tab bar ---------- */
  .bottom-nav { display: block; }

  /* ---------- pagination ---------- */
  .pagination { margin-top: 30px; gap: 6px; }
  .page-link { min-width: 40px; height: 40px; padding: 0 12px; font-size: 14px; }

  /* ---------- misc polish ---------- */
  .empty-state { padding: 44px 18px; }
  .empty-state .empty-icon { width: 68px; height: 68px; }
  .success-hero { padding: 40px 0 16px; }

  /* sticky mobile CTA bar for PDP handled by normal flow */
  .flash-stack { margin-top: 16px; }
}

/* small phones */
@media (max-width: 380px) {
  .brand-name { font-size: 18px; }
  .grid-products { gap: 9px; }
  .product-name { font-size: 13.5px; }
  .hero-stats { gap: 10px; }
  .otp-inputs { gap: 6px; }
  .otp-inputs input { width: 42px; height: 52px; font-size: 20px; }
}
