/* Tienda: catálogo, ficha, carrito y piezas compartidas (enlace del carrito, aviso) */

/* Enlace del carrito en la cabecera */
.nav__cart { position: relative; display: grid; place-items: center; width: 44px; height: 44px; color: var(--ink); text-decoration: none; transition: color .2s ease, transform .16s var(--ease-out); }
.nav__cart:hover { color: var(--cyan-hi); }
.nav__cart:active { transform: scale(.94); }
.nav__cart-n { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; background: var(--cyan); color: var(--cyan-ink); font: 600 .6875rem/1 var(--text); border-radius: 9px; font-variant-numeric: tabular-nums; }
.nav__cart-n.bump { animation: bump .45s var(--ease-out); }
@keyframes bump { 30% { transform: scale(1.35); } }
@media (max-width: 1024px) { .nav__cart { margin-left: auto; } .nav .status + .nav__cart { margin-left: 8px; } }

/* Aviso al añadir */
.toast { position: fixed; z-index: 40; left: 50%; bottom: 110px; display: flex; gap: 18px; align-items: center; padding: 14px 18px; background: var(--ink); color: var(--bg); font-size: .9375rem; box-shadow: 0 20px 40px -20px rgba(0, 0, 0, .8); opacity: 0; transform: translate(-50%, 16px); transition: opacity .2s ease, transform .2s var(--ease-out); pointer-events: none; }
.toast.is-in { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; transition-duration: .35s; }
.toast a { color: var(--bg); font-weight: 600; text-underline-offset: .25em; white-space: nowrap; }
@media (max-width: 700px) { .toast { left: 12px; right: 12px; bottom: 84px; transform: translateY(16px); justify-content: space-between; } .toast.is-in { transform: none; } }

/* Páginas de tienda */
.shop-page { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='84' height='145.5' viewBox='0 0 84 145.5'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.5'%3E%3Cpath d='M42 0l42 24.25v48.5L42 97 0 72.75v-48.5z'/%3E%3Cpath d='M42 97v48.5'/%3E%3C/g%3E%3C/svg%3E"); background-attachment: fixed; }
.shop { position: relative; z-index: 1; min-height: 100svh; padding: 120px var(--m) 120px; display: grid; gap: 56px; align-content: start; max-width: 1240px; margin: 0 auto; }
.shop__head { display: grid; gap: 18px; }
.shop__head h1 { font-size: var(--s-xl); }
.shop__head--small h1 { font-size: var(--s-l); }
.shop__head > p { font-size: 1.25rem; color: var(--steel); max-width: 44ch; }
.perks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 28px; color: var(--steel); font-size: .9375rem; }
.perks li { display: flex; align-items: center; gap: 10px; }
.perks li::before { content: ""; width: 10px; height: 10px; background: var(--cyan); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }
.demo-note { text-align: center; font-size: .8125rem; color: var(--muted); }
.shop-page .foot { background: var(--surface); color: var(--ink); }

/* El producto sobre un foco de luz, como en un escaparate */
.product__img, .pdp__img, .cart-line__img, .shop-teaser__img {
  display: grid; place-items: center; background-color: #191b1f;
  background-image: radial-gradient(60% 55% at 50% 42%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 70%);
}
.product__img img, .pdp__img img, .cart-line__img img, .shop-teaser__img img { width: auto; height: 84%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 24px 24px rgba(0, 0, 0, .55)); transition: transform .6s var(--ease-out); }

/* Catálogo */
.catalog { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 40px 28px; }
.product { display: grid; gap: 18px; align-content: start; }
.product__img { aspect-ratio: 4 / 5; overflow: hidden; }
.product__img:hover img { transform: translateY(-6px) scale(1.03); }
.product__info { display: grid; gap: 8px; justify-items: start; }
.product__cat { font-size: .875rem; color: var(--muted); }
.product__name { font-size: var(--s-m); }
.product__name a { text-decoration: none; }
.product__tag { color: var(--steel); }
.product__price { display: flex; align-items: baseline; gap: 12px; margin-top: 4px; }
.price { font: 400 1.75rem/1 var(--display); font-variant-numeric: tabular-nums; }
.price-old { color: var(--muted); font-size: 1rem; }
.product__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 10px; }
/* Con un solo producto, ficha grande en dos columnas en lugar de una rejilla casi vacía */
.catalog.is-single { grid-template-columns: 1fr; }
.catalog.is-single .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.catalog.is-single .product__img { aspect-ratio: 1 / 1; }
.catalog.is-single .product__name { font-size: var(--s-l); }
.btn.is-added { background: var(--ink); color: var(--bg); }

