/* ==========================================================================
   BRICO v5 - "Market"
   store.css - customer-facing styles. Loaded AFTER tokens.css.
   Marketplace language (80% MLC ref): white sticky header with search
   pill, category pills, left filter sidebar, rounded product cards with
   heart + price pill, soft lavender wash background.
   ========================================================================== */

/* ============================ HEADER ============================ */

.page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.hd {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 60;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 var(--line), 0 8px 24px -18px rgba(31, 28, 26, 0.32);
}
/* thin brand-gradient accent line under the header - a small, cheap detail
   that makes the header read as designed rather than a bare white bar */
.hd::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg, var(--violet) 0%, var(--coral) 55%, var(--gold) 100%);
  opacity: 0.9;
}
.hd-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 72px;
}
.hd-search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}
.hd-search-ic {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  display: inline-flex;
  pointer-events: none;
}
.hd-search-ic svg {
  width: 18px;
  height: 18px;
}
.hd-search input,
#hd-search-form-m input {
  background: var(--bg-deep);
  border: 1.5px solid transparent;
  border-radius: var(--r-pill);
  color: var(--ink);
  padding: 12px 18px 12px 46px;
}
.hd-search input::placeholder,
#hd-search-form-m input::placeholder {
  color: var(--faint);
}
.hd-search input:focus,
#hd-search-form-m input:focus {
  background: var(--card);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.hd-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: none;
}
.hd-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: var(--r-pill);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  transition: background 160ms var(--ease), color 160ms var(--ease);
  border: none;
  background: none;
  cursor: pointer;
}
.hd-link svg {
  width: 20px;
  height: 20px;
  flex: none;
}
.hd-link-label {
  white-space: nowrap;
}
.hd-link:hover {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.hd-link .count {
  position: absolute;
  top: 2px;
  left: 26px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--coral);
  color: #fff;
  border-radius: var(--r-pill);
  font-size: 0.62rem;
  font-weight: 800;
}
.hd-link .count[hidden] {
  display: none;
}
.hd-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral) 0%, #ff8a5c 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  flex: none;
  box-shadow: 0 4px 10px rgba(240, 78, 35, 0.3);
}
.hd-search-toggle {
  display: none;
}
.hd-searchrow {
  display: none;
  padding: 4px 16px 14px;
}
.hd-searchrow.open {
  display: block;
}
#hd-search-form-m {
  position: relative;
}
@media (max-width: 900px) {
  .hd-search {
    display: none;
  }
  .hd-search-toggle {
    display: inline-flex;
  }
  .hd-link span.hd-link-label {
    display: none;
  }
  .hd-link {
    padding: 9px;
  }
}

/* ============================ CATEGORY PILLS ============================ */

.cat-pills {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 18px 2px 6px;
  scrollbar-width: none;
}
.cat-pills::-webkit-scrollbar {
  display: none;
}
.cat-pill {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--r-pill);
  background: var(--card);
  border: 1.5px solid var(--line);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 160ms var(--ease);
  white-space: nowrap;
}
.cat-pill svg {
  width: 16px;
  height: 16px;
}
.cat-pill:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
}
.cat-pill.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 14px rgba(108, 92, 231, 0.35);
}

/* ============================ PROMO BANNER ============================ */

/* ============================ HERO ============================ */
.hero {
  margin-top: 18px;
  border-radius: var(--r-xl);
  background: linear-gradient(150deg, #241f5c 0%, #3d3399 38%, var(--violet) 68%, var(--coral) 145%);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px -16px rgba(36, 31, 92, 0.55);
}
.hero-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 420px at 100% 0%, rgba(255, 255, 255, 0.14) 0%, transparent 62%),
    radial-gradient(260px 260px at 8% 112%, rgba(255, 255, 255, 0.08) 0%, transparent 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.04) 0 10px, transparent 10px 26px);
}
.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 20px;
  padding: 56px 52px;
}
.hero-kicker {
  display: inline-block;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--r-pill);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 5px 14px;
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.1rem, 4vw, 3.4rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: 15ch;
}
.hero-sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 1.02rem;
  line-height: 1.55;
  margin-top: 16px;
  max-width: 42ch;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}
