/* ==========================================================================
   VEDMATRIX — Virtual Education Matrix
   Design tokens, base layer and shared component classes.
   Tailwind (Play CDN) handles layout/spacing/typography utilities; this file
   owns the brand primitives that utilities cannot express on their own.
   ========================================================================== */

:root {
  /* Brand ramp */
  --brand-50: #f4f1fd;
  --brand-100: #eae4f9;
  --brand-200: #d6caf4;
  --brand-300: #b6a4ea;
  --brand-400: #8f77da;
  --brand-500: #6e4cc4;
  --brand-600: #573aa8;
  --brand-700: #472e88;
  --brand-800: #38256b;
  --brand-900: #2a1c4d;

  --iris-400: #8291f5;
  --iris-500: #5f6fe8;
  --iris-600: #4a56d0;

  /* Neutrals */
  --ink: #14121c;
  --ink-soft: #413c50;
  --ink-muted: #6e6880;
  --ink-faint: #9a94ab;
  --line: #e8e4f0;
  --line-soft: #f1eef7;
  --canvas: #fbfafd;
  --surface: #ffffff;

  /* Signals */
  --star: #f5a524;
  --success: #0e7a5f;
  --success-soft: #e4f5ee;
  --warn: #b4690e;
  --warn-soft: #fdf2e0;
  --danger: #c2413b;
  --danger-soft: #fcedec;

  /* Shape + depth */
  --r-card: 1.25rem;
  --r-pill: 999px;
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-soft: 0 1px 2px rgba(20, 18, 28, 0.04), 0 10px 30px -18px rgba(42, 28, 77, 0.22);
  --shadow-lift: 0 2px 6px rgba(20, 18, 28, 0.05), 0 22px 48px -22px rgba(42, 28, 77, 0.3);
  --shadow-glow: 0 20px 60px -24px rgba(87, 58, 168, 0.55);

  --header-h: 4.5rem;
  --tint-a: rgba(87, 58, 168, 0.07);
  --tint-b: rgba(95, 111, 232, 0.07);
}

/* --------------------------------------------------------------- base --- */

* {
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1.5rem);
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-feature-settings: "cv02", "cv03", "cv04", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "Plus Jakarta Sans", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection {
  background: var(--brand-200);
  color: var(--brand-900);
}

[hidden] {
  display: none !important;
}

/* Hide number input spinners (quantity field) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ------------------------------------------------------------- scrollbar - */

.vm-scroll-x {
  scrollbar-width: thin;
  scrollbar-color: var(--brand-200) transparent;
}

.vm-scroll-x::-webkit-scrollbar {
  height: 6px;
}

.vm-scroll-x::-webkit-scrollbar-thumb {
  background: var(--brand-200);
  border-radius: var(--r-pill);
}

.vm-scroll-x::-webkit-scrollbar-track {
  background: transparent;
}

/* -------------------------------------------------------------- surfaces - */

/* Tighten the header row on narrow phones so three icon buttons plus the
   wordmark still fit inside 320px without horizontal overflow. */
@media (max-width: 399px) {
  .vm-header-row {
    gap: 0.375rem;
  }

  .vm-header-row .vm-icon-btn {
    width: 2.5rem;
    height: 2.5rem;
  }
}

.vm-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}

.vm-hairline {
  border-bottom: 1px solid var(--line);
}

/* Decorative background washes.
   IMPORTANT: these must be applied to a CHILD element inside a section that
   establishes a stacking context (e.g. `relative isolate`). Putting them on the
   section itself would give the whole section z-index:-1 and push its content
   behind the page background. */
.vm-wash,
.vm-grid-texture {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.vm-wash::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60rem 30rem at 12% -10%, var(--tint-a), transparent 60%),
    radial-gradient(45rem 26rem at 92% 8%, var(--tint-b), transparent 62%);
}

