:root {
  --color-primary: #1e293b;
  --color-secondary: #4f46e5;
  --color-on-primary: #ffffff;
  --color-background: #ffffff;
  --color-foreground: #0f172a;
  --color-muted: #64748b;
  --color-border: #e2e8f0;
  --color-surface: #f8fafc;
  --color-header-bg: #ffffff;
  --color-footer-bg: #0f172a;
  --font-heading: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-base-scale: 100%;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --border-radius: 0.5rem;
  --border-radius-sm: 0.25rem;
  --border-radius-lg: 0.75rem;
  --page-width: 120rem;
  --page-width-narrow: 62rem;
  --duration-fast: 0.15s;
  --duration-base: 0.3s;
  --ease-out: cubic-bezier(0.33, 1, 0.68, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: var(--font-base-scale);
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-foreground);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

main {
  flex: 1;
  min-height: 80vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0 0 0.5em;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-foreground);
  overflow-wrap: break-word;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
}
h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}
h3 {
  font-size: 1.35rem;
}
h4 {
  font-size: 1.15rem;
}
h5 {
  font-size: 1rem;
}
h6 {
  font-size: 0.875rem;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

a:hover {
  color: var(--color-secondary);
}

img,
svg,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

ul,
ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background-color: rgba(30, 41, 59, 0.15);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.vs-container,
.page-width {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: 1.5rem;
}

/*
  (Dawn parity) Modo drawer-menu / menú off-canvas: el contenedor pierde el
  max-width y usa todo el viewport. Aplica cuando el header anda en modo drawer.
*/
.page-width.drawer-menu {
  max-width: 100%;
}

/*
  (Dawn parity) page-width-desktop: sin ancho limitado hasta 990px (mobile y
  tablet usan ancho completo con padding propio), y recién en desktop toma el
  --page-width. Útil en secciones tipo slider/carousel que en mobile rompen el
  contenedor para "sangrar" a los bordes.
*/
.page-width-desktop {
  padding: 0;
  margin: 0 auto;
}

@media (min-width: 750px) {
  .vs-container,
  .page-width {
    padding-inline: 2rem;
  }

  .page-width-desktop {
    padding: 0;
  }
}

@media (min-width: 990px) {
  .page-width-desktop {
    max-width: var(--page-width);
    padding-inline: 5rem;
  }
}

.vs-container--narrow,
.page-width--narrow {
  max-width: var(--page-width-narrow);
}

.vs-visually-hidden,
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Enlace para saltar al contenido (teclado y lectores de pantalla) */
.skip-to-content-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--color-button, #1e293b);
  color: var(--color-button-text, #ffffff);
  border-radius: 0.5rem;
  text-decoration: none;
}
.skip-to-content-link:focus {
  top: 1rem;
}

.vs-hidden,
.hidden {
  display: none !important;
}

.vs-list-unstyled,
.list-unstyled {
  margin: 0;
  padding: 0;
  list-style: none;
}

.vs-text-left,
.text-left {
  text-align: left;
}
.vs-text-center,
.text-center {
  text-align: center;
}
.vs-text-right,
.text-right {
  text-align: right;
}

.vs-flex {
  display: flex;
}
.vs-flex-col {
  flex-direction: column;
}
.vs-items-center {
  align-items: center;
}
.vs-items-start {
  align-items: flex-start;
}
.vs-justify-center {
  justify-content: center;
}
.vs-justify-between {
  justify-content: space-between;
}
.vs-gap-2 {
  gap: var(--space-2);
}
.vs-gap-4 {
  gap: var(--space-4);
}
.vs-gap-6 {
  gap: var(--space-6);
}
.vs-flex-1 {
  flex: 1 1 0%;
}

/* ============================================================
   Loading spinner (snippets/loading-spinner.liquid)
   ============================================================ */
.loading__spinner {
  position: absolute;
  z-index: 1;
  width: 1.8rem;
  display: inline-block;
}

.spinner {
  animation: rotator 1.4s linear infinite;
  width: 100%;
  max-width: none;
}

@keyframes rotator {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(270deg);
  }
}

.path {
  stroke-dasharray: 280;
  stroke-dashoffset: 0;
  transform-origin: center;
  stroke: var(--color-foreground);
  animation: dash 1.4s ease-in-out infinite;
}

@keyframes dash {
  0% {
    stroke-dashoffset: 280;
  }
  50% {
    stroke-dashoffset: 75;
    transform: rotate(135deg);
  }
  100% {
    stroke-dashoffset: 280;
    transform: rotate(450deg);
  }
}

/* Ocultar el contenido hermano mientras el spinner está activo
   (los contenedores sobre los que se posiciona el spinner) */
.loading__spinner:not(.hidden) ~ * {
  visibility: hidden;
}

@media (forced-colors: active) {
  .path {
    stroke: CanvasText;
  }
}

/* ============================================================
   Iconos del tema.
   Los SVG y snippets de icono traen class="icon icon-{nombre}".
   Dimensionado por contexto: envuelvelos en .svg-wrapper o crea
   reglas por componente (.mi-componente .icon { width: ... }).
   El color lo heredan via currentColor.
   ============================================================ */
.svg-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
}
.svg-wrapper > svg {
  width: 100%;
  height: 100%;
}
/* ─── Índice de Categorías (/collections) ─── */
.collections-index {
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 2rem 1rem;
}
.collections-index__title {
  font-size: 1.75rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 1.5rem;
  letter-spacing: -0.01em;
}
.collections-index__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}
.collections-index__card {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border-radius: 0.75rem;
  overflow: hidden;
  text-decoration: none;
  background: #e2e8f0;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}
.collections-index__card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}
.collections-index__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.collections-index__img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-weight: 700;
}
.collections-index__name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2.25rem 1rem 0.75rem;
  text-align: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.6), transparent);
}
.collections-index__empty {
  color: #64748b;
  font-weight: 600;
}

/*
  (Dawn parity) Espaciado entre secciones del contenido (--spacing-sections):
  replica la regla `.section + .section` de Dawn apuntando a los wrappers que
  el motor VELSE genera (`id^="velsefy-section-"`) dentro de <main>. El setting
  global "Espaciado entre secciones" (grupo Página) alimenta las variables
  --spacing-sections-desktop / --spacing-sections-mobile definidas en theme.liquid.
*/
#MainContent [id^="velsefy-section-"] + [id^="velsefy-section-"] {
  margin-top: var(--spacing-sections-mobile);
}

@media screen and (min-width: 750px) {
  #MainContent [id^="velsefy-section-"] + [id^="velsefy-section-"] {
    margin-top: var(--spacing-sections-desktop);
  }
}