.btn-coral {
  background: var(--coral);
  color: #fff;
  border: none;
}
.btn-coral:hover {
  background: var(--coral-deep, #d94f2e);
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(255, 90, 54, 0.4);
}
.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}
.btn-ghost-dark:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.55);
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 30px;
  padding: 0;
  list-style: none;
}
.hero-badges li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}
.hero-badge-ic {
  display: inline-flex;
  width: 26px;
  height: 26px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  flex: none;
}
.hero-badge-ic svg {
  width: 14px;
  height: 14px;
}
.hero-visual {
  position: relative;
  height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(220px 220px at 50% 50%, rgba(255, 255, 255, 0.16) 0%, transparent 70%);
}
.hero-art {
  width: 82%;
  max-width: 320px;
  position: relative;
  filter: drop-shadow(0 20px 30px rgba(20, 14, 60, 0.35));
}
.hero-float {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 10px 14px;
  box-shadow: 0 14px 30px -8px rgba(20, 14, 60, 0.4);
  font-size: 0.78rem;
}
.hero-float strong {
  display: block;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.1;
}
.hero-float span {
  color: var(--ink-soft);
}
.hero-float-a {
  top: 6%;
  left: -4%;
  animation: hero-float-bob 5s ease-in-out infinite;
}
.hero-float-b {
  bottom: 8%;
  right: -6%;
  animation: hero-float-bob 5s ease-in-out infinite 1.4s;
}
.hero-float-a-svg,
.hero-float-b-svg {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex: none;
}
.hero-float-a-svg {
  background: var(--gold-soft, #fef0d0);
  color: var(--gold-deep, #a9720b);
}
.hero-float-b-svg {
  background: var(--green-soft, #d9f5e6);
  color: var(--green-deep, #16794a);
}
.hero-float-a-svg svg,
.hero-float-b-svg svg {
  width: 16px;
  height: 16px;
}
@keyframes hero-float-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-float-a,
  .hero-float-b {
    animation: none;
  }
}
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 40px 28px;
  }
  .hero-visual {
    display: none;
  }
}
@media (max-width: 640px) {
  .hero-inner {
    padding: 32px 22px;
  }
  .hero-title {
    max-width: none;
  }
  .hero-actions .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

/* ============================ SHOP LAYOUT + FILTERS ============================ */

.shop-layout {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  padding: 14px 0 10px;
  scroll-margin-top: 84px;
}
.filters {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  position: sticky;
  top: 96px;
}
.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.filters-head h2 {
  font-weight: 800;
  font-size: 1.05rem;
}
.filters-reset {
  background: none;
  border: none;
  color: var(--brand-deep);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
}
.filters-reset:hover {
  background: var(--brand-soft);
}
.f-group {
  border-top: 1px solid var(--line);
  padding: 18px 0 4px;
  margin-top: 14px;
}
.f-group > h3 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 14px;
}
/* price range dual slider */
.price-slider {
  position: relative;
  height: 34px;
  margin: 6px 0 4px;
}
.price-slider input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: none;
  pointer-events: none;
  margin: 0;
  padding: 0;
  border: none;
}
.price-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  pointer-events: auto;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  margin-top: -9px;
}
.price-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--brand);
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.price-track {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 6px;
  transform: translateY(-50%);
  border-radius: var(--r-pill);
  background: var(--bg-deep);
}
.price-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--violet), var(--coral));
}
.price-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
}
.price-bubble {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-deep);
  background: var(--brand-soft);
  border-radius: var(--r-pill);
  padding: 4px 12px;
}
.f-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-radius: 8px;
}
.f-check:hover {
  color: var(--ink);
}
.f-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  flex: none;
  cursor: pointer;
}
.f-check .f-count {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--faint);
  background: var(--bg-deep);
  border-radius: var(--r-pill);
  padding: 2px 9px;
}
.filters-mobile-bar {
  display: none;
}
@media (max-width: 960px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
  .filters {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 95;
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    max-height: 78vh;
    overflow-y: auto;
    transform: translateY(105%);
    transition: transform 280ms var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .filters.open {
    transform: none;
  }
  .filters-mobile-bar {
    display: flex;
    gap: 10px;
    margin: 12px 0 0;
  }
  .filters-mobile-bar .btn {
    flex: 1;
  }
}

/* ============================ TOOLBAR ============================ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  flex-wrap: wrap;
}
.toolbar-count {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-right: auto;
}
.toolbar-count strong {
  color: var(--ink);
}
.toolbar select {
  width: auto;
  padding: 9px 38px 9px 16px;
  border-radius: var(--r-pill);
  font-size: 0.85rem;
  font-weight: 700;
  background-color: var(--card);
}
.viewtoggle {
  display: flex;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--r-pill);
  padding: 3px;
}
.viewtoggle button {
  width: 38px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: var(--r-pill);
  cursor: pointer;
  color: var(--faint);
}
.viewtoggle button svg {
  width: 18px;
  height: 18px;
}
.viewtoggle button.is-active {
  background: var(--brand);
  color: #fff;
}

/* ============================ PRODUCT CARDS ============================ */

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 18px;
  padding: 6px 0 10px;
}
.shelf-tag {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease),
    border-color 200ms var(--ease);
  overflow: hidden;
}
.shelf-tag:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--coral-soft);
}
/* Bento: the top result gets a wide, horizontal treatment instead of
   blending into the uniform grid - a real layout change (spans 2
   columns), not a color/decoration tweak. Falls back to the normal
   card shape below 720px, where a 2-column grid means "span 2" would
   just force full width anyway and the horizontal split has no room. */
.shelf-tag.is-featured {
  grid-column: span 2;
}
@media (min-width: 720px) {
  .shelf-tag.is-featured {
    flex-direction: row;
    align-items: stretch;
  }
  .shelf-tag.is-featured .tag-media {
    width: 44%;
    flex: none;
    aspect-ratio: auto;
  }
  .shelf-tag.is-featured .tag-body {
    flex: 1;
    padding: 22px 26px;
    justify-content: center;
    gap: 10px;
  }
  .shelf-tag.is-featured .tag-aisle {
    font-size: 0.72rem;
  }
  .shelf-tag.is-featured .tag-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    -webkit-line-clamp: 2;
    min-height: 0;
  }
  .shelf-tag.is-featured .tag-pricerow {
    margin-top: 6px;
  }
  .shelf-tag.is-featured .price-pill {
    font-size: 1.02rem;
    padding: 10px 16px 10px 20px;
  }
}
.tag-media {
  margin: 10px 10px 0;
  border-radius: var(--r-md);
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%);
  position: relative;
  overflow: hidden;
}
.tag-media a {
  display: block;
  width: 100%;
  height: 100%;
}
.tag-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms var(--ease);
}
.shelf-tag:hover .tag-media img {
  transform: scale(1.05);
}
.shelf-tag.is-out .tag-media img {
  filter: grayscale(1);
  opacity: 0.55;
}
.noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
}
.noimg svg {
  width: 44px;
  height: 44px;
}
.noimg.big {
  min-height: 320px;
}
.tag-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--violet);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  animation: stamp-in 160ms var(--ease);
  box-shadow: 0 4px 10px rgba(108, 92, 231, 0.4);
}
.tag-badge.gold {
  background: var(--gold);
  color: #5c430a;
  box-shadow: 0 4px 10px rgba(255, 197, 49, 0.45);
}
.tag-wish {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  color: var(--ink-soft);
  transition: transform 160ms var(--ease), color 160ms var(--ease),
    background 160ms var(--ease);
}
.tag-wish svg {
  width: 18px;
  height: 18px;
}
.tag-wish:hover {
  transform: scale(1.1);
  color: var(--coral);
}
.tag-wish.is-active {
  background: var(--coral);
  color: #fff;
}
.tag-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.94);
  color: #b3272d;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
}
.tag-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.tag-skurow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.tag-sku {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag-name {
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.tag-name a {
  text-decoration: none;
  color: inherit;
}
.tag-name a:hover {
  color: var(--brand-deep);
}
.tag-aisle {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.tag-pricerow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}
.tag-price {
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 2px solid var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 8px 14px 8px 18px;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: all 160ms var(--ease);
  font-variant-numeric: tabular-nums;
}
/* the small cart+plus glyph is what tells people this price IS the
   add-to-cart button - sits in its own soft chip so it reads as a
   control, not decoration */
.price-pill-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  flex: none;
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
.price-pill-cart svg {
  width: 15px;
  height: 15px;
}
.price-pill:hover {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 18px rgba(108, 92, 231, 0.4);
  transform: translateY(-1px);
}
.price-pill:hover .price-pill-cart {
  background: rgba(255, 255, 255, 0.22);
  transform: scale(1.08) rotate(-6deg);
}
.price-pill.is-added {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.price-pill.is-added .price-pill-cart {
  background: rgba(255, 255, 255, 0.28);
}
.tag-price .was {
  font-size: 0.78rem;
  color: var(--faint);
  text-decoration: line-through;
  font-weight: 600;
}
.tag-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.tag-actions .icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
}
.tag-actions .btn {
  flex: 1;
}

/* List variant */
.ledger-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0 10px;
}
.ledger-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto auto auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 12px 18px 12px 12px;
}
.lr-thumb {
  width: 84px;
  height: 84px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%);
  display: block;
  overflow: hidden;
}
.lr-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lr-main {
  min-width: 0;
}
.lr-name {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.4;
}
.lr-name a {
  text-decoration: none;
  color: inherit;
}
.lr-name a:hover {
  color: var(--brand-deep);
}
.lr-meta {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 4px;
}
.lr-price {
  text-align: right;
}
.lr-price .now {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--brand-deep);
}
.lr-price .was {
  display: block;
  font-size: 0.76rem;
  color: var(--faint);
  text-decoration: line-through;
}
.lr-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tag-stamp-inline {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #b3272d;
  background: var(--red-soft);
  padding: 6px 12px;
  border-radius: var(--r-pill);
}
@media (max-width: 760px) {
  .ledger-row {
    grid-template-columns: 72px minmax(0, 1fr) auto;
    row-gap: 10px;
  }
  .lr-thumb {
    width: 72px;
    height: 72px;
  }
  .ledger-row .stocklamp {
    grid-column: 2 / 4;
    justify-self: start;
  }
  .lr-price {
    text-align: left;
  }
  .lr-actions {
    grid-column: 1 / 4;
  }
}