.vm-grid-texture {
  background-image:
    linear-gradient(to right, rgba(87, 58, 168, 0.055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(87, 58, 168, 0.055) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 78%);
  mask-image: radial-gradient(70% 60% at 50% 0%, #000 20%, transparent 78%);
}

/* Gradient headline text */
.vm-gradient-text {
  background: linear-gradient(104deg, var(--brand-700) 0%, var(--brand-500) 42%, var(--iris-500) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.vm-gradient-cta {
  background-image: linear-gradient(112deg, var(--brand-600) 0%, var(--brand-500) 46%, var(--iris-500) 100%);
}

/* ---------------------------------------------------------------- eyebrow - */

.vm-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-600);
}

.vm-eyebrow::before {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.vm-eyebrow-center::after {
  content: "";
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

/* ---------------------------------------------------------------- buttons - */

.vm-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 3rem;
  padding: 0 1.5rem;
  border-radius: var(--r-pill);
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition:
    transform 0.25s var(--spring),
    box-shadow 0.25s var(--spring),
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.vm-btn:active {
  transform: translateY(1px) scale(0.99);
}

.vm-btn:disabled,
.vm-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}

.vm-btn-primary {
  color: #fff;
  background-image: linear-gradient(112deg, var(--brand-600) 0%, var(--brand-500) 46%, var(--iris-500) 100%);
  box-shadow: 0 10px 26px -12px rgba(87, 58, 168, 0.7);
}

.vm-btn-primary:hover:not(:disabled) {
  box-shadow: 0 16px 34px -14px rgba(87, 58, 168, 0.8);
  transform: translateY(-1px);
}

.vm-btn-secondary {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}

.vm-btn-secondary:hover:not(:disabled) {
  border-color: var(--brand-200);
  color: var(--brand-700);
  transform: translateY(-1px);
}

.vm-btn-ghost {
  color: var(--brand-700);
  background: transparent;
  border: 1px solid transparent;
  min-height: 2.75rem;
  padding: 0 1rem;
}

.vm-btn-ghost:hover:not(:disabled) {
  background: var(--brand-50);
}

.vm-btn-on-dark {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
}

.vm-btn-on-dark:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.vm-btn-sm {
  min-height: 2.5rem;
  padding: 0 1.125rem;
  font-size: 0.875rem;
}

.vm-btn-lg {
  min-height: 3.5rem;
  padding: 0 2rem;
  font-size: 1rem;
}

.vm-btn-block {
  width: 100%;
}

/* Square icon button (wishlist, close, steppers) */
.vm-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: none;
  border-radius: var(--r-pill);
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.25s var(--spring);
}

.vm-icon-btn:hover {
  color: var(--brand-600);
  border-color: var(--brand-200);
  transform: translateY(-1px);
}

.vm-icon-btn-sm {
  width: 2.125rem;
  height: 2.125rem;
}

/* ------------------------------------------------------------------ chips - */

.vm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  height: 2.125rem;
  padding: 0 0.875rem;
  border-radius: var(--r-pill);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: all 0.2s ease;
}

.vm-chip:hover {
  border-color: var(--brand-300);
  color: var(--brand-700);
}

.vm-chip[aria-pressed="true"],
.vm-chip.is-active {
  color: #fff;
  background: var(--brand-600);
  border-color: var(--brand-600);
}

.vm-chip-remove {
  height: 2rem;
  padding: 0 0.625rem;
  background: var(--brand-50);
  border-color: var(--brand-100);
  color: var(--brand-700);
}

.vm-chip-remove:hover {
  background: var(--brand-100);
}

/* ----------------------------------------------------------------- forms -- */

.vm-label {
  display: block;
  margin-bottom: 0.4375rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.vm-input,
.vm-select,
.vm-textarea {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.875rem;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.vm-textarea {
  min-height: 7rem;
  padding-top: 0.8125rem;
  resize: vertical;
}

.vm-input::placeholder,
.vm-textarea::placeholder {
  color: var(--ink-faint);
}

.vm-input:hover,
.vm-select:hover,
.vm-textarea:hover {
  border-color: var(--brand-200);
}

.vm-input:focus,
.vm-select:focus,
.vm-textarea:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-50);
}

.vm-input[aria-invalid="true"],
.vm-select[aria-invalid="true"] {
  border-color: var(--danger);
}

.vm-input[aria-invalid="true"]:focus,
.vm-select[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 4px var(--danger-soft);
}

.vm-select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236e6880' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
  cursor: pointer;
}

/* Custom checkbox / radio */
.vm-check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
}

.vm-check input {
  appearance: none;
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  border: 1.5px solid var(--line);
  border-radius: 0.375rem;
  background: var(--surface);
  cursor: pointer;
  transition: all 0.18s var(--spring);
}

.vm-check input[type="radio"] {
  border-radius: var(--r-pill);
}

.vm-check:hover input {
  border-color: var(--brand-300);
}

