/* FreshKart — TargetSite-aligned styles (original teal brand) */
:root {
  --fk-brand: #E8751B;
  --fk-brand-dark: #545454;
  --fk-brand-soft: #F7F7F7;
  --fk-ink: #2D2D2D;
  --fk-muted: #6B6B6B;
  --fk-line: #D4D4D4;
  --fk-surface: #FFFFFF;
  --fk-cream: #FDEEE3;
}

* { -webkit-tap-highlight-color: transparent; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}
body {
  font-family: 'Plus Jakarta Sans', 'Hind Siliguri', system-ui, sans-serif;
  color: var(--fk-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* hostfix: contain product/category images without resizing button SVGs */
img, video { max-width: 100%; height: auto; }
.fk-card-media img,
.fk-cat img,
#heroSlider [data-slide] img,
.hero-slide img {
  max-width: none;
  width: 100%;
  height: 100%;
}
.fk-add-plus svg {
  max-width: 14px;
}

/* Lock CTA icons — Tailwind display:block + missing dims = giant arrows when CSS path fails */
.fk-add-btn svg,
.fk-add-plus svg,
.fk-card .fk-add-btn svg,
.product-card .fk-add-btn svg {
  display: block !important;
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  flex-shrink: 0 !important;
}

.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Product card — matches grocery TargetSite card chrome */
.fk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.fk-card:hover { box-shadow: 0 6px 20px rgba(232, 117, 27, 0.1); }

.fk-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--fk-brand);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
}

.fk-card-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #fafafa;
  padding: 12px;
  flex-shrink: 0;
}
.fk-card-media img {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  display: block;
}

.fk-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: center;
  flex: 1;
}

.fk-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fk-ink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.fk-card-title:hover { color: var(--fk-brand); }

.fk-card-price {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
.fk-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--fk-ink);
}
.fk-price-was {
  font-size: 13px;
  color: #9ca3af;
  text-decoration: line-through;
}

.fk-add-btn {
  margin-top: auto;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--fk-brand-soft);
  color: var(--fk-brand-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.fk-add-btn:hover {
  background: var(--fk-brand);
  color: #fff;
}
.fk-add-plus {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}
.fk-add-plus svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* Category tile */
.fk-cat {
  display: block;
  text-align: center;
  background: #fff;
  border: 1px solid #E5E5E5;
  border-radius: 6px;
  padding: 12px 10px 14px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.fk-cat:hover {
  border-color: var(--fk-brand);
  box-shadow: 0 4px 14px rgba(232, 117, 27, 0.08);
}
.fk-cat img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 10px;
  background: var(--fk-surface);
}
.fk-cat span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--fk-ink);
}

/* Page title band (Shop / Offers) */
.fk-page-title {
  background: var(--fk-cream);
  text-align: center;
  padding: 2.25rem 1rem;
}
.fk-page-title h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--fk-ink);
}

/* Variant chips */
.variant-chip {
  border: 1px solid var(--fk-line);
  background: #fff;
  color: var(--fk-ink);
  font-weight: 600;
  font-size: 13px;
  padding: 0.5rem 0.85rem;
  border-radius: 4px;
  cursor: pointer;
}
.variant-chip.is-active,
.variant-chip.active {
  background: var(--fk-brand);
  border-color: var(--fk-brand);
  color: #fff;
}

/* Cart drawer */
[data-cart-drawer] { will-change: transform; }
[data-cart-drawer].is-open { transform: translateX(0) !important; }
[data-drawer-overlay].is-open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--fk-brand-dark);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
/* storefront.js adds .revealed / .in-view; theme main.js uses .is-in */
[data-reveal].is-in,
[data-reveal].revealed,
[data-reveal].in-view {
  opacity: 1;
  transform: none;
}

.hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  border: none;
  padding: 0;
  cursor: pointer;
}
.hero-dot.is-on { background: #fff; width: 22px; }

.site-header { overflow: visible; }

/* Hero slider — track swipe (full-bleed, sharp corners, no tiled bg) */
.hero-slider,
#heroSlider {
  position: relative;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  min-height: 340px;
  width: 100%;
  min-width: 0;
  border-radius: 0;
}
@media (min-width: 640px) {
  .hero-slider,
  #heroSlider { min-height: 420px; }
}
@media (min-width: 1024px) {
  .hero-slider,
  #heroSlider { min-height: 480px; }
}
.hero-slider.is-grabbing,
#heroSlider.is-grabbing { cursor: grabbing; }
.hero-track {
  display: flex;
  width: 100%;
  height: 100%;
  min-height: inherit;
  transition: transform .5s cubic-bezier(.25, .46, .45, .94);
  will-change: transform;
}
.hero-track.is-dragging { transition: none; }
.hero-slide,
#heroSlider [data-slide] {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: inherit;
  overflow: hidden;
  border-radius: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 0.5rem;
  row-gap: 0.625rem;
  align-items: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.product-grid > * {
  min-width: 0;
  max-width: 100%;
}
@media (min-width: 640px) {
  .product-grid {
    gap: 1rem;
    align-items: stretch;
  }
}

.flash-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.125rem;
}
.flash-row__item {
  flex: 0 0 calc((100% - 0.5rem) / 2.15);
  min-width: 0;
  scroll-snap-align: start;
}
.flash-row__item > .fk-card,
.flash-row__item > .product-card {
  height: 100%;
}
@media (min-width: 640px) {
  .flash-row { gap: 0.75rem; }
  .flash-row__item { flex-basis: calc((100% - 1.5rem) / 3.2); }
}
@media (min-width: 1024px) {
  .flash-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    overflow: visible;
    scroll-snap-type: none;
  }
  .flash-row__item {
    flex: unset;
    width: auto;
  }
}

.account-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.5rem;
  width: min(18rem, calc(100vw - 1.5rem));
  max-width: calc(100vw - 1.5rem);
  z-index: 60;
}

/* Mobile menu open state (storefront.js toggles .is-open) */
.mobile-menu.is-open { transform: translateX(0) !important; }

/* Price: never split currency from digits; keep card rows aligned on phone */
.product-card-price,
.product-card .pc-price,
.product-card .pc-price-was,
.product-card .dn-price,
.product-card .dn-price-was,
.product-card .sh-price,
.product-card .sh-price-was,
.product-card .dm-price,
.product-card .dm-price-was,
.product-card .fk-price,
.product-card .fk-price-was,
.product-card .rw-price,
.product-card .rw-price-was,
.product-card .hl-price,
.product-card .hl-price-was,
.product-card .nr-price,
.product-card .nr-price-was,
.product-card .tz-price {
  white-space: nowrap !important;
  word-break: keep-all;
  overflow-wrap: normal;
}
.product-card-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.375rem;
  row-gap: 0.125rem;
  min-height: 1.5rem;
}
@media (max-width: 640px) {
  .fk-card-media { padding: 10px; }
  .fk-card-body { padding: 8px 10px 10px; gap: 4px; }
  .fk-card-title { font-size: 0.8125rem; min-height: 2.4em; }
  .fk-badge { top: 8px; left: 8px; font-size: 10px; padding: 2px 6px; }
  .fk-add-btn { font-size: 0.75rem; padding: 0.55rem 0.65rem; }
  .fk-price { font-size: 0.9rem; }
  .fk-price-was { font-size: 0.75rem; }

  /* Regular + sale on one centered line (phone) */
  .product-card-price,
  .fk-card-price {
    flex-direction: row;
    justify-content: center;
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.35rem;
  }
  .product-card-price > span,
  .sh-card-price > span,
  .dm-card-price > span,
  .fk-card-price > span,
  .dn-card-price > span,
  .nr-card-price > span,
  .hl-card-price > span,
  .tz-price > span {
    white-space: nowrap !important;
    display: inline-block;
    max-width: 100%;
  }
  .product-card-price > span:first-child {
    font-size: 0.9rem;
  }

  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select,
  textarea {
    font-size: 16px !important;
  }
}

@media (max-width: 1023px) {
  .account-dropdown,
  [data-account-dropdown] {
    position: fixed !important;
    left: 0.75rem !important;
    right: 0.75rem !important;
    top: calc(4.75rem + env(safe-area-inset-top, 0px)) !important;
    width: auto !important;
    max-width: none !important;
    margin-top: 0 !important;
    z-index: 60 !important;
  }
}