/* ============================ PERKS STRIP ============================ */

.perks-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 34px 0 8px;
}
.perk-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.perk-ic {
  width: 46px;
  height: 46px;
  flex: none;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.perk-ic svg {
  width: 22px;
  height: 22px;
}
.perk-ic.v {
  background: var(--violet-soft);
  color: var(--violet-deep);
}
.perk-ic.c {
  background: var(--coral-soft);
  color: var(--coral-deep);
}
.perk-ic.g {
  background: var(--green-soft);
  color: #14663a;
}
.perk-card h3 {
  font-weight: 800;
  font-size: 0.98rem;
  margin-bottom: 4px;
}
.perk-card p {
  color: var(--ink-soft);
  font-size: 0.86rem;
}
@media (max-width: 760px) {
  .perks-strip {
    grid-template-columns: 1fr;
  }
}

/* ============================ RECENTLY VIEWED RAIL ============================ */

.rail {
  padding: 36px 0 4px;
}
.rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}
.rail-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 14px 2px 12px;
  scrollbar-width: thin;
}
.mini-tag {
  flex: 0 0 200px;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.mini-tag:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.mini-tag img {
  width: 58px;
  height: 58px;
  flex: none;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--bg-deep);
}
.mini-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.mini-main .t {
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mini-main .p {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand-deep);
}
.mini-tag.tall {
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 0;
  min-width: 0;
}
.mini-tag.tall img {
  width: 100%;
  height: 120px;
}

/* ============================ PRODUCT PAGE ============================ */

.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 22px 0 18px;
}
.crumbs a {
  color: var(--ink-soft);
  text-decoration: none;
}
.crumbs a:hover {
  color: var(--brand-deep);
}
.prod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}
.gal {
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  padding: 12px;
}
.gal img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--r-lg);
}
.gal .tag-badge {
  top: 22px;
  left: 22px;
}
.gal-wrap {
  position: sticky;
  top: 96px;
}
.gal-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.gal-thumb {
  flex: none;
  width: 68px;
  height: 68px;
  padding: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--card);
  cursor: pointer;
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}
.gal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gal-thumb:hover {
  border-color: var(--brand-soft);
  transform: translateY(-2px);
}
.gal-thumb.is-active {
  border-color: var(--brand);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.25);
}
.buy {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 28px;
}
.buy .tag-skurow {
  margin-bottom: 4px;
}
.pname {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 8px 0 4px;
}
.price-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0 10px;
  flex-wrap: wrap;
}
.price-block .now {
  font-weight: 800;
  font-size: 2.2rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}
.price-block .was {
  color: var(--faint);
  text-decoration: line-through;
  font-size: 1rem;
  font-weight: 600;
}
.qv-stock {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.shelf-note {
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.buy-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 0;
  flex-wrap: wrap;
  align-items: stretch;
}
.buy-row .btn-primary,
.buy-row .btn-coral {
  flex: 1;
  min-width: 140px;
}
.perks {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: grid;
  gap: 10px;
}
.perks li {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.perks svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--brand);
}
.spec-sheet {
  margin-top: 24px;
  background: #faf9fe;
  border-radius: var(--r-md);
  overflow: hidden;
}
.spec-sheet td.k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--faint);
  text-transform: uppercase;
  white-space: nowrap;
  width: 130px;
}
.related {
  padding: 44px 0 4px;
}
.related .shelf-grid {
  padding-top: 16px;
}
@media (max-width: 900px) {
  .prod-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ============================ PAGE HEADS ============================ */

.page-head {
  padding: 30px 0 6px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--t-h1);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 10px 0 0;
}
.page-intro {
  color: var(--ink-soft);
  margin-top: 8px;
  max-width: 60ch;
}

/* ============================ CHECKOUT ============================ */