.vm-check input:checked {
  background-color: var(--brand-600);
  border-color: var(--brand-600);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.vm-check input[type="radio"]:checked {
  background-image: none;
  box-shadow: inset 0 0 0 3.5px var(--surface);
}

.vm-check input:focus-visible {
  outline: 2px solid var(--brand-500);
  outline-offset: 2px;
}

.vm-field-error {
  display: none;
  margin-top: 0.375rem;
  font-size: 0.8125rem;
  color: var(--danger);
}

.vm-field-error.is-shown {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* --------------------------------------------------------------- product -- */

.vm-cover {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: 0.875rem;
  background: var(--brand-50);
}

.vm-cover > svg,
.vm-cover > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.vm-card:hover .vm-cover > svg,
.vm-card:hover .vm-cover > img {
  transform: scale(1.055);
}

.vm-cover > svg,
.vm-cover > img {
  transition: transform 0.6s var(--spring);
}

.vm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-soft);
  transition:
    transform 0.4s var(--spring),
    box-shadow 0.4s var(--spring),
    border-color 0.4s ease;
}

.vm-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-200);
  box-shadow: var(--shadow-lift);
}

.vm-card:focus-within {
  border-color: var(--brand-300);
}

/* Actions slide up on hover for pointer devices */
@media (hover: hover) and (min-width: 768px) {
  .vm-card-actions {
    opacity: 0;
    transform: translateY(10px);
    transition:
      opacity 0.35s var(--spring),
      transform 0.35s var(--spring);
  }

  .vm-card:hover .vm-card-actions,
  .vm-card:focus-within .vm-card-actions {
    opacity: 1;
    transform: none;
  }
}

/* The CTA row ("Add to Cart" + "Details") needs ~238px of inner width. When
   the card itself gets narrower than that, stack the buttons full-width so
   neither of them overflows or gets clipped by the card edge. */
@container (max-width: 18rem) {
  .vm-card .vm-card-actions {
    grid-template-columns: minmax(0, 1fr);
  }
}

.vm-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: 1.5rem;
  padding: 0 0.5rem;
  border-radius: var(--r-pill);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.vm-badge-bestseller {
  color: var(--brand-800);
  background: var(--brand-100);
}

.vm-badge-new {
  color: var(--iris-600);
  background: #e8eafd;
}

.vm-badge-off {
  color: var(--danger);
  background: var(--danger-soft);
}

.vm-badge-soft {
  color: var(--ink-soft);
  background: var(--line-soft);
  border: 1px solid var(--line);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  height: 1.75rem;
  padding: 0 0.625rem;
}

.vm-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vm-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------- overlay -- */

.vm-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(20, 18, 28, 0.5);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.3s ease,
    visibility 0.3s ease;
}

.vm-scrim.is-open {
  opacity: 1;
  visibility: visible;
}

.vm-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(26rem, 100vw);
  height: 100dvh;
  background: var(--surface);
  box-shadow: -20px 0 60px -20px rgba(20, 18, 28, 0.3);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.36s var(--spring),
    visibility 0.36s ease;
}

.vm-drawer.is-open {
  transform: none;
  visibility: visible;
}

.vm-drawer-left {
  right: auto;
  left: 0;
  transform: translateX(-100%);
  box-shadow: 20px 0 60px -20px rgba(20, 18, 28, 0.3);
}

.vm-drawer-left.is-open {
  transform: none;
}

body.vm-locked {
  overflow: hidden;
}

/* ----------------------------------------------------------------- toast -- */

.vm-toasts {
  position: fixed;
  z-index: 120;
  right: 1rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.vm-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  box-shadow: var(--shadow-lift);
  pointer-events: auto;
  animation: toast-in 0.32s var(--spring) both;
}

.vm-toast.is-leaving {
  animation: toast-out 0.24s ease forwards;
}

.vm-toast-dot {
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-top: 0.4rem;
  border-radius: var(--r-pill);
  background: var(--brand-500);
}

.vm-toast-success .vm-toast-dot {
  background: var(--success);
}

.vm-toast-error .vm-toast-dot {
  background: var(--danger);
}

.vm-toast-info .vm-toast-dot {
  background: var(--iris-500);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

/* ------------------------------------------------------------- accordion -- */

.vm-accordion-item {
  border-bottom: 1px solid var(--line);
}

.vm-accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1.25rem 0;
  text-align: left;
  font-family: "Plus Jakarta Sans", Inter, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.2s ease;
}

.vm-accordion-trigger:hover {
  color: var(--brand-600);
}

.vm-accordion-trigger svg {
  flex: none;
  transition: transform 0.32s var(--spring);
}

.vm-accordion-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.vm-accordion-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.34s var(--spring);
}

