/* DeshiMart — organic deshi products theme
   Turmeric gold + terracotta — original DeshiMart palette */
:root {
  --brand: #c47b0a;
  --brand-700: #9a5f08;
  --accent: #9a3412;
  --ink: #1c1917;
  --cream: #faf7f0;
}
* { -webkit-tap-highlight-color: transparent; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}
body {
  font-family: 'Hind Siliguri', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
/* hostfix: match Tailwind preflight so cards don't blow out if CDN fails */
img, svg, video { max-width: 100%; height: auto; }
.dm-card-media img,
.cat-card img,
#heroSlider [data-slide] img,
.hero-slide img {
  max-width: none;
  width: 100%;
  height: 100%;
}
::selection { background: var(--brand); color: #fff; }
body.no-scroll {
  overflow: hidden;
  touch-action: none;
}
/* 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;
}


[data-reveal] { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
[data-reveal].revealed { opacity: 1; transform: none; }

/* Product card — target-like: price in brand color, full-width Order Now */
.dm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ebe6dc;
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.dm-card:hover {
  border-color: rgba(196, 123, 10, 0.35);
  box-shadow: 0 12px 28px -18px rgba(28, 25, 23, 0.35);
}
.dm-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 4px;
}
.dm-card-media {
  display: block; position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; background: #fff; padding: 12px; flex-shrink: 0;
}
.dm-card-media img { width: 100%; height: 100%; max-width: none; object-fit: contain; display: block; }
.dm-card-body {
  display: flex; flex-direction: column; flex: 1;
  text-align: center; padding: 6px 12px 12px;
}
.dm-card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.5em;
  font-size: 0.95rem; font-weight: 600; color: var(--ink); line-height: 1.3; text-decoration: none;
}
.dm-card-title:hover { color: var(--brand); }
.dm-card-price {
  display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap;
  gap: .35rem .5rem; margin: 8px 0 10px; min-height: 1.35em;
}
.dm-price { color: var(--brand); font-size: 1.05rem; font-weight: 800; }
.dm-price-was { color: #a8a29e; font-size: .82rem; text-decoration: line-through; font-weight: 500; }

.dm-order-btn {
  margin-top: auto; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--brand); color: #fff;
  font-size: .9rem; font-weight: 700; padding: .7rem .85rem;
  border: 0; border-radius: 5px; cursor: pointer;
  transition: background .15s ease;
}
.dm-order-btn:hover { background: var(--brand-700); }

.dm-view-btn {
  margin-top: auto; width: 100%;
  display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: var(--brand); border: 1.5px solid var(--brand);
  font-size: .9rem; font-weight: 700; padding: .65rem .85rem;
  border-radius: 5px; text-decoration: none; transition: background .15s, color .15s;
}
.dm-view-btn:hover { background: var(--brand); color: #fff; }

.cat-card { transition: transform .2s ease, box-shadow .2s ease; }
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -16px rgba(28,25,23,.3); }

.variant-chip { border: 1.5px solid #d6d3d1; }
.variant-chip.is-active { border-color: var(--brand); background: var(--brand); color: #fff; }

.hero-dot { width: 8px; height: 8px; border-radius: 999px; background: #fff6; transition: width .2s ease, background .2s ease; }
.hero-dot.is-on { background: #fff; width: 22px; }

.site-header { overflow: visible; }

/* Hero slider — track swipe (keep DeshiMart gold/photo composition) */
.hero-slider {
  position: relative;
  overflow: hidden;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  min-height: 320px;
  height: 320px;
  width: 100%;
  min-width: 0;
}
@media (min-width: 1024px) {
  .hero-slider { min-height: 360px; height: 360px; }
}
.hero-slider.is-grabbing { cursor: grabbing; }
.hero-track {
  display: flex;
  height: 100%;
  min-height: 100%;
  transition: transform .5s cubic-bezier(.25, .46, .45, .94);
  will-change: transform;
}
.hero-track.is-dragging { transition: none; }
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.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 > .dm-card,
.flash-row__item > .product-card {
  height: 100%;
}
@media (min-width: 640px) {
  .flash-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    overflow-x: visible;
    scroll-snap-type: none;
  }
  .flash-row__item {
    flex: none;
    width: auto;
    max-width: none;
  }
}

.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;
}

.sold-track {
  height: 14px; border-radius: 999px; background: #f5f0e6; overflow: hidden;
  border: 1px solid #ebe6dc;
}
.sold-fill {
  height: 100%; background: linear-gradient(90deg, #c47b0a, #e8a00e);
  border-radius: 999px;
}

/* 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) {
  .dm-card-media { padding: 10px; }
  .dm-card-body { padding: 4px 10px 10px; }
  .dm-card-title { font-size: 0.8125rem; min-height: 2.4em; }
  .dm-badge { top: 8px; left: 8px; font-size: 10px; padding: 2px 6px; }
  .dm-order-btn { font-size: 0.8rem; padding: 0.62rem 0.65rem; }
  .dm-price { font-size: 0.95rem; }
  .dm-price-was { font-size: 0.75rem; }

  /* Regular + sale on one centered line (phone) */
  .product-card-price,
  .dm-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, #c47b0a);
}

#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;
}
@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; }
}