/* Ficha de producto */
.back { justify-self: start; font-size: .9375rem; }
.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 64px; align-items: start; }
.pdp__img { aspect-ratio: 1 / 1; position: sticky; top: 96px; }
.pdp__info { display: grid; gap: 18px; }
.pdp__name { font-size: var(--s-l); }
.pdp__tag { font-size: 1.25rem; color: var(--steel); }
.pdp__price { flex-wrap: wrap; }
.pdp__price .price { font-size: 2.5rem; }
.pdp__price small { color: var(--muted); font-size: .875rem; }
.pdp__buy { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.qty { display: inline-flex; align-items: stretch; background: var(--surface); }
.qty button { width: 48px; border: 0; background: transparent; color: var(--ink); font: 400 1.25rem/1 var(--text); cursor: pointer; transition: background-color .2s ease; }
.qty button:hover { background: var(--surface-2); }
.qty output { min-width: 40px; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.qty--sm button { width: 38px; }
.pdp .perks { flex-direction: column; margin-top: 6px; }
.pdp__more { display: grid; margin-top: 12px; border-top: 1px solid #23262b; }
.pdp__more details { border-bottom: 1px solid #23262b; }
.pdp__more summary { cursor: pointer; padding: 18px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.pdp__more summary::-webkit-details-marker { display: none; }
.pdp__more summary::after { content: "+"; color: var(--cyan); font-size: 1.25rem; line-height: 1; transition: transform .25s var(--ease-out); }
.pdp__more details[open] summary::after { transform: rotate(45deg); }
.pdp__more p { padding: 0 0 18px; color: var(--steel); max-width: 60ch; }

/* Carrito */
.cart { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: 48px; align-items: start; }
.cart-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.cart-line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; grid-template-rows: auto auto; gap: 6px 20px; align-items: center; padding: 14px; background: var(--surface); }
.cart-line__img { grid-row: 1 / 3; width: 96px; height: 96px; }
.cart-line__info { display: grid; gap: 4px; min-width: 0; }
.cart-line__info a { font-weight: 500; text-decoration: none; }
.cart-line__info span { color: var(--muted); font-size: .875rem; }
.cart-line__total { font: 400 1.25rem/1 var(--display); font-variant-numeric: tabular-nums; text-align: right; }
.cart-line__remove { grid-column: 2; justify-self: start; border: 0; background: none; padding: 0; color: var(--muted); font: 400 .875rem var(--text); text-decoration: underline; text-underline-offset: .25em; cursor: pointer; }
.cart-line__remove:hover { color: var(--ink); }
.cart-sum { display: grid; gap: 18px; padding: 28px; background: var(--surface); position: sticky; top: 96px; }
.cart-sum h2 { font-size: var(--s-m); }
.delivery { border: 0; margin: 0; padding: 0; display: grid; gap: 8px; }
.delivery legend { font-size: .875rem; color: var(--muted); margin-bottom: 8px; padding: 0; }
.delivery__opt { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px; background: var(--surface-2); cursor: pointer; }
.delivery__opt input { accent-color: var(--cyan); }
.delivery__opt span { display: grid; gap: 2px; }
.delivery__opt small { color: var(--muted); font-size: .8125rem; }
.delivery__opt em { font-style: normal; color: var(--cyan); font-weight: 600; }
.delivery__opt.is-off { opacity: .45; cursor: not-allowed; }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-variant-numeric: tabular-nums; }
.totals dt { color: var(--steel); }
.totals dd { margin: 0; text-align: right; }
.totals .totals__grand { color: var(--ink); font: 400 1.5rem/1.2 var(--display); padding-top: 10px; }
.totals__note { color: var(--muted); font-size: .8125rem; margin-top: -10px; text-align: right; }
.btn--wide { width: 100%; }
.demo-msg { font-size: .875rem; color: var(--steel); background: var(--surface-2); padding: 14px; }
.cart-empty { display: grid; gap: 20px; justify-items: start; padding: 40px 0; color: var(--steel); font-size: 1.125rem; }

/* Portada: anuncio de la tienda */
.shop-teaser { position: relative; z-index: 1; padding: 140px var(--m); display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1fr); gap: 64px; align-items: center; max-width: 1240px; margin: 0 auto; }
.shop-teaser__img { aspect-ratio: 1 / 1; }
.shop-teaser__text { display: grid; gap: 22px; justify-items: start; }
.shop-teaser h2 { font-size: var(--s-l); }
.shop-teaser__text > p { color: var(--steel); font-size: 1.125rem; max-width: 42ch; }
.shop-teaser__product { display: flex; align-items: baseline; gap: 16px; }
.shop-teaser__product strong { font: 400 1.5rem/1 var(--display); color: var(--cyan); }

@media (max-width: 860px) {
  .catalog.is-single .product, .pdp, .cart, .shop-teaser { grid-template-columns: 1fr; gap: 28px; }
  .pdp__img, .cart-sum { position: static; }
}
@media (max-width: 700px) {
  .shop { padding: 96px var(--m) 110px; gap: 36px; }
  .shop__head > p { font-size: 1.0625rem; }
  .product__img { aspect-ratio: 1 / 1; }
  .cart-line { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .cart-line__img { width: 72px; height: 72px; }
  .cart-line .qty { grid-column: 2; grid-row: 2; justify-self: start; }
  .cart-line__total { grid-column: 3; grid-row: 1; }
  .cart-line__remove { grid-column: 3; grid-row: 2; justify-self: end; }
  .cart-sum { padding: 20px; }
  .shop-teaser { padding: 100px var(--m); }
}
@media (prefers-reduced-motion: reduce) { .toast, .toast.is-in { transform: translate(-50%, 0); } }

.nav__cart-n[hidden] { display: none; }
@media (max-width: 700px) {
  .nav .nav__cart { margin-left: auto; }
  .catalog.is-single .product__img, .pdp__img { aspect-ratio: 4 / 3; }
  .pdp { gap: 22px; }
}

/* La foto se ajusta a la caja (la caja manda, no el tamaño de la foto) */
.product__img, .pdp__img, .shop-teaser__img { position: relative; overflow: hidden; }
.product__img img, .pdp__img img, .shop-teaser__img img { position: absolute; inset: 8% 0; margin: auto; height: 84%; width: auto; max-width: 90%; }
@media (max-width: 700px) { .nav .status + .nav__cart { margin-left: auto; } }

@media (max-width: 860px) { .pdp__img { aspect-ratio: auto; height: min(64vw, 420px); } }

.pdp__img { position: sticky; top: 96px; }
@media (max-width: 860px) { .pdp__img { position: relative; top: 0; } }

/* El bote va directamente sobre el fondo de la web (sin caja), con un halo de luz muy suave para que se distinga el negro del bote */
.product__img, .pdp__img, .cart-line__img, .shop-teaser__img {
  background-color: transparent;
  background-image: radial-gradient(closest-side, rgba(255, 255, 255, .09), rgba(255, 255, 255, 0));
}
.cart-line { background: transparent; padding-inline: 0; border-bottom: 1px solid #23262b; }

/* Carrito: foto centrada en su hueco y del mismo alto que la fila */
.cart-line { align-items: center; }
.cart-line__img { position: relative; align-self: center; overflow: visible; }
.cart-line__img img { position: absolute; inset: 0; margin: auto; height: 100%; width: auto; max-width: none; filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .6)); }

/* Acceso a la tienda desde el inicio */
.shop-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 54px; padding: 0 22px; color: var(--ink); text-decoration: none; font: 600 1rem/1 var(--text); box-shadow: inset 0 0 0 1.5px var(--steel); transition: background-color .2s ease, color .2s ease, box-shadow .2s ease, transform .16s var(--ease-out); }
.shop-btn:hover { background: var(--ink); color: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink); }
.shop-btn:active { transform: scale(.97); }
.shop-btn svg { transition: transform .3s var(--ease-out); }
.shop-btn:hover svg { transform: translateY(-2px) rotate(-6deg); }
@media (max-width: 700px) { .hero__actions { gap: 18px 24px; } .shop-btn { min-height: 50px; } }

