/* ExtraCoins storefront — mobile quick fixes */

.ec-store-nav {
  padding-top: env(safe-area-inset-top, 0px);
}

.ec-store-banner {
  border-bottom: 1px solid transparent;
}

.ec-store-banner--vacation {
  background: #fff7ed;
  border-bottom-color: #fed7aa;
  color: #9a3412;
}

.ec-store-banner--demo {
  background: #eff6ff;
  border-bottom-color: #bfdbfe;
  color: #1e3a8a;
}

.ec-store-banner--market-closed {
  background: #f8fafc;
  border-bottom-color: #cbd5e1;
  color: #334155;
}

.ec-store-banner--inactive {
  background: #fef2f2;
  border-bottom-color: #fecaca;
  color: #991b1b;
}

.ec-store-banner__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: #1d4ed8;
  color: #fff !important;
  font-weight: 600;
  font-size: 0.8rem;
  text-decoration: none;
  white-space: nowrap;
}

.ec-store-banner__link:hover {
  background: #1e40af;
  color: #fff !important;
}

@media (max-width: 767.98px) {
  /* Room for sticky cart bar + iOS home indicator */
  body.ec-has-mobile-cart-bar {
    padding-bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px));
  }

  /*
   * Mobile brand: logo opens menu (no hamburger).
   * Logo height only — do NOT clip the bar or cart with overflow:hidden.
   */
  #navbar_top .ec-nav-brand--menu {
    flex: 0 0 auto;
    width: fit-content;
    padding: 0;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
  }
  #navbar_top .ec-nav-brand--menu:focus-visible {
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
    border-radius: 0.75rem;
  }
  #navbar_top .ec-nav-brand--menu:active .ec-store-logo-frame {
    transform: scale(0.98);
  }
  /* 38px mark — same as desktop (was 48, −10px). No frame clipping. */
  #navbar_top .ec-store-logo-frame {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: none;
    width: auto;
    min-height: 0;
    padding: 0.28rem 0.55rem;
    overflow: visible;
  }
  #navbar_top .ec-store-logo-frame .ec-store-logo {
    height: 2.75rem !important;
    max-height: 2.75rem !important;
    width: auto !important;
    max-width: 6.5rem;
    object-fit: contain;
  }
  #navbar_top .ec-nav-brand-text {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.35rem 0.15rem;
  }
  #navbar_top > .max-w-7xl > .flex.items-center.justify-between {
    justify-content: space-between;
    gap: 0.35rem;
    overflow: visible;
  }
  #navbar_top > .max-w-7xl > .flex.items-center.justify-between > .flex.items-center {
    flex: 0 0 auto;
    gap: 0.2rem !important;
    max-width: none;
    overflow: visible;
  }
  #navbar_top .min-h-16 {
    overflow: visible;
  }

  /* Drawer brand row: logo + name, single line, no float glitch */
  #offcanvasNavbar2 .offcanvas-header {
    align-items: center;
    gap: 0.5rem;
  }
  #offcanvasNavbar2 .ec-drawer-brand {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 0.55rem;
  }
  #offcanvasNavbar2 .ec-drawer-brand-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ec-text, #0f172a);
  }

  /* Categories accordion — collapsed by default */
  #offcanvasNavbar2 .ec-drawer-cats-toggle {
    border: 0;
    background: transparent;
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }
  #offcanvasNavbar2 .ec-drawer-cats-toggle.is-open .ec-drawer-cats-chevron {
    transform: rotate(180deg);
  }
  #offcanvasNavbar2 .ec-drawer-cats-panel {
    max-height: min(50vh, 22rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  #offcanvasNavbar2 .ec-drawer-cat-link {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }
  #offcanvasNavbar2 .ec-drawer-cat-link:active {
    background: rgba(15, 23, 42, 0.04);
  }
  html[data-theme="dark"] #offcanvasNavbar2 .ec-drawer-cat-link:active {
    background: rgba(255, 255, 255, 0.06);
  }
  #offcanvasNavbar2 .ec-drawer-cat-all {
    min-height: 44px;
  }
  #navbar_top .ec-theme-switch-label {
    display: none !important;
  }
  #navbar_top .ec-theme-switch {
    padding: 0.12rem;
  }
  #navbar_top .ec-theme-switch-btn {
    min-height: 34px;
    min-width: 34px;
    padding: 0.25rem;
  }
  #navbar_top .ec-shopper-signed-out span.hidden.md\:inline {
    display: none !important;
  }

  /* Header icon tap targets (hamburger removed — logo opens menu) */
  .ec-mobile-search-toggle,
  #navbar_top .ec-cart-trigger {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  #navbar_top .ec-nav-brand--menu {
    min-height: 44px;
  }
  #navbar_top .ec-theme-switch-btn {
    min-height: 34px;
    min-width: 34px;
  }

  #navbar_top .ec-cart-trigger {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

  /* Utility account row: keep compact on phones */
  #navbar_top .ec-shopper-utility-inner {
    min-height: 1.55rem;
    gap: 0.5rem;
  }
  #navbar_top .ec-shopper-account-label {
    display: none;
  }
  #navbar_top .ec-shopper-account-bar {
    font-size: 0.68rem;
    max-width: calc(100vw - 6rem);
  }

  /* Offcanvas nav links */
  #offcanvasNavbar2 .offcanvas-body a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
  }

  /* Product grid: full-width add buttons */
  .ec-add-to-cart {
    min-height: 48px;
    font-size: 1rem;
    border-radius: 0.75rem;
  }

  .ec-add-cart-row .qtyClass,
  .ec-add-cart-row .ec-qty-input {
    min-height: 48px;
    font-size: 1rem;
    border-radius: 0.65rem;
  }

  .ec-add-cart-controls {
    gap: 0.75rem;
  }

  .ec-qty-field {
    width: 5rem;
  }

  /* Shop pagination */
  .ec-shop-pagination a,
  .ec-shop-pagination span {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }

  /* Checkout: summary flows below form on phone */
  .ec-checkout-summary {
    position: static !important;
    top: auto !important;
  }

  /* Cart panel checkout button */
  #ec-cart-footer .btn-lg {
    min-height: 48px;
  }

  /*
   * Product detail buy box — in-flow card (no full sticky panel).
   * Full sticky used to cover the price; only the qty+button row sticks.
   */
  .ec-detail-buy {
    position: relative;
    z-index: 20;
    margin-left: 0;
    margin-right: 0;
    margin-top: 1.25rem;
    padding: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.07);
  }

  /* Compact sticky controls only — keeps CTA reachable without burying price */
  .ec-detail-buy .ec-add-cart-controls {
    position: sticky;
    bottom: calc(0.65rem + env(safe-area-inset-bottom, 0px));
    z-index: 31;
    margin: 0 -0.35rem;
    padding: 0.55rem 0.35rem;
    background: #fff;
    border-radius: 0.85rem;
    box-shadow: 0 -6px 18px rgba(15, 23, 42, 0.08);
  }

  body.ec-has-mobile-cart-bar .ec-detail-buy .ec-add-cart-controls {
    bottom: calc(4.35rem + env(safe-area-inset-bottom, 0px));
  }

  .ec-detail-buy .ec-add-to-cart {
    min-height: 52px;
    font-size: 1.05rem;
    font-weight: 600;
  }

  .ec-detail-buy .ec-shopper-actions {
    margin-top: 0.75rem;
  }

  .ec-detail-buy .ec-shopper-actions .btn {
    min-height: 40px;
  }

  /* Details price / stock: avoid huge type + awkward wrap on narrow phones */
  .ec-detail-buy + .ec-product-description,
  .max-w-6xl .ec-live-price {
    word-break: break-word;
  }

  body .max-w-6xl h1.text-3xl,
  body .max-w-6xl h1.text-4xl {
    font-size: 1.5rem;
    line-height: 1.25;
  }

  body .max-w-6xl .ec-live-price.text-4xl,
  body .max-w-6xl span.ec-live-price {
    font-size: 1.75rem;
    line-height: 1.2;
  }

  .ec-stock-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
  }

  .ec-stock-status .ml-3 {
    margin-left: 0 !important;
  }
}

/* Sticky mobile cart bar */
.ec-mobile-cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1040;
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ec-mobile-cart-bar.hidden {
  display: none !important;
}

.ec-mobile-cart-bar__open {
  flex: 1;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-weight: 600;
  font-size: 0.95rem;
}

.ec-mobile-cart-bar__checkout {
  flex: 1;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
}

.ec-mobile-cart-bar__checkout:hover {
  background: #000;
  color: #fff;
}

/* Legacy fixed cart trigger — keep in header flow on modern layout */
#navbar_top .ec-cart-trigger {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
  background: transparent;
}