.steps {
  display: flex;
  background: var(--card);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-sm);
  margin: 22px 0 26px;
  padding: 6px;
  gap: 4px;
}
.step {
  flex: 1;
  padding: 10px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--faint);
  border-radius: var(--r-pill);
  text-align: center;
  white-space: nowrap;
}
.step .sn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-deep);
  font-size: 0.7rem;
  font-weight: 800;
  margin-right: 8px;
}
.step.is-now {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}
.step.is-now .sn {
  background: rgba(255, 255, 255, 0.25);
}
.step.is-done {
  color: var(--green);
}
.step.is-done .sn {
  background: var(--green-soft);
  color: #14663a;
}
.co-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 22px;
  align-items: start;
  padding-bottom: 60px;
}
.co-sec-title {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin: 26px 0 14px;
}
.co-sec-title:first-child {
  margin-top: 0;
}
.co-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.co-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--violet-soft), var(--coral-soft));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--violet-deep);
  overflow: hidden;
}
.co-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.co-main {
  min-width: 0;
}
.co-name {
  font-weight: 700;
  font-size: 0.94rem;
  line-height: 1.4;
}
.co-sku {
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  color: var(--faint);
  margin: 4px 0 10px;
}
.co-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.co-total {
  font-weight: 800;
  font-size: 1rem;
}
.co-minus,
.co-plus {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 160ms var(--ease);
  flex: none;
}
.co-minus svg,
.co-plus svg {
  width: 15px;
  height: 15px;
}
.co-minus:hover,
.co-plus:hover {
  border-color: var(--brand);
  color: var(--brand-deep);
  background: var(--brand-soft);
}
.co-remove {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--faint);
  padding: 2px 0;
}
.co-remove svg {
  width: 15px;
  height: 15px;
}
.co-remove:hover {
  color: var(--red);
}
.coupon-slot {
  border: 2px dashed var(--line);
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 16px;
  margin: 18px 0 6px;
}
.coupon-slot form {
  display: flex;
  gap: 8px;
}
.coupon-slot form input {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}
.coupon-slot .form-hint {
  margin: 10px 0 0;
}
.coupon-applied {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.invoice {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  padding: 26px;
  position: sticky;
  top: 96px;
}
/* Cash-on-delivery is the only payment method this store supports (no
   card/online gateway anywhere in the flow) - this notice is what tells
   the customer that plainly before they commit, instead of them finding
   out only after placing the order. */
.pay-method-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin: 14px 0;
  color: var(--ink-soft);
}
.pay-method-note svg {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--green);
  margin-top: 1px;
}
.pay-method-note strong {
  display: block;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 700;
}
.pay-method-note span {
  display: block;
  font-size: 0.78rem;
  line-height: 1.4;
  margin-top: 2px;
}
.invoice h3 {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}
.inv-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.inv-row.total {
  border-bottom: none;
  padding-top: 16px;
}
.inv-row.total .v {
  font-weight: 800;
  font-size: 1.9rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}
.inv-hint {
  font-size: 0.74rem;
  color: var(--faint);
  margin-top: 12px;
}
.invoice .btn-coral,
.invoice .btn-primary {
  width: 100%;
  margin-top: 18px;
}
@media (max-width: 960px) {
  .co-grid {
    grid-template-columns: 1fr;
  }
  .invoice {
    position: static;
    order: 2;
  }
}

/* Confirmation ticket */
.confirm-wrap {
  padding: 40px 0 70px;
}
.ticket {
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  max-width: 680px;
  margin: 0 auto;
  overflow: hidden;
}
.ticket-main {
  padding: 38px 32px 30px;
  text-align: center;
}
.ticket-ok {
  width: 60px;
  height: 60px;
  margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--green), #35c26f);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: stamp-in 160ms var(--ease);
  box-shadow: 0 8px 20px rgba(31, 169, 92, 0.4);
}
.ticket-ok svg {
  width: 28px;
  height: 28px;
}
.ticket-code {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  letter-spacing: 0.04em;
  margin: 14px 0 16px;
}
.ticket-total {
  font-weight: 800;
  font-size: 1.7rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
  margin-top: 10px;
}
.ticket-pay-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 8px 16px;
  background: var(--green-soft);
  color: var(--green-deep, #16794a);
  border-radius: var(--r-pill);
  font-size: 0.8rem;
  font-weight: 700;
}
.ticket-pay-note svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.ticket-body {
  padding: 6px 32px 28px;
}
.ticket-stub {
  border-top: 2px dashed var(--line);
  background: #faf9fe;
  padding: 24px 32px;
  text-align: center;
}
.stub-code {
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}
.stub-hint {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 6px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}
.confirm-note {
  text-align: center;
  margin-top: 18px;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 20px 0;
}
.meta-grid .k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 5px;
}
.meta-grid .v {
  font-weight: 700;
  font-size: 0.94rem;
}
.totals {
  margin-top: 18px;
}

/* ============================ ROUTE TIMELINE ============================ */

.route {
  display: flex;
  align-items: flex-start;
  margin: 30px 0 8px;
}
.route-stop {
  flex: 1;
  text-align: center;
  position: relative;
  min-width: 0;
}
.route-line {
  position: absolute;
  top: 9px;
  left: calc(-50% + 14px);
  right: calc(50% + 14px);
  height: 3px;
  border-radius: 3px;
  background: var(--line);
}
.route-line.filled {
  background: var(--brand);
}
.route-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 3px solid var(--line);
  background: var(--card);
  margin: 0 auto 10px;
  position: relative;
  z-index: 1;
}
.route-stop.done .route-dot {
  background: var(--brand);
  border-color: var(--brand);
}
.route-stop.now .route-dot {
  background: var(--coral);
  border-color: var(--coral);
  box-shadow: 0 0 0 5px var(--coral-soft);
  animation: route-pulse 1.8s ease-in-out infinite;
}
@keyframes route-pulse {
  0%, 100% {
    box-shadow: 0 0 0 5px var(--coral-soft);
  }
  50% {
    box-shadow: 0 0 0 9px var(--coral-soft);
  }
}
@media (prefers-reduced-motion: reduce) {
  .route-stop.now .route-dot {
    animation: none;
  }
}
.route-label {
  display: block;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  line-height: 1.5;
}
.route-stop.done .route-label,
.route-stop.now .route-label {
  color: var(--ink);
}
@media (max-width: 640px) {
  .route {
    flex-direction: column;
    gap: 20px;
  }
  .route-stop {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    text-align: left;
  }
  .route-dot {
    margin: 0;
    flex: none;
  }
  .route-line {
    top: 28px;
    bottom: -22px;
    left: 9px;
    right: auto;
    width: 3px;
    height: auto;
  }
}
.cancelled-banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--red-soft);
  color: #b3272d;
  padding: 16px 18px;
  margin: 0 32px 24px;
  font-size: 0.92rem;
  border-radius: var(--r-md);
}
.cancelled-banner svg {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: 1px;
}