.vm-accordion-panel.is-open {
  grid-template-rows: 1fr;
}

.vm-accordion-panel > div {
  overflow: hidden;
}

.vm-accordion-panel p {
  padding-bottom: 1.25rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------------ misc -- */

.vm-skeleton {
  position: relative;
  overflow: hidden;
  background: var(--line-soft);
  border-radius: 0.75rem;
}

.vm-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

.vm-divider {
  height: 1px;
  background: var(--line);
}

/* Scroll-driven reveal */
[data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.7s var(--spring),
    transform 0.7s var(--spring);
  transition-delay: var(--reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.vm-reduced [data-reveal] {
  opacity: 1;
  transform: none;
}

.vm-float {
  animation: float 7s ease-in-out infinite;
}

.vm-float-slow {
  animation: float 9s ease-in-out infinite;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-12px);
  }
}

.vm-marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 34s linear infinite;
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

.vm-marquee:hover .vm-marquee-track {
  animation-play-state: paused;
}

.vm-pulse-ring {
  animation: pulse-ring 0.6s var(--spring);
}

@keyframes pulse-ring {
  0% {
    box-shadow: 0 0 0 0 rgba(87, 58, 168, 0.45);
  }
  100% {
    box-shadow: 0 0 0 14px rgba(87, 58, 168, 0);
  }
}

/* ----------------------------------------------------- product grid ----- */
/* Column counts are set in CSS rather than arbitrary Tailwind variants so the
   breakpoints behave predictably across the full 320px -> 1920px range. */

.vm-grid-products {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

@media (min-width: 340px) {
  .vm-grid-products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
  }
}

@media (min-width: 640px) {
  .vm-grid-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .vm-grid-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
  }
}

@media (min-width: 1536px) {
  .vm-grid-products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Horizontal snap rail (bestsellers, category rail) */
.vm-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 1fr);
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 0.5rem;
}

.vm-rail > * {
  scroll-snap-align: start;
}

@media (min-width: 640px) {
  .vm-rail {
    grid-auto-columns: minmax(17rem, 1fr);
  }
}

@media (min-width: 1024px) {
  .vm-rail {
    grid-auto-columns: minmax(19rem, 1fr);
  }
}

/* A11y helper */
.vm-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.vm-skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 200;
  padding: 0.75rem 1.25rem;
  background: var(--brand-600);
  color: #fff;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  transform: translateY(-200%);
  transition: transform 0.2s var(--spring);
}

.vm-skip-link:focus {
  transform: none;
}

/* Sticky mobile action bar */
.vm-sticky-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform 0.35s var(--spring);
}

.vm-sticky-bar.is-visible {
  transform: none;
}

/* Reserve room so the fixed action bar never covers the end of the content. */
body.vm-has-sticky-bar main {
  padding-bottom: 6rem;
}

@media (min-width: 1024px) {
  body.vm-has-sticky-bar main {
    padding-bottom: 2rem;
  }
}

/* Off-canvas panel: hidden off-screen by default on every breakpoint.
   Used for the mobile search overlay. */
.vm-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(23rem, 100vw);
  background: var(--surface);
  transform: translateX(100%);
  visibility: hidden;
  transition:
    transform 0.36s var(--spring),
    visibility 0.36s ease;
}

.vm-offcanvas.is-open {
  transform: none;
  visibility: visible;
}

/* The store filter rail: a slide-in drawer on mobile, an inline sidebar on
   desktop. Deliberately separate from .vm-offcanvas so the search overlay is
   never pulled back into the document flow. */
.vm-filter-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: min(20rem, 86vw);
  background: var(--surface);
  transform: translateX(100%);
  visibility: hidden;
  box-shadow: -20px 0 60px -20px rgba(20, 18, 28, 0.3);
  transition:
    transform 0.36s var(--spring),
    visibility 0.36s ease;
}

.vm-filter-panel.is-open {
  transform: none;
  visibility: visible;
}

@media (min-width: 1024px) {
  .vm-filter-panel {
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    right: auto;
    bottom: auto;
    z-index: 0;
    display: block;
    width: auto;
    max-height: calc(100dvh - var(--header-h) - 4rem);
    overflow-y: auto;
    transform: none;
    visibility: visible;
    box-shadow: none;
    border: 0;
    background: none;
  }
}

/* ------------------------------------------------------- reduced motion -- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ----------------------------------------------------------------- print -- */

@media print {
  .vm-no-print {
    display: none !important;
  }
}
