/* ==========================================================================
   NIDIVA – Página de producto
   Índice:
     1. Fuentes y variables
     2. Base
     3. Utilidades y botones
     4. Barra de anuncio
     5. Cabecera
     6. Producto: galería
     7. Producto: información
     8. Descripción
     9. Reseñas
    11. Pie de página
    12. Paneles (menú, búsqueda, carrito, visor, aviso)
    13. Móvil y tableta
   ========================================================================== */

/* 1. Fuentes y variables -------------------------------------------------- */
@font-face { font-family: Poppins; src: url(../fonts/poppins-n4.woff2) format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url(../fonts/poppins-i4.woff2) format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: Poppins; src: url(../fonts/poppins-n5.woff2) format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url(../fonts/poppins-n6.woff2) format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url(../fonts/poppins-n7.woff2) format('woff2'); font-weight: 700 900; font-style: normal; font-display: swap; }
@font-face { font-family: Poppins; src: url(../fonts/poppins-i7.woff2) format('woff2'); font-weight: 700 900; font-style: italic; font-display: swap; }

:root {
  --brown: #7D4824;
  --yellow: #FFD712;
  --yellow-hover: #f2c900;
  --red: #D10000;
  --pink-old-price: #FF7E8D;
  --star: #FFC700;
  --text: rgba(31, 29, 36, .95);
  --text-strong: #1F1D24;
  --muted: #777;
  --line: #e6e6e6;
  --bg: #fff;
  --container: 1160px;
  --gutter: 50px;
  --radius: 8px;
  --header-h: 104px;
  --font: Poppins, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* 2. Base ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img, video, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--text-strong); outline-offset: 2px; }
body.is-locked { overflow: hidden; }

