/* ============================================================================================
   Mapucraft UI — capa de pulido para la tienda (mapucraft.com)
   Inspirada en "Vertix" (Dashboard v14): entrada escalonada de tarjetas, radios suaves, numeros tabulares, estados claros.
   Solo CSS, se carga despues de theme-fixes.css y usa las variables del tema (--color-*, --cs-*).
   ============================================================================================ */
:root {
  --ui-ease: cubic-bezier(.22, 1, .36, 1);
  --ui-spring: cubic-bezier(.34, 1.56, .64, 1);
  --ui-glow: 0 18px 46px -22px rgb(from var(--color-primary) r g b / 0.65);
}

@keyframes uiCardIn { from { opacity: 0; transform: translateY(16px) scale(.985); } }
@keyframes uiRise { from { opacity: 0; transform: translateY(8px); filter: blur(4px); } }
@keyframes uiPop { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ---- Entrada escalonada ------------------------------------------------------------------------------------------------ */
.store-product, .cs-bun-card, .cs-transfer, .widget, .store-product-options {
  animation: uiCardIn .6s var(--ui-ease) both; animation-delay: calc(var(--ui-i, 0) * 50ms);
}
.store-products > :nth-child(1), .store-products-grid > :nth-child(1), .store-products-images > :nth-child(1), .cs-bun-grid > :nth-child(1) { --ui-i: 0; }
.store-products > :nth-child(2), .store-products-grid > :nth-child(2), .store-products-images > :nth-child(2), .cs-bun-grid > :nth-child(2) { --ui-i: 1; }
.store-products > :nth-child(3), .store-products-grid > :nth-child(3), .store-products-images > :nth-child(3), .cs-bun-grid > :nth-child(3) { --ui-i: 2; }
.store-products > :nth-child(4), .store-products-grid > :nth-child(4), .store-products-images > :nth-child(4), .cs-bun-grid > :nth-child(4) { --ui-i: 3; }
.store-products > :nth-child(5), .store-products-grid > :nth-child(5), .store-products-images > :nth-child(5), .cs-bun-grid > :nth-child(5) { --ui-i: 4; }
.store-products > :nth-child(n+6), .store-products-grid > :nth-child(n+6), .store-products-images > :nth-child(n+6), .cs-bun-grid > :nth-child(n+6) { --ui-i: 5; }
.popup .popup-content { animation: uiPop .45s var(--ui-ease) both; }
.product-title, .site-content h1, .site-content h2 { animation: uiRise .6s var(--ui-ease) both; }

/* ---- Tarjetas de producto: hover claro ---------------------------------------------------------------------------------- */
.store-products-grid .store-product, .store-products-images .store-product, .store-products-list .store-product {
  transition: transform .28s var(--ui-ease), border-color .28s var(--ui-ease), box-shadow .28s var(--ui-ease);
}
.store-products-grid .store-product:hover, .store-products-images .store-product:hover {
  transform: translateY(-4px); box-shadow: var(--ui-glow); border-color: rgb(from var(--color-primary) r g b / 0.55);
}
.store-product .image-link .image { transition: transform .35s var(--ui-ease); }
.store-product:hover .image-link .image { transform: scale(1.04); }
.cs-price-badge, .price, .cs-bun-price { font-variant-numeric: tabular-nums; }
.cs-price-badge { letter-spacing: -.01em; }

/* ---- Botones ------------------------------------------------------------------------------------------------------------ */
.btn-primary, .store-product .add, .store-product .actions a.add { transition: transform .2s var(--ui-spring), filter .15s, box-shadow .2s; }
.btn-primary:hover, .store-product .add:hover { transform: translateY(-2px); box-shadow: 0 12px 24px -14px rgb(from var(--color-primary) r g b / 0.9); }
.btn-primary:active, .store-product .add:active { transform: translateY(0) scale(.97); }
:focus-visible { outline: 2px solid var(--color-primary-hover); outline-offset: 3px; }
::selection { background: rgb(from var(--color-primary) r g b / 0.35); }

/* ---- Desplegable de opciones (color del pack, etc.) --------------------------------------------------------------------- */
.store-form-options select { border-radius: 14px; padding: 12px 14px; transition: border-color .2s, box-shadow .2s; }
.store-form-options select:focus { border-color: var(--color-primary); box-shadow: 0 0 0 4px rgb(from var(--color-primary) r g b / 0.2); }
.store-form-options .field > p { color: var(--color-text-darker); margin-bottom: 6px; }

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

/* ---- Portada: "¿Que estas buscando?" (categorias por prioridad de uso) ---------------------------------------------------- */
.cs-cats { margin: 4px 0 26px; }
.cs-cats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cs-cat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; text-decoration: none; color: var(--color-text);
  background: var(--color-brighter-bg); border: 1px solid rgb(from var(--color-primary) r g b / 0.16);
  transition: transform .25s var(--ui-ease), border-color .25s, box-shadow .25s, background .2s; animation: uiCardIn .55s var(--ui-ease) both; }