/* WaveSeller developer credit — high visibility strip */
.ws-dev-credit {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0.95rem 1rem;
  background: #020617;
  color: #f8fafc;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
  border-top: 3px solid #38bdf8;
}
.ws-dev-credit strong {
  color: #38bdf8;
  font-weight: 800;
  font-size: 1.05rem;
  margin-left: 0.25rem;
  letter-spacing: 0.02em;
}
@media (max-width: 640px) {
  .ws-dev-credit {
    font-size: 0.9rem;
    padding: 1rem 0.75rem;
  }
  .ws-dev-credit strong {
    font-size: 1rem;
  }
}

/* ---------- Floating chat + back-to-top (DP-Site method) ---------- */
:root {
  --floating-action-right: max(1.25rem, env(safe-area-inset-right, 0px));
  --floating-action-bottom: max(1.125rem, env(safe-area-inset-bottom, 0px));
  --floating-action-size: 3.25rem;
  --floating-action-gap: 0.75rem;
  --floating-action-shadow: 0 18px 40px -14px rgba(20, 20, 20, 0.4);
  --floating-chat-brand: var(--brand, #E8751B);
}

#backToTop {
  transition: opacity .2s ease, background .15s ease, bottom .2s ease, right .2s ease, width .2s ease, height .2s ease !important;
}
.floating-chat {
  position: fixed;
  right: var(--floating-action-right);
  bottom: var(--floating-action-bottom);
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.625rem;
  pointer-events: none;
  transform: translateZ(0);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.floating-chat__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.85) translateY(0.5rem);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}
.floating-chat__actions.is-open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.floating-chat__btn,
.floating-chat__trigger {
  display: grid;
  place-items: center;
  border: none;
  border-radius: 9999px;
  cursor: pointer;
  pointer-events: auto;
  color: #fff;
  box-shadow: var(--floating-action-shadow);
  transition: transform .15s ease, filter .15s ease, background .15s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.floating-chat__btn {
  width: 3rem;
  height: 3rem;
  min-width: 44px;
  min-height: 44px;
}
.floating-chat__trigger {
  width: var(--floating-action-size);
  height: var(--floating-action-size);
  min-width: 48px;
  min-height: 48px;
  background: var(--floating-chat-brand);
}
.floating-chat__btn--whatsapp { background: #16a34a; }
.floating-chat__btn--messenger { background: #2563eb; }
@media (hover: hover) {
  .floating-chat__btn:hover,
  .floating-chat__trigger:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
  }
}
.floating-chat__icon { grid-area: 1 / 1; }
.floating-chat__icon--close { display: none; }
.floating-chat__trigger[aria-expanded="true"] .floating-chat__icon--open { display: none; }
.floating-chat__trigger[aria-expanded="true"] .floating-chat__icon--close { display: block; }

body.has-floating-chat #backToTop {
  right: var(--floating-action-right) !important;
  bottom: calc(var(--floating-action-bottom) + var(--floating-action-size) + var(--floating-action-gap)) !important;
  width: var(--floating-action-size) !important;
  height: var(--floating-action-size) !important;
  z-index: 36 !important;
}
body.floating-chat-open #backToTop {
  opacity: 0 !important;
  pointer-events: none !important;
}
/* Children use pointer-events:auto — must disable them too or they steal taps over the drawer footer */
body.cart-drawer-open .floating-chat,
body.cart-drawer-open .floating-chat * {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body.cart-drawer-open #backToTop {
  opacity: 0 !important;
  pointer-events: none !important;
}
@media (max-width: 480px) {
  :root {
    --floating-action-right: max(1rem, env(safe-area-inset-right, 0px));
    --floating-action-size: 3.125rem;
  }
  .floating-chat__btn { width: 2.75rem; height: 2.75rem; }
  .floating-chat__btn svg { width: 1.25rem; height: 1.25rem; }
}

/* hostfix: freshkart deals duo — works if Tailwind CDN utilities fail */
.fk-deal-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
.fk-side-tiles { display: none; }
@media (min-width: 1024px) {
  .fk-deal-grid.has-duo { grid-template-columns: 280px minmax(0, 1fr); }
  .fk-side-tiles { display: block; }
}
