/* Wrapix-inspired — navy + orange (see config/brand.php) */
:root {
  --brand: #002147;
  --brand-700: #001A35;
  --accent: #F37021;
  --ink: #111111;
  --sand: #f5f7fa;
}
* { -webkit-tap-highlight-color: transparent; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}
body {
  font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
}
/* hostfix: constrain media; never let product images use natural height */
img, svg, video { max-width: 100%; height: auto; }
.sh-card-media img,
.product-card img,
#heroSlider [data-slide] img,
.hero-slide img {
  max-width: 100%;
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.font-display { font-family: 'Manrope', 'Plus Jakarta Sans', sans-serif; }
::selection { background: var(--brand); color: #fff; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

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

/* ---- Product card ---- */
.sh-card,
.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #e8e4e1;
  border-radius: 6px;
  overflow: hidden;
  transition: box-shadow .2s ease, border-color .2s ease;
}
.sh-card:hover,
.product-card:hover {
  border-color: rgba(0, 33, 71, 0.28);
  box-shadow: 0 10px 28px -18px rgba(26, 18, 32, 0.35);
}

.sh-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  padding: 4px 8px;
  border-radius: 3px;
  line-height: 1.2;
}

.sh-card-media {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #fff;
  padding: 14px 14px 6px;
  flex-shrink: 0;
}
.sh-card-media img {
  width: 100%;
  height: auto;
  max-width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.sh-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  text-align: center;
  padding: 8px 14px 14px;
}

.sh-card-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
  height: calc(1.35em * 2);
  min-height: calc(1.35em * 2);
  max-height: calc(1.35em * 2);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.sh-card-title:hover { color: var(--brand); }

.sh-card-price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  margin: auto 0 6px; /* top auto keeps price+Shop as a block; title always 2 lines → equal card heights */
  min-height: 1.4em;
}

.sh-price-was {
  color: #9ca3af;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: line-through;
}

.sh-price {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* Full-width Shop Now — like target site CTA */
.sh-shop-btn {
  margin-top: 0;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background: var(--brand);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.72rem 0.85rem;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.sh-shop-btn:hover {
  background: var(--brand-700);
}
.sh-shop-btn:active {
  transform: scale(0.98);
}
.sh-shop-btn svg {
  flex-shrink: 0;
}

/* Equal card heights: title always 2 lines; price+Shop stay grouped at bottom */
.product-grid > .sh-card,
.product-grid > .product-card,
.flash-row .sh-card,
.flash-row .product-card,
.flash-row__item > .sh-card,
.flash-row__item > .product-card {
  height: 100%;
}
.product-grid .sh-card-body,
.flash-row .sh-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}
.flash-row .sold-track {
  display: none !important;
}
.flash-row .sh-card-body form,
.flash-row .sh-shop-btn,
.product-grid .sh-card-body form,
.product-grid .sh-shop-btn,
.sh-card-body > form {
  margin-top: 0 !important;
}

/* Limited Offers header — timer top-right on phone */
.sh-flash-head {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "title timer"
    "more more";
  align-items: center;
  column-gap: 0.75rem;
  row-gap: 0.5rem;
}
.sh-flash-title { grid-area: title; min-width: 0; }
.sh-flash-timer { grid-area: timer; justify-self: end; align-self: start; flex-shrink: 0; }
.sh-flash-more { grid-area: more; justify-self: end; }
@media (min-width: 640px) {
  .sh-flash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
  }
  .sh-flash-title { order: 1; }
  .sh-flash-timer { order: 2; margin-right: auto; margin-left: 1rem; align-self: center; }
  .sh-flash-more { order: 3; margin-left: auto; }
}

.cat-card img { transition: transform .45s ease; }
.cat-card:hover img { transform: scale(1.06); }

.tab-active { color: var(--brand); border-color: var(--brand); font-weight: 700; }

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

.toast-in { opacity: 1 !important; }

.site-header {
  overflow: visible;
}

/* Hero slider — track swipe (keep StyleHub plum photo composition) */
.hero-slider {
  position: relative;
  touch-action: pan-y pinch-zoom;
  cursor: grab;
  min-height: 340px;
  height: 340px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  background: #002147;
}
@media (min-width: 1024px) {
  .hero-slider { min-height: 400px; height: 400px; }
}
.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;
  background-size: cover;
  background-position: center;
}

.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 > .sh-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 { background: rgba(255,255,255,.35); border-radius: 999px; overflow: hidden; height: 14px; position: relative; }
.sold-fill { height: 100%; background: var(--brand); border-radius: 999px; transition: width .3s ease; }
.sold-track.dark { background: #e8eef5; }

/* 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) {
  .sh-card-media { padding: 10px 10px 4px; }
  .sh-card-body { padding: 6px 10px 10px; }
  .sh-card-title {
    font-size: 0.8125rem;
    line-height: 1.35;
    height: calc(1.35em * 2);
    min-height: calc(1.35em * 2);
    max-height: calc(1.35em * 2);
  }
  .sh-badge { top: 8px; left: 8px; font-size: 10px; padding: 3px 6px; }
  .sh-shop-btn { font-size: 0.75rem; padding: 0.62rem 0.65rem; }
  .sh-price { font-size: 0.9rem; }
  .sh-price-was { font-size: 0.75rem; }

  .product-card-price,
  .dm-card-price,
  .fk-card-price,
  .dn-card-price,
  .nr-card-price,
  .rw-card-price,
  .hl-card-price,
  .tz-price {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.125rem;
  }
  /* StyleHub: keep was+now price on one centered row on phone */
  .sh-card-price,
  .product-card .sh-card-price.product-card-price {
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: baseline !important;
    justify-content: center !important;
    gap: 0.35rem 0.45rem !important;
  }
  .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;
  }
  .sh-card-price .sh-price-was { font-size: 0.7rem; }
  .sh-card-price .sh-price { font-size: 0.85rem; }

  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, #002147);
}

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