.cs-cat:nth-child(2) { animation-delay: 50ms; } .cs-cat:nth-child(3) { animation-delay: 100ms; } .cs-cat:nth-child(4) { animation-delay: 150ms; }
.cs-cat:nth-child(n+5) { animation-delay: 200ms; }
.cs-cat:hover { transform: translateY(-3px); border-color: rgb(from var(--color-primary) r g b / 0.6); box-shadow: var(--ui-glow); }
.cs-cat-ico { flex: none; display: grid; place-items: center; width: 46px; height: 46px; font-size: 24px; border-radius: 14px;
  background: rgb(from var(--color-primary) r g b / 0.14); border: 1px solid rgb(from var(--color-primary) r g b / 0.25); transition: transform .3s var(--ui-spring); }
.cs-cat:hover .cs-cat-ico { transform: scale(1.1) rotate(-4deg); }
.cs-cat-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cs-cat-txt b { font-size: 1rem; }
.cs-cat-txt small { color: var(--color-text-secondary); font-size: .78rem; line-height: 1.35; }
.cs-cat-go { color: var(--color-primary); font-weight: 800; transition: transform .2s; }
.cs-cat:hover .cs-cat-go { transform: translateX(4px); }
.cs-cat-top { background: linear-gradient(135deg, rgb(from var(--color-primary) r g b / 0.22), var(--color-brighter-bg) 70%); border-color: rgb(from var(--color-primary) r g b / 0.45); }
@media (min-width: 900px) { .cs-cat-top { grid-column: span 2; } }
@media (max-width: 520px) { .cs-cats-grid { grid-template-columns: 1fr; } }

/* ---- Tipografia autoalojada (sin Google Fonts) --------------------------------------------------------------------------- */
@font-face { font-family: "Sora"; font-weight: 400; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-400.ttf") format("truetype"); }
@font-face { font-family: "Sora"; font-weight: 500; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-400.ttf") format("truetype"); }
@font-face { font-family: "Sora"; font-weight: 600; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-600.ttf") format("truetype"); }
@font-face { font-family: "Sora"; font-weight: 700; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-700.ttf") format("truetype"); }
@font-face { font-family: "Sora"; font-weight: 800; font-style: normal; font-display: swap; src: url("/assets/fonts/sora-800.ttf") format("truetype"); }

/* ---- Accesibilidad: foco visible en toda la tienda (el tema base lo quitaba) ----------------------------------------------- */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--color-primary-hover); outline-offset: 3px; }
.pv-sr, .cs-sr-only-x { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (pointer: coarse) {
  .pv-sw { min-height: 44px; min-width: 44px; } .pv-btn { width: 44px; height: 44px; } .pv-modelos button { min-height: 44px; }
  .btn-primary, .cs-menu-parent, .site-navigation a { min-height: 44px; }
}
.cs-field-help { font-size: .82rem; line-height: 1.5; color: var(--color-text-secondary); margin: 8px 0 14px; }
.cs-field-help code { padding: 1px 6px; border-radius: 6px; background: rgb(255 255 255 / .09); }
.cs-entrega { margin: 14px 0; padding: 12px 14px; border-radius: 14px; font-size: .85rem; line-height: 1.5; background: rgb(from var(--color-primary) r g b / 0.08); border: 1px solid rgb(from var(--color-primary) r g b / 0.22); color: var(--color-text-darker); }
.cs-entrega b { color: var(--color-text); }

/* Carrito: el color elegido se ve de un vistazo */
.cs-opt-color { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.cs-opt-color i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgb(255 255 255 / .45); display: inline-block; }
.cs-opt-color small { flex-basis: 100%; color: var(--color-text-secondary); font-size: .74rem; }