/* ============================ TRACK LOOKUP ============================ */

.lookup-panel {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sm);
  padding: 34px;
}
.lookup-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.lookup-form input {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  border-radius: var(--r-pill);
  padding-left: 20px;
}
.lookup-form .btn {
  flex: none;
}
.track-result {
  margin-top: 30px;
  padding-bottom: 70px;
}
.track-result .section-title {
  margin: 26px 0 4px;
  font-size: 1.2rem;
}

/* ============================ LOGIN ============================ */

.auth-wrap {
  max-width: 940px;
  margin: 52px auto 70px;
}
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  border-radius: var(--r-xl);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.auth-side {
  background: linear-gradient(150deg, #3d3399 0%, var(--violet) 52%, var(--coral) 145%);
  color: #fff;
  padding: 44px 36px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
}
/* same soft-glow + diagonal-stripe texture as the homepage promo banner,
   so the brand gradient panel reads consistently across the whole site
   instead of two different "gradient card" treatments */
.auth-side::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(220px 220px at 108% -8%, rgba(255, 255, 255, 0.16) 0%, transparent 60%),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 10px, transparent 10px 26px);
  pointer-events: none;
}
.auth-side > * {
  position: relative;
  z-index: 1;
}
.auth-side .brand {
  align-self: flex-start;
}
.auth-side .brand-word {
  color: #fff;
}
.auth-side h2 {
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.auth-side p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.92rem;
}
.auth-perks {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  display: grid;
  gap: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}
.auth-perks li {
  display: flex;
  gap: 10px;
  align-items: center;
}
.auth-perks svg {
  width: 17px;
  height: 17px;
  flex: none;
}
.auth-form {
  padding: 40px 36px;
}
.utabs {
  display: flex;
  gap: 8px;
  background: var(--bg-deep);
  border-radius: var(--r-pill);
  padding: 5px;
  margin-bottom: 26px;
}
.utab {
  flex: 1;
  background: none;
  border: none;
  padding: 11px 8px;
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--faint);
  cursor: pointer;
  border-radius: var(--r-pill);
  transition: all 160ms var(--ease);
}
.utab.is-active {
  color: var(--ink);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.utab:hover {
  color: var(--ink);
}
.auth-form .btn-block {
  margin-top: 8px;
}
@media (max-width: 760px) {
  .auth-split {
    grid-template-columns: 1fr;
  }
  .auth-side {
    padding: 32px 28px;
  }
}

/* ============================ ACCOUNT ============================ */

.acct-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 32px 0 8px;
  flex-wrap: wrap;
}
.acct-avatar {
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--coral));
  color: #fff;
  font-weight: 800;
  font-size: 1.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.acct-name {
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.acct-email {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 4px;
}
.acct-head .spacer {
  flex: 1;
}
.acct-tabs {
  margin: 22px 0 26px;
}
.order-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.order-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto auto;
  gap: 18px;
  align-items: center;
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
}
.order-code {
  font-weight: 800;
  font-size: 0.85rem;
  text-decoration: none;
  font-family: var(--font-mono);
}
.order-code:hover {
  color: var(--brand-deep);
}
.order-date {
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.order-total {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.acct-panel {
  max-width: 580px;
  padding-bottom: 60px;
}
.tabpane[hidden] {
  display: none;
}
@media (max-width: 640px) {
  .order-row {
    grid-template-columns: 1fr auto;
    row-gap: 8px;
  }
  .order-date {
    grid-column: 1;
  }
}

/* ============================ FOOTER ============================ */

.site-footer {
  background: var(--dark);
  color: var(--dark-ink);
  margin-top: 64px;
  padding: 54px 0 30px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  position: relative;
  overflow: hidden;
}
/* same three-color brand line as the header, mirrored at the top of the
   footer - a small bookend detail tying the top and bottom of every page
   together instead of the header being the only place with an accent */
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--violet) 0%, var(--coral) 55%, var(--gold) 100%);
}
.footer-word {
  font-weight: 800;
  font-size: clamp(3.5rem, 12vw, 9rem);
  line-height: 0.95;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, rgba(148, 130, 255, 0.22), rgba(255, 255, 255, 0.04));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
  margin-bottom: 28px;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding-bottom: 36px;
}
.footer-col h4 {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dark-faint);
  margin-bottom: 14px;
}
.footer-col a,
.f-line {
  display: block;
  color: var(--dark-ink);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 5px 0;
  font-weight: 500;
}
.footer-col a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.footer-social {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.footer-social a {
  width: 40px;
  height: 40px;
  border: 1px solid var(--dark-line);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.footer-social a:hover {
  border-color: #fff;
  text-decoration: none;
}
.footer-social svg {
  width: 18px;
  height: 18px;
}
.footer-bottom {
  border-top: 1px solid var(--dark-line);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.76rem;
  color: var(--dark-faint);
}
@media (max-width: 640px) {
  .footer-cols {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============================ BOTTOM NAV (mobile) ============================ */

.bnav {
  display: none;
}
/* Sticky mobile add-to-cart bar (product page only) - sits just above
   the floating bottom-nav pill instead of replacing it, so quick nav
   stays reachable while shopping. Desktop never needs this: the real
   "Add to cart" button is already in the fold there. */
.pd-sticky-bar {
  display: none;
}
@media (max-width: 900px) {
  .pd-sticky-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 90px;
    z-index: 71;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    padding: 10px 12px 10px 16px;
  }
  .pd-sticky-bar[hidden] {
    display: none;
  }
  .psb-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.25;
  }
  .psb-info strong {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .psb-info span {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
  }
  .pd-sticky-bar .btn {
    flex: none;
  }
}
@media (max-width: 900px) {
  body {
    padding-bottom: 78px;
  }
  .bnav {
    display: flex;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 70;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
    padding: 8px;
  }
  .bnav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 4px;
    color: var(--faint);
    text-decoration: none;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--r-md);
    position: relative;
  }
  .bnav a svg {
    width: 22px;
    height: 22px;
  }
  .bnav a.is-active {
    color: var(--brand-deep);
    background: var(--brand-soft);
  }
  .bnav-badge {
    position: absolute;
    top: 2px;
    right: calc(50% - 24px);
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--coral);
    color: #fff;
    border-radius: var(--r-pill);
    font-size: 0.6rem;
    font-weight: 800;
  }
  .bnav-badge[hidden] {
    display: none;
  }
}