/* Fotos de cualquier forma (botes altos o tarros anchos) sin deformarse */
.product__img img, .pdp__img img, .shop-teaser__img img, .cart-line__img img { width: 90%; height: 84%; max-width: 90%; object-fit: contain; }
.cart-line__img img { width: 100%; height: 100%; max-width: 100%; }
/* Con varios productos: columnas que se reparten el ancho */
.catalog:not(.is-single) { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.catalog:not(.is-single) .product__img { aspect-ratio: 1 / 1; }

.catalog:not(.is-single) .product__img { aspect-ratio: 4 / 3; }

/* Selector obligatorio de opción (p. ej. acabado de la cera) */
.opts { border: 0; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.opts legend { padding: 0; margin-bottom: 10px; font-weight: 600; }
.opts legend span { color: var(--muted); font-weight: 400; }
.opts__list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; cursor: pointer; }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 20px; background: var(--surface); box-shadow: inset 0 0 0 1.5px #3a3f46; transition: background-color .2s ease, box-shadow .2s ease, color .2s ease, transform .16s var(--ease-out); }
.opt:hover span { box-shadow: inset 0 0 0 1.5px var(--steel); }
.opt:active span { transform: scale(.97); }
.opt input:checked + span { background: var(--ink); color: var(--bg); box-shadow: inset 0 0 0 1.5px var(--ink); }
.opt input:focus-visible + span { outline: 2px solid var(--cyan); outline-offset: 3px; }
.opts__error { color: var(--cyan); font-size: .9375rem; }
.opts.is-error .opts__list { animation: nudge .4s var(--ease-out); }
@keyframes nudge { 20% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 80% { transform: translateX(-2px); } }
.cart-line__info em { font-style: normal; color: var(--cyan); font-size: .875rem; }
@media (prefers-reduced-motion: reduce) { .opts.is-error .opts__list { animation: none; } }

.catalog:not(.is-single) { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* Precio y botones alineados en todas las fichas aunque los textos midan distinto */
.catalog:not(.is-single) .product { grid-template-rows: auto 1fr; }
.catalog:not(.is-single) .product__info { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.catalog:not(.is-single) .product__price { margin-top: auto; padding-top: 6px; }

/* Filtros de la tienda */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: -16px; }
.filter { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border: 0; background: var(--surface); color: var(--steel); font: 500 .9375rem/1 var(--text); cursor: pointer; transition: background-color .2s ease, color .2s ease, transform .16s var(--ease-out); }
.filter span { font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.filter:hover { background: var(--surface-2); color: var(--ink); }
.filter:active { transform: scale(.97); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.filter[aria-pressed="true"] span { color: #5b6068; }
.catalog-empty { grid-column: 1 / -1; display: grid; gap: 10px; justify-items: start; padding: 48px 0 24px; color: var(--steel); font-size: 1.125rem; }
.catalog-empty .link { border: 0; background: none; padding: 0; font: inherit; cursor: pointer; margin-top: 8px; }
@media (max-width: 700px) {
  .filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: calc(var(--m) * -1); padding-inline: var(--m); scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: none; }
}

/* Ficha: texto de presentación y listas dentro de los apartados */
.pdp__intro { color: var(--steel); padding: 18px 0; max-width: 60ch; border-bottom: 1px solid #23262b; }
.pdp__more ul { list-style: none; margin: 0; padding: 0 0 18px; display: grid; gap: 10px; max-width: 60ch; }
.pdp__more li { display: grid; grid-template-columns: 12px 1fr; gap: 12px; color: var(--steel); }
.pdp__more li::before { content: ""; width: 8px; height: 8px; margin-top: .55em; background: var(--cyan); clip-path: polygon(25% 0, 75% 0, 100% 50%, 75% 100%, 25% 100%, 0 50%); }

/* Móvil: dos productos por fila, en fichas compactas, para ver más de un vistazo */
@media (max-width: 700px) {
  .catalog:not(.is-single) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 12px; }
  .catalog:not(.is-single) .product { gap: 12px; }
  .catalog:not(.is-single) .product__img { aspect-ratio: 4 / 5; }
  .catalog:not(.is-single) .product__info { gap: 6px; }
  .catalog:not(.is-single) .product__cat { font-size: .75rem; }
  .catalog:not(.is-single) .product__name { font-size: 1.0625rem; line-height: 1.2; }
  .catalog:not(.is-single) .product__tag { display: none; }
  .catalog:not(.is-single) .product__price { flex-wrap: wrap; gap: 2px 8px; font-size: .9375rem; }
  .catalog:not(.is-single) .product__price .price { font-size: 1.25rem; }
  .catalog:not(.is-single) .product__actions { width: 100%; margin-top: 4px; }
  .catalog:not(.is-single) .product__actions .btn { width: 100%; min-height: 44px; padding: 0 10px; justify-content: center; font-size: .875rem; }
  .catalog:not(.is-single) .product__actions .link { display: none; }
}