/* 3. Utilidades y botones ------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 1060px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: #fff; padding: 10px 16px; }
.skip-link:focus { left: 10px; top: 10px; }
.muted { color: var(--muted); }
.underline { text-decoration: underline; }

.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--text-strong); transition: transform .15s; }
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn:hover { transform: scale(1.07); }

.stars { display: inline-flex; gap: 1px; color: var(--star); vertical-align: middle; }
.stars svg { width: 17px; height: 17px; }
.stars--sm svg { width: 14px; height: 14px; }

.btn-atc {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 10px 20px;
  background: var(--yellow); color: #000; border-radius: var(--radius);
  font-size: 18px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase;
  transition: background-color .2s, transform .1s;
}
.btn-atc:hover { background: var(--yellow-hover); }
.btn-atc:active { transform: scale(.99); }
.btn-dark { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 28px; background: #000; color: #fff; font-size: 14px; font-weight: 700; border: 2px solid #000; transition: opacity .2s; }
.btn-dark:hover { opacity: .85; }
.btn-outline { display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 22px; border: 2px solid #000; font-size: 14px; font-weight: 600; }

/* 4. Barra de anuncio ----------------------------------------------------- */
.announcement { background: var(--brown); color: #fff; text-align: center; padding: 10px 16px; font-size: 14px; font-weight: 700; letter-spacing: .02em; }

/* 5. Cabecera ------------------------------------------------------------- */
.header { position: sticky; top: 0; z-index: 50; background: #fff; transition: box-shadow .2s; }
.header.is-scrolled { box-shadow: 0 2px 12px rgba(0,0,0,.07); }
.header__inner { display: flex; align-items: center; gap: 32px; height: var(--header-h); }
.header__logo .logo { width: 92px; height: auto; }
.logo--sm { width: 64px; height: auto; }
.header__burger { display: none; }
.header__nav { flex: 1; }
.header__nav > ul { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.header__nav a, .header__nav button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 0; font-size: 14px; color: var(--text-strong); }
.header__nav > ul > li > a:hover, .header__nav button:hover { text-decoration: underline; text-underline-offset: 4px; }
.chev { width: 10px; height: 6px; transition: transform .2s; }
.has-dropdown { position: relative; }
.has-dropdown button[aria-expanded="true"] .chev { transform: rotate(180deg); }
.dropdown {
  position: absolute; top: 100%; left: -20px; min-width: 300px; padding: 18px 22px; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(0,0,0,.08);
  opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s;
}
.has-dropdown.is-open .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown__title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.dropdown a { display: block; padding: 6px 0 6px 12px; font-size: 13px; color: #555; }
.dropdown a:hover { color: #000; text-decoration: underline; }
.header__icons { display: flex; align-items: center; margin-left: auto; }
.cart-btn { position: relative; }
.cart-count {
  position: absolute; top: 6px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: #000; color: #fff; font-size: 10px; font-weight: 600; line-height: 16px; text-align: center;
}
.cart-count.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.35); } }

/* 6. Producto: galería ---------------------------------------------------- */
.product { display: grid; grid-template-columns: minmax(0, 55%) minmax(0, 1fr); gap: 40px; padding-top: 16px; padding-bottom: 60px; align-items: start; }
.gallery { position: sticky; top: calc(var(--header-h) + 16px); min-width: 0; }
.gallery__main { position: relative; background: #f6f3ef; }
.gallery__track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.gallery__track::-webkit-scrollbar { display: none; }
.gallery__slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1; cursor: zoom-in; }
.gallery__slide img { width: 100%; height: 100%; object-fit: cover; }
.gallery__arrow {
  position: absolute; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 40px; height: 40px;
  border-radius: 50%; background: rgba(255,255,255,.92); box-shadow: 0 2px 10px rgba(0,0,0,.15); color: #000;
  opacity: 0; transition: opacity .2s;
}
.gallery__arrow svg { width: 18px; height: 18px; }
.gallery__arrow--prev { left: 12px; }
.gallery__arrow--next { right: 12px; }
.gallery__main:hover .gallery__arrow { opacity: 1; }
.gallery__counter { display: none; position: absolute; bottom: 12px; right: 12px; padding: 2px 10px; border-radius: 99px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 10px; }
.gallery__thumbs button { aspect-ratio: 1; border: 1px solid transparent; opacity: .75; transition: opacity .2s, border-color .2s; overflow: hidden; }
.gallery__thumbs button:hover { opacity: 1; }
.gallery__thumbs button.is-active { border-color: #000; opacity: 1; }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

/* 7. Producto: información ----------------------------------------------- */
.info { min-width: 0; container-type: inline-size; }
/* El texto del recuadro se ajusta al ancho para ocupar siempre una sola línea */
.promo-box { display: flex; flex-direction: column; border: 3px solid #000; padding: 8px 12px; margin-bottom: 18px; text-align: center; color: #000; line-height: 1.2; white-space: nowrap; }
.promo-box strong { font-size: min(30px, calc((100cqi - 36px) / 19)); font-weight: 800; letter-spacing: -.01em; }
.promo-box span { font-size: min(24px, calc((100cqi - 36px) / 22.5)); font-weight: 700; margin-top: 2px; }
.info__title { font-size: 21px; font-weight: 600; line-height: 1.3; color: var(--text-strong); margin-bottom: 10px; }
.info__rating { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 10px; }
.info__rating:hover span:last-child { text-decoration: underline; }
.price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 18px; }
.price__old { color: var(--pink-old-price); font-size: 18px; font-weight: 600; }
.price__new { color: #212121; font-size: 18px; font-weight: 600; }
.badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .03em; padding: 3px 8px; line-height: 1.2; }
.offer-ends { color: var(--red); font-size: 15px; font-weight: 700; font-style: italic; margin-bottom: 14px; }
.info__divider { border: 0; border-top: 1px solid #ddd; margin: 0 0 22px; }
.benefits { display: grid; gap: 10px; margin-bottom: 28px; font-family: Arial, sans-serif; font-size: 13px; color: #333; }
.qty { display: inline-flex; align-items: center; border: 1px solid #ccc; border-radius: 9px; height: 46px; margin-bottom: 22px; }
.qty button { display: grid; place-items: center; width: 44px; height: 100%; color: var(--text-strong); }
.qty button svg { width: 16px; height: 16px; }
.qty input { width: 44px; height: 100%; border: 0; text-align: center; font-size: 15px; background: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.payments { display: flex; justify-content: space-between; gap: 6px; margin: 12px 0 14px; }
.payments svg { width: 38px; height: 24px; }

.featured-review { border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin-bottom: 26px; font-family: Arial, sans-serif; color: #333; }
.featured-review__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 10px; }
.featured-review__head img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; margin-right: 6px; }
.featured-review__head strong { font-size: 14px; }
.featured-review__head .muted { font-size: 11px; }
.featured-review p { font-size: 13px; font-style: italic; color: #555; line-height: 1.6; }

/* 8. Descripción ---------------------------------------------------------- */
.description { font-size: 14px; line-height: 1.6; }
.description h2 { font-size: 14px; font-weight: 700; color: #000; margin: 22px 0 10px; }
.description h2:first-child { margin-top: 0; }
.description p { margin-bottom: 12px; }
.description ul { list-style: disc; padding-left: 22px; margin-bottom: 14px; }
.description li { margin-bottom: 6px; }
.description__media { width: 100%; margin: 14px 0 6px; background: #f2eee9; aspect-ratio: 1; object-fit: cover; }

/* 9. Reseñas -------------------------------------------------------------- */
.reviews { padding: 30px 0 80px; font-size: 13px; }
.section-title { text-align: center; font-size: 20px; font-weight: 600; color: var(--text-strong); margin-bottom: 18px; }
.reviews__summary { display: flex; justify-content: center; align-items: center; gap: 44px; padding-bottom: 18px; border-bottom: 1px solid #eee; }
.reviews__score { padding-right: 44px; border-right: 1px solid #ddd; }
.reviews__score > div { display: flex; align-items: center; gap: 6px; }
.reviews__media { display: flex; flex-direction: column; align-items: center; padding: 22px 0; }
.reviews__media p { color: #555; margin-bottom: 8px; align-self: flex-start; margin-left: 22%; }
.reviews__media-list { display: flex; gap: 6px; align-self: flex-start; margin-left: 22%; }
.reviews__media-list button { width: 60px; height: 60px; overflow: hidden; }
.reviews__media-list img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.reviews__media-list button:hover img { transform: scale(1.06); }
.reviews__toolbar { padding: 14px 0 10px; border-bottom: 1px solid #eee; }
.reviews__toolbar select { border: 0; background: transparent; font-size: 12px; padding: 4px 18px 4px 0; cursor: pointer; }
.reviews__list > li { padding: 18px 0; border-bottom: 1px solid #eee; }
.review__name { margin: 6px 0 14px; font-size: 13px; color: var(--text-strong); }
.review__text { color: #333; }
.review__photo { width: 76px; height: 76px; margin-top: 12px; overflow: hidden; }
.review__photo img { width: 100%; height: 100%; object-fit: cover; }
.reviews__more { display: flex; justify-content: center; padding-top: 14px; }

.review-form { display: grid; gap: 12px; max-width: 520px; margin: 22px auto 0; padding: 20px; border: 1px solid #eee; }
.review-form h3 { font-size: 15px; font-weight: 600; }
.review-form label { display: grid; gap: 4px; font-size: 13px; }
.review-form input, .review-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 16px; }
.review-form__stars { display: flex; gap: 4px; color: #ccc; }
.review-form__stars button svg { width: 26px; height: 26px; }
.review-form__stars button.is-on { color: var(--star); }
.review-form__actions { display: flex; justify-content: flex-end; gap: 10px; }
.review-thanks { margin: 18px auto 0; text-align: center; color: #2e7d32; font-weight: 600; }

/* 11. Pie de página ------------------------------------------------------- */
.footer { color: rgba(255,255,255,.95); }
.footer__wave { width: 100%; height: 48px; margin-bottom: -1px; }
@media (max-width: 749px) { .footer__wave { height: 30px; } }
.footer__body { background: var(--brown); padding: 36px 0 18px; }
.footer__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; font-size: 13px; }
.footer h2 { font-size: 18px; font-weight: 600; margin-bottom: 18px; color: #fff; }
.footer p { margin-bottom: 14px; }
.footer__links li { margin-bottom: 6px; }
.footer__links a:hover, .footer__legal a:hover { text-decoration: underline; }
.footer__bottom { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 50px; }
.footer__payments { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.footer__payments svg { width: 34px; height: 22px; }
.footer__legal { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 16px; font-size: 10px; }
.footer__withdraw { display: inline-block; padding: 4px 10px; border: 1px solid rgba(255,255,255,.85); border-radius: 4px; }

/* 12. Paneles ------------------------------------------------------------- */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }

.drawer {
  position: fixed; top: 0; bottom: 0; z-index: 100; width: min(400px, 88vw); background: #fff;
  display: flex; flex-direction: column; transition: transform .3s ease; visibility: hidden;
}
.drawer--right { right: 0; transform: translateX(100%); }
.drawer--left { left: 0; transform: translateX(-100%); }
.drawer.is-open { transform: none; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #eee; }
.drawer__head h2 { font-size: 18px; font-weight: 600; color: var(--text-strong); }

.mobile-nav { display: flex; flex-direction: column; padding: 8px 0; overflow-y: auto; }
.mobile-nav > a, .mobile-nav summary { display: flex; align-items: center; justify-content: space-between; padding: 13px 24px; font-size: 16px; color: var(--text-strong); cursor: pointer; list-style: none; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav details[open] .chev { transform: rotate(180deg); }
.mobile-nav details { background: #faf8f6; }
.mobile-nav details a { display: block; padding: 9px 24px 9px 40px; font-size: 14px; color: #555; }
.mobile-nav__title { padding: 4px 24px 4px 32px; font-size: 14px; font-weight: 600; }
.mobile-nav__account { justify-content: flex-start !important; gap: 10px; margin-top: 12px; border-top: 1px solid #eee; }
.mobile-nav__account svg { width: 22px; height: 22px; }

.search-panel { position: fixed; top: 0; left: 0; right: 0; z-index: 100; background: #fff; padding: 22px 0; box-shadow: 0 6px 20px rgba(0,0,0,.08); transform: translateY(-100%); transition: transform .25s; visibility: hidden; }
.search-panel.is-open { transform: none; visibility: visible; }
.search-panel__form { display: flex; align-items: center; gap: 10px; position: relative; }
.search-panel__icon { position: absolute; left: calc(var(--gutter) + 14px); width: 18px; height: 18px; color: #666; }
.search-panel input { flex: 1; height: 48px; padding: 0 16px 0 44px; border: 1px solid #333; border-radius: 4px; font-size: 16px; }
.search-panel__results { margin-top: 10px; }
.search-panel__results a { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.search-panel__results img { width: 50px; height: 50px; object-fit: cover; }
.search-panel__results p { padding: 8px 0; font-size: 14px; color: #666; }

.cart__empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 24px; font-size: 20px; color: var(--text-strong); }
.cart__empty .btn-atc { width: auto; padding-inline: 32px; font-size: 15px; }
.cart__items { flex: 1; overflow-y: auto; padding: 4px 18px; }
.cart-item { display: grid; grid-template-columns: 76px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1px solid #eee; }
.cart-item img { width: 76px; height: 76px; object-fit: cover; }
.cart-item__title { font-size: 13px; line-height: 1.4; color: var(--text-strong); margin-bottom: 4px; }
.cart-item__price { font-size: 13px; margin-bottom: 8px; }
.cart-item__price s { color: var(--pink-old-price); margin-right: 6px; }
.cart-item__row { display: flex; align-items: center; gap: 10px; }
.cart-item .qty { height: 38px; margin: 0; }
.cart-item .qty button { width: 36px; }
.cart-item .qty input { width: 32px; font-size: 14px; }
.cart-item__remove { display: grid; place-items: center; width: 36px; height: 36px; color: #555; }
.cart-item__remove svg { width: 18px; height: 18px; }
.cart__footer { padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid #eee; }
.cart__total { display: flex; justify-content: space-between; font-size: 16px; margin-bottom: 6px; color: var(--text-strong); }
.cart__note { font-size: 12px; color: #777; margin-bottom: 14px; }

.lightbox { position: fixed; inset: 0; z-index: 120; background: rgba(255,255,255,.98); display: flex; align-items: center; justify-content: center; padding: 60px 70px; animation: fade .2s; }
.lightbox img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; }
.lightbox .gallery__arrow { opacity: 1; }
.lightbox__prev { left: 16px; }
.lightbox__next { right: 16px; }
.lightbox__close { position: absolute; top: 12px; right: 12px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 130; transform: translate(-50%, 20px); max-width: calc(100vw - 32px); padding: 12px 20px; border-radius: 8px; background: #1F1D24; color: #fff; font-size: 14px; text-align: center; opacity: 0; pointer-events: none; transition: .25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* 13. Móvil y tableta ----------------------------------------------------- */
@media (max-width: 1100px) {
  .header__inner { gap: 20px; }
  .header__nav > ul { gap: 4px 16px; }
}

@media (max-width: 989px) {
  :root { --gutter: 24px; --header-h: 72px; }
  .header__burger { display: inline-grid; margin-left: -10px; }
  .header__nav { display: none; }
  .header__inner { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
  .header__logo { justify-self: center; }
  .header__logo .logo { width: 70px; }
  .header__icons { justify-self: end; margin-right: -10px; }
  .hide-mobile { display: none; }

  .product { grid-template-columns: 1fr; gap: 22px; padding-top: 0; padding-bottom: 40px; }
  .gallery { position: static; margin-inline: calc(var(--gutter) * -1); }
  .gallery__arrow { display: none; }
  .gallery__counter { display: block; }
  .gallery__thumbs { display: flex; overflow-x: auto; gap: 6px; padding: 0 var(--gutter); scrollbar-width: none; }
  .gallery__thumbs::-webkit-scrollbar { display: none; }
  .gallery__thumbs button { flex: 0 0 64px; }

  .reviews__media p, .reviews__media-list { margin-left: 0; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__grid > div:last-child { grid-column: 1 / -1; }
}

@media (max-width: 749px) {
  :root { --gutter: 16px; --header-h: 64px; }
  body { font-size: 14px; }
  .announcement { font-size: 12px; padding: 8px 12px; }
  .header__logo .logo { width: 62px; }
  .info__title { font-size: 19px; }
  .payments svg { width: 34px; height: 22px; }
  .featured-review { padding: 16px; }

  .reviews { padding-top: 10px; }
  .reviews__summary { flex-direction: column; gap: 14px; }
  .reviews__score { padding-right: 0; border-right: 0; text-align: center; }
  .reviews__score > div { justify-content: center; }
  .reviews__media { align-items: flex-start; }


  .footer__grid { grid-template-columns: 1fr; gap: 26px; }
  .footer__bottom { margin-top: 30px; }
  .lightbox { padding: 56px 8px; }
  .lightbox .gallery__arrow { display: none; }
}

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