/* ============================ DRAWER EXTRAS ============================ */

/* Wishlist */
.wish-row {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.wish-row:last-child {
  border-bottom: none;
}
.wish-row img {
  width: 64px;
  height: 64px;
  flex: none;
  object-fit: cover;
  border-radius: var(--r-md);
  background: var(--bg-deep);
}
.wish-main {
  flex: 1;
  min-width: 0;
}
.wish-name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.4;
}
.wish-name a {
  text-decoration: none;
  color: inherit;
}
.wish-name a:hover {
  color: var(--brand-deep);
}
.wish-meta {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-deep);
  margin: 3px 0 8px;
}
.wish-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: none;
}

/* Quick view */
.qv-media {
  border-radius: var(--r-lg);
  background: var(--bg-deep);
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
}
.qv-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.qv-name {
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 6px 0 10px;
}
.qv-priceblock {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.qv-price {
  font-weight: 800;
  font-size: 1.8rem;
  letter-spacing: -0.02em;
  color: var(--brand-deep);
}
.qv-was {
  color: var(--faint);
  text-decoration: line-through;
  font-size: 0.95rem;
  font-weight: 600;
}
.qv-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 0;
  flex-wrap: wrap;
  align-items: stretch;
}
.qv-row .btn-primary {
  flex: 1;
  min-width: 140px;
}
.qv-specs {
  margin-top: 20px;
  border-top: 1px solid var(--line);
}
.qv-spec {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.qv-spec .k {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

/* Compare tray + table */
.cmp-tray {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 80;
  background: var(--dark);
  color: var(--dark-ink);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  transform: translateY(130%);
  transition: transform 260ms var(--ease);
}
.cmp-tray.open {
  transform: none;
}
.cmp-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
}
.cmp-label {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark-faint);
  flex: none;
}
.cmp-thumbs {
  display: flex;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}
.cmp-thumbs img {
  width: 44px;
  height: 44px;
  flex: none;
  object-fit: cover;
  border-radius: var(--r-sm);
}
.table-scroll-x {
  overflow-x: auto;
  border-radius: var(--r-lg);
}
.cmp-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
  background: var(--card);
}
.cmp-table th,
.cmp-table td {
  border: 1px solid var(--line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  font-size: 0.88rem;
}
.cmp-table thead th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  background: #faf9fe;
}
.cmp-table tbody th {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
  width: 110px;
}
.cmp-table a {
  color: inherit;
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
}
.cmp-table a:hover {
  color: var(--brand-deep);
}
.cmp-best {
  background: var(--green-soft);
  font-weight: 800;
}
@media (max-width: 900px) {
  .cmp-tray {
    bottom: 84px;
  }
}

/* barcode motif retired in v5 - hide any leftover hooks */
.barcode {
  display: none;
}

/* ==========================================================================
   v5.1 refinements - bug fixes + design polish.
   Appended last on purpose: same specificity as the rules above, wins by order.
   ========================================================================== */

/* ---- quality floor: keyboard focus + no fixed-bg jank on phones ---- */
:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: 6px;
}
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline-offset: 0;
}
@media (max-width: 760px) {
  body {
    background-attachment: scroll;
  }
}

/* ---- labels: sentence case, no tracked all-caps ---- */
.field > span,
.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.page-head h1 {
  margin-top: 0;
}
.page-head {
  padding: 34px 0 10px;
}

/* ---- product card: quiet body, actions live on the image ---- */
.shelf-tag {
  border-radius: 18px;
}
.tag-media {
  margin: 8px 8px 0;
  border-radius: 12px;
}
.tag-body {
  padding: 12px 14px 14px;
  gap: 4px;
}
.tag-aisle {
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--faint);
  order: -1;
}
.tag-name {
  font-size: 0.93rem;
  min-height: 2.8em;
}
.tag-pricerow {
  padding-top: 10px;
}
.tag-price {
  flex-wrap: wrap;
  row-gap: 4px;
}
.price-pill {
  border-width: 1.5px;
  padding: 7px 16px;
  font-size: 0.9rem;
}
.tag-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  margin: 0;
  gap: 6px;
}
.tag-actions .icon-btn {
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, 0.96);
  border: none;
  box-shadow: var(--shadow-sm);
}
.tag-actions .icon-btn svg {
  width: 16px;
  height: 16px;
}
.tag-actions .icon-btn.is-active {
  background: var(--brand);
  color: #fff;
}
@media (hover: hover) and (pointer: fine) {
  .tag-actions {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 160ms var(--ease), transform 160ms var(--ease);
  }
  .shelf-tag:hover .tag-actions,
  .shelf-tag:focus-within .tag-actions {
    opacity: 1;
    transform: none;
  }
}
.shelf-tag:hover {
  transform: translateY(-3px);
}

/* ---- phones: two-up catalog like every marketplace app ---- */
@media (max-width: 640px) {
  .shelf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .shelf-tag {
    border-radius: 16px;
  }
  .tag-media {
    margin: 6px 6px 0;
    aspect-ratio: 1 / 1;
  }
  .tag-body {
    padding: 10px 10px 12px;
  }
  .tag-name {
    font-size: 0.84rem;
    line-height: 1.35;
    min-height: 2.7em;
  }
  .price-pill {
    padding: 6px 12px;
    font-size: 0.82rem;
  }
  .tag-price .was {
    font-size: 0.72rem;
  }
  .tag-badge {
    top: 8px;
    left: 8px;
    padding: 3px 9px;
    font-size: 0.66rem;
  }
  .tag-wish {
    top: 6px;
    right: 6px;
    width: 32px;
    height: 32px;
  }
  .tag-actions .icon-btn {
    width: 30px;
    height: 30px;
  }
  .tag-stamp {
    font-size: 0.62rem;
    padding: 6px 12px;
  }
}

/* ---- product page ---- */
.crumbs {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  gap: 8px;
  padding: 20px 0 16px;
}
.crumbs > * + *::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
  font-weight: 400;
}
.crumbs span[aria-current] {
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 32ch;
}
.gal {
  padding: 10px;
}
.gal .noimg.big {
  min-height: 380px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--bg) 0%, var(--bg-deep) 100%);
}
.buy .tag-sku {
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
  font-weight: 600;
}
.spec-sheet {
  margin-top: 22px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: #fff;
}
.spec-sheet th,
.spec-sheet td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 0.9rem;
}
.spec-sheet tr:last-child th,
.spec-sheet tr:last-child td {
  border-bottom: 0;
}
.spec-sheet th {
  width: 120px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
}
.spec-sheet tbody tr:hover td {
  background: transparent;
}
.related .section-title,
.rail .section-title,
.rail-head .section-title {
  margin-bottom: 4px;
}
@media (max-width: 640px) {
  .buy-row {
    flex-wrap: wrap;
  }
  .buy-row .btn-primary,
  .buy-row .btn-coral {
    flex: 1 1 140px;
  }
}

/* ---- delivery timeline: the dot is a <span>, it must be a block to size ---- */
.route-dot {
  display: block;
  box-sizing: border-box;
}
.route {
  margin: 28px 0 34px;
}
.route-label {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 0 4px;
}
.route-stop.now .route-label {
  color: var(--coral-deep);
  font-weight: 800;
}
.track-result .section-title {
  margin: 8px 0 4px;
}

/* ---- track page: one column width for lookup + ticket, aligned with the heading ---- */
.lookup-panel {
  max-width: 720px;
  margin: 8px 0 0;
  padding: 18px;
}
.lookup-form {
  margin-top: 0;
}
.track-result .ticket {
  max-width: 720px;
  margin-left: 0;
}
.track-result {
  margin-top: 24px;
}
.ticket-code {
  margin: 4px 0 14px;
}
.ticket-stub {
  padding: 18px 32px;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
@media (max-width: 640px) {
  .lookup-form {
    flex-direction: column;
  }
  .lookup-form .btn {
    width: 100%;
  }
  .ticket-main,
  .ticket-body,
  .ticket-stub {
    padding-left: 18px;
    padding-right: 18px;
  }
  .cancelled-banner {
    margin-left: 18px;
    margin-right: 18px;
  }
}

/* ---- checkout: cart and details each read as one block ---- */
.co-card {
  background: var(--card);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px 22px 8px;
  margin-top: 20px;
}
.co-card .co-sec-title {
  margin-top: 0;
}
.co-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--faint);
  margin-left: 6px;
}
.co-sku {
  font-size: 0.78rem;
  color: var(--faint);
}
.co-thumb {
  overflow: hidden;
}
.co-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.co-thumb .noimg svg {
  width: 26px;
  height: 26px;
}
@media (max-width: 640px) {
  .co-card {
    padding: 18px 16px 4px;
  }
  .co-row {
    grid-template-columns: 60px minmax(0, 1fr);
  }
  .co-thumb {
    width: 60px;
    height: 60px;
  }
  .co-side {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ---- footer ---- */
.footer-word {
  font-size: clamp(4rem, 15vw, 11rem);
  line-height: 0.85;
}

/* ---- empty states in the catalog ---- */
#empty.empty {
  padding: 48px 20px;
}
#empty .btn {
  margin-top: 14px;
}

/* ---- mobile filter sheet: backdrop + close + sticky action; inert when closed ---- */
.filters-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.filters-close,
.filters-foot {
  display: none;
}
.filters-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(27, 22, 38, 0.5);
  animation: fade-in 200ms var(--ease);
}
@keyframes fade-in {
  from { opacity: 0; }
}
@media (max-width: 960px) {
  .filters {
    visibility: hidden;
    transition: transform 280ms var(--ease), visibility 0s linear 280ms;
    outline: none;
  }
  .filters.open {
    visibility: visible;
    transition: transform 280ms var(--ease);
  }
  .filters-close {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: var(--bg);
    color: var(--ink);
    cursor: pointer;
  }
  .filters-foot {
    display: block;
    position: sticky;
    bottom: -22px;
    margin: 18px -22px -22px;
    padding: 14px 22px calc(14px + env(safe-area-inset-bottom, 0px));
    background: var(--card);
    border-top: 1px solid var(--line);
  }
}

/* ---- phones: price rows align (was-price above the pill), bottom-nav room lives in the footer ---- */
@media (max-width: 640px) {
  .tag-price {
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
  }
  .tag-price .was {
    order: -1;
  }
}
@media (max-width: 900px) {
  body {
    padding-bottom: 0;
  }
  .site-footer {
    padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---- phones: get products above the fold ---- */
@media (max-width: 640px) {
  .promo-banner {
    padding: 18px 18px 20px;
    border-radius: 20px;
    gap: 12px;
  }
  .promo-title {
    font-size: 1.45rem;
    line-height: 1.15;
  }
  .promo-sub {
    font-size: 0.86rem;
    margin-top: 4px;
  }
  .promo-cta {
    padding: 10px 20px;
    font-size: 0.86rem;
  }
  .filters-mobile-bar .btn {
    padding: 9px 16px;
  }
}

/* ---- track page: JS resets #track-result's class, so select by id ---- */
#track-result {
  margin-top: 24px;
  padding-bottom: 70px;
}
#track-result .ticket {
  max-width: 720px;
  margin-left: 0;
}
#track-result .section-title {
  margin: 8px 0 4px;
  font-size: 1.15rem;
}
.stub-hint {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
}
.stub-hint strong {
  color: var(--ink);
  letter-spacing: 0.03em;
}

/* ==========================================================================
   Store assistant (js/assistant.js)
   ========================================================================== */
.as-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.as-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 52px;
  padding: 0 20px 0 16px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
  color: #fff;
  font: 700 0.92rem/1 var(--font-sans);
  box-shadow: 0 10px 28px rgba(88, 73, 214, 0.42);
  cursor: pointer;
  transition: transform 160ms var(--ease), box-shadow 160ms var(--ease);
}
.as-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(88, 73, 214, 0.5);
}
.as-open .as-fab {
  visibility: hidden;
}
.as-backdrop {
  display: none;
}
.as-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 97;
  width: 384px;
  max-width: calc(100vw - 24px);
  height: min(620px, calc(100dvh - 40px));
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(31, 28, 26, 0.26), 0 0 0 1px var(--line);
  overflow: hidden;
  animation: as-in 220ms var(--ease);
}
.as-panel[hidden] {
  display: none;
}
@keyframes as-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
}
.as-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--line);
}
.as-avatar {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--violet-soft);
  color: var(--violet-deep);
}
.as-avatar svg {
  width: 20px;
  height: 20px;
}
.as-head-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.as-head-text strong {
  font-size: 0.98rem;
}
.as-head-text span {
  font-size: 0.78rem;
  color: var(--faint);
}
.as-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
}
.as-icon:hover {
  background: var(--bg);
  color: var(--ink);
}
.as-list {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbfaff;
}
.as-msg {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 88%;
}
.as-assistant {
  align-self: flex-start;
}
.as-user {
  align-self: flex-end;
  align-items: flex-end;
}
.as-bubble {
  padding: 10px 14px;
  border-radius: 18px 18px 18px 6px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  text-align: start;
}
.as-user .as-bubble {
  border-radius: 18px 18px 6px 18px;
  background: var(--violet);
  border-color: var(--violet);
  color: #fff;
}
.as-error .as-bubble {
  background: var(--coral-soft);
  border-color: transparent;
  color: var(--coral-deep);
}
.as-bubble a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.as-typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 16px;
}
.as-typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  animation: as-dot 1.1s infinite ease-in-out;
}
.as-typing i:nth-child(2) {
  animation-delay: 0.16s;
}
.as-typing i:nth-child(3) {
  animation-delay: 0.32s;
}
@keyframes as-dot {
  0%,
  60%,
  100% {
    opacity: 0.3;
    transform: none;
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .as-typing i {
    animation: none;
    opacity: 0.6;
  }
  .as-panel {
    animation: none;
  }
  .as-fab {
    transition: none;
  }
}
.as-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 4px;
}
.as-chip {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--violet-deep);
  border-radius: 999px;
  padding: 8px 14px;
  font: 600 0.84rem/1 var(--font-sans);
  cursor: pointer;
}
.as-chip:hover {
  border-color: var(--violet);
  background: var(--violet-soft);
}

/* product cards inside the chat */
.as-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(300px, 100%);
}
.as-card {
  display: flex;
  gap: 11px;
  padding: 9px;
  border-radius: 14px;
  background: var(--card);
  border: 1px solid var(--line);
}
.as-card-img {
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.as-card-img img,
.as-card-img .noimg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.as-card-img .noimg svg {
  width: 22px;
  height: 22px;
}
.as-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.as-card-name {
  font-size: 0.84rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.as-card-price {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 0.86rem;
}
.as-card-price strong {
  color: var(--violet-deep);
}
.as-card-price s {
  color: var(--faint);
  font-size: 0.74rem;
}
.as-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 3px;
}
.as-btn-ghost,
.as-btn-add {
  flex: 1;
  text-align: center;
  border-radius: 999px;
  padding: 7px 10px;
  font: 700 0.76rem/1.1 var(--font-sans);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.as-btn-ghost {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
}
.as-btn-add {
  border: 0;
  background: var(--violet);
  color: #fff;
}
.as-btn-add.is-done {
  background: #2f9e44;
}
.as-btn-add:disabled {
  background: var(--bg-deep);
  color: var(--faint);
  cursor: not-allowed;
}

/* one-shot Yes/No for proposed actions (cancel order, update profile...) */
.as-confirm {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.as-btn-confirm,
.as-btn-decline {
  flex: 1;
  border-radius: 999px;
  padding: 9px 12px;
  font: 700 0.8rem/1.1 var(--font-sans);
  cursor: pointer;
  white-space: nowrap;
}
.as-btn-confirm {
  border: 0;
  background: var(--coral, #f04e23);
  color: #fff;
}
.as-btn-decline {
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
}

/* composer */
.as-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px 6px;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.as-form textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  min-height: 44px;
  height: 44px;
  max-height: 110px;
  box-sizing: border-box;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  font: 500 0.95rem/1.4 var(--font-sans);
}
.as-form textarea:focus {
  outline: none;
  border-color: var(--violet);
  box-shadow: 0 0 0 3px var(--violet-soft);
}
.as-send {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--violet);
  color: #fff;
  cursor: pointer;
}
.as-send:disabled {
  opacity: 0.5;
  cursor: progress;
}
.as-note {
  margin: 0;
  padding: 2px 16px 10px;
  font-size: 0.72rem;
  color: var(--faint);
  text-align: center;
  background: var(--card);
}

/* phones: FAB rides above the bottom nav; panel becomes a bottom sheet */
@media (max-width: 900px) {
  .as-fab {
    right: 14px;
    bottom: calc(98px + env(safe-area-inset-bottom, 0px));
    width: 54px;
    height: 54px;
    padding: 0;
    justify-content: center;
    transition: bottom 200ms var(--ease), transform 160ms var(--ease), box-shadow 160ms var(--ease);
  }
  .as-fab-label {
    display: none;
  }
  /* On the product page, once the sticky add-to-cart bar appears it
     occupies the same bottom-right corner the chat FAB normally rides
     in - push the FAB up above it instead of letting the two overlap. */
  body:has(#pd-sticky-bar:not([hidden])) .as-fab {
    bottom: calc(160px + env(safe-area-inset-bottom, 0px));
  }
}
@media (max-width: 640px) {
  .as-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 96;
    background: rgba(27, 22, 38, 0.5);
    animation: fade-in 200ms var(--ease);
  }
  .as-backdrop[hidden] {
    display: none;
  }
  .as-panel {
    right: 0;
    left: 0;
    bottom: 0;
    width: auto;
    max-width: none;
    height: min(88dvh, 720px);
    border-radius: 24px 24px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .as-open {
    overflow: hidden;
  }
  /* 16px stops iOS Safari from zooming the page when the field is focused */
  .as-form textarea {
    font-size: 16px;
  }
  .as-msg {
    max-width: 92%;
  }
}

/* toasts move to the top while the assistant sheet covers the bottom of the screen */
@media (max-width: 640px) {
  body.as-open .toasts {
    bottom: auto;
    top: calc(14px + env(safe-area-inset-top, 0px));
  }
}
