/* ════════════════════════════════════════════════════════════════════
   product-ropa.css
   Template: Página de producto — Ropa ciclismo
   Paleta: #e10600 (rojo 3mart), #111 (negro), #646464 (gris), #f3f3f3 (fondo)
════════════════════════════════════════════════════════════════════ */

/* ── Variables ──────────────────────────────────────────────────── */
.ropa-product,
.ropa-description,
.ropa-sticky-bar,
.ropa-outfit,
.ropa-modal {
  --red:     #e10600;
  --black:   #111111;
  --dark:    #262626;
  --gray:    #646464;
  --border:  #e7e7e7;
  --light:   #f3f3f3;
  --white:   #ffffff;
  --radius:  6px;
  --ease:    0.2s ease;
}


/* ════════════════════════════════════════════════════════════════════
   LAYOUT PRINCIPAL (two-column)
════════════════════════════════════════════════════════════════════ */
.ropa-product {
  display: grid;
  grid-template-columns: 55fr 45fr;
  gap: 0 3.5rem;
  max-width: 1280px;
  margin: 2rem auto 5rem;
  padding: 0 2rem;
  align-items: start;
  position: relative; /* necesario para el sticky JS */
}


/* ════════════════════════════════════════════════════════════════════
   GALERÍA — DESKTOP
   Imágenes apiladas verticalmente. La galería scrollea con la página
   mientras el panel derecho queda sticky dentro de los límites del grid.
════════════════════════════════════════════════════════════════════ */
.ropa-gallery {
  /* Sin sticky en desktop — las imágenes scrollean normalmente */
}

.ropa-gallery__main {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ropa-gallery__slide {
  /* Desktop: bloque normal apilado */
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--light);
  opacity: 1;
  pointer-events: auto;
  transition: none;
}

.ropa-gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Flechas — ocultas en desktop, visibles en mobile */
.ropa-gallery__arrow {
  display: none;
}


/* ════════════════════════════════════════════════════════════════════
   PANEL DE INFORMACIÓN — sticky dentro del grid
   Se queda fijo mientras el usuario scrollea la galería.
   El panel empieza a verse desde arriba y termina cuando
   el container del grid (galería) llega al final.
════════════════════════════════════════════════════════════════════ */
.ropa-info {
  /* El sticky lo maneja JS para saltarse los overflow de Enfold */
  padding-top: 0.25rem;
  padding-bottom: 1rem;
  /* Cuando JS activa sticky, info necesita ancho explícito */
  box-sizing: border-box;
}

/* Eyebrow — categoría */
.ropa-info__eyebrow {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--gray);
  margin: 0 0 0.5rem;
}

/* Nombre H1 */
.ropa-info__name {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  font-weight: 700;
  color: var(--black);
  margin: 0 0 1rem;
  line-height: 1.18;
}

/* ── Precio ─────────────────────────────────────────────────────── */
.ropa-info__price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--border);
}

.ropa-price--normal,
.ropa-price--sale {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--black);
}

.ropa-price--regular {
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--gray);
  text-decoration: line-through;
}

.ropa-price--badge {
  background: var(--red);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.22em 0.5em;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

/* ── Variantes de color ─────────────────────────────────────────── */
.ropa-variants {
  margin-bottom: 1.5rem;
}

.ropa-variants__label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gray);
  margin: 0 0 0.65rem;
}

.ropa-variants__label strong {
  color: var(--black);
  font-weight: 700;
}

.ropa-variants__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ropa-variants__swatch {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--light);
  text-decoration: none;
  transition: border-color var(--ease), transform var(--ease);
}

.ropa-variants__swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ropa-variants__swatch:hover {
  border-color: var(--dark);
  transform: scale(1.05);
}

.ropa-variants__swatch.is-active {
  border-color: var(--black);
  box-shadow: 0 0 0 1px var(--black);
}

.ropa-variants__swatch-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 0.25rem;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--dark);
  text-align: center;
  line-height: 1.2;
}

/* ── Selector de talla ──────────────────────────────────────────── */
.ropa-sizes {
  margin-bottom: 1.25rem;
}

.ropa-sizes__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.ropa-sizes__label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--gray);
  margin: 0;
}

.ropa-sizes__label strong {
  color: var(--black);
  font-weight: 700;
}

.ropa-sizes__guide {
  font-size: 0.72rem;
  color: var(--gray);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--ease);
}

.ropa-sizes__guide:hover { color: var(--black); }

.ropa-sizes__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.ropa-sizes__btn {
  min-width: 52px;
  height: 44px;
  padding: 0 0.75rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--black);
  cursor: pointer;
  transition: border-color var(--ease), background var(--ease), color var(--ease);
}

.ropa-sizes__btn:hover:not(:disabled):not(.is-unavailable) {
  border-color: var(--dark);
}

.ropa-sizes__btn.is-selected {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.ropa-sizes__btn.is-unavailable,
.ropa-sizes__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

/* ── Overview del producto ──────────────────────────────────────── */
.ropa-overview {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
  background: var(--light);
  border-radius: var(--radius);
  border-left: 3px solid var(--black);
}

.ropa-overview p {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--dark);
  margin: 0 0 0.4em;
}

.ropa-overview p:last-child { margin-bottom: 0; }

.ropa-overview ul {
  margin: 0;
  padding-left: 1.1rem;
  list-style: none;
}

.ropa-overview ul li {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--dark);
  padding-left: 0.25rem;
  position: relative;
}

.ropa-overview ul li::before {
  content: '—';
  position: absolute;
  left: -1rem;
  color: var(--gray);
  font-size: 0.75rem;
}


/* ── Add to cart ────────────────────────────────────────────────── */
.ropa-cta {
  margin-bottom: 2rem;
}

.ropa-cta__btn {
  width: 100%;
  padding: 1rem 1.5rem;
  background: var(--black);
  color: var(--white);
  border: 2px solid var(--black);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.ropa-cta__btn:hover:not(:disabled) {
  background: var(--white);
  color: var(--black);
}

.ropa-cta__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.ropa-cta__btn.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

/* ── Acordeón ───────────────────────────────────────────────────── */
.ropa-accordion {
  border-top: 1px solid var(--border);
}

.ropa-accordion__item {
  border-bottom: 1px solid var(--border);
}

.ropa-accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  background: none;
  border: none;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--black);
  text-align: left;
  cursor: pointer;
  transition: color var(--ease);
}

.ropa-accordion__trigger:hover { color: var(--gray); }

.ropa-accordion__icon {
  position: relative;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
}

.ropa-accordion__icon::before,
.ropa-accordion__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: currentColor;
  transition: transform var(--ease), opacity var(--ease);
}

.ropa-accordion__icon::before {
  width: 12px;
  height: 1.5px;
  transform: translate(-50%, -50%);
}

.ropa-accordion__icon::after {
  width: 1.5px;
  height: 12px;
  transform: translate(-50%, -50%);
}

.ropa-accordion__trigger.is-open .ropa-accordion__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
  opacity: 0;
}

.ropa-accordion__body {
  padding-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--gray);
}

.ropa-accordion__body[hidden] { display: none; }
.ropa-accordion__body p { margin: 0 0 0.5em; }
.ropa-accordion__body p:last-child { margin-bottom: 0; }


/* ════════════════════════════════════════════════════════════════════
   DESCRIPCIÓN LARGA
════════════════════════════════════════════════════════════════════ */
.ropa-description {
  padding: 5rem 2rem;
  background: var(--light);
  margin-top: 3rem;
}

.ropa-description__inner {
  max-width: 820px;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--dark);
}


/* ════════════════════════════════════════════════════════════════════
   COMPLETA TU OUTFIT
════════════════════════════════════════════════════════════════════ */
.ropa-outfit {
  padding: 1rem 1rem 5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.ropa-outfit__header {
  margin-bottom: 2rem;
}

.ropa-outfit__title {
  font-size: clamp(1.1rem, 1.8vw, 1.4rem);
  font-weight: 700;
  color: var(--black);
  letter-spacing: -0.01em;
  margin: 0;
}

/* Track contenedor con overflow */
.ropa-outfit__track-wrap {
  position: relative;
  background-color: white;
}

.ropa-outfit__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px; /* evita que el box-shadow del card se corte */
}

.ropa-outfit__track::-webkit-scrollbar { display: none; }

/* Card individual */
.ropa-outfit__card {
  flex: 0 0 calc(25% - 0.75rem);
  min-width: 200px;
  scroll-snap-align: start;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ropa-outfit__img-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--light);
}

.ropa-outfit__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}

.ropa-outfit__card:hover .ropa-outfit__img-wrap img {
  transform: scale(1.04);
}

.ropa-outfit__img-placeholder {
  width: 100%;
  height: 100%;
  background: var(--light);
}

.ropa-outfit__badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  background: var(--red);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2em 0.45em;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.ropa-outfit__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.ropa-outfit__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--black);
  margin: 0;
  line-height: 1.3;
}

.ropa-outfit__color {
  font-size: 0.72rem;
  color: var(--gray);
  margin: 0;
}

.ropa-outfit__price {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.1rem;
}

.ropa-outfit__price .ropa-price--normal,
.ropa-outfit__price .ropa-price--sale {
  font-size: 0.9rem;
}

.ropa-outfit__price .ropa-price--regular {
  font-size: 0.78rem;
}

/* Flechas del slider outfit */
.ropa-outfit__arrow {
  display: none; /* solo en mobile/tablet si hay overflow */
  position: absolute;
  top: 50%;
  transform: translateY(-60%); /* -60% para centrar respecto a la imagen, no al card completo */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  color: var(--black);
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: box-shadow var(--ease);
}

.ropa-outfit__arrow:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.ropa-outfit__arrow--prev { left: -1.25rem; }
.ropa-outfit__arrow--next { right: -1.25rem; }


/* ════════════════════════════════════════════════════════════════════
   BARRA STICKY MOBILE
════════════════════════════════════════════════════════════════════ */
.ropa-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--white);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 100;
}

.ropa-sticky-bar__price {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  min-width: 0;
  flex-shrink: 0;
}

.ropa-sticky-bar__btn {
  flex: 1;
  padding: 0.85rem 1rem;
  background: var(--black);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--ease);
}

.ropa-sticky-bar__btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ════════════════════════════════════════════════════════════════════
   MODAL — Guía de tallas
════════════════════════════════════════════════════════════════════ */
.ropa-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ropa-modal[hidden] { display: none; }

.ropa-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ropa-modal__content {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}

.ropa-modal__title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 1.5rem;
  color: var(--black);
}

.ropa-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--gray);
  cursor: pointer;
  transition: color var(--ease);
}

.ropa-modal__close:hover { color: var(--black); }

.ropa-size-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.ropa-size-table th,
.ropa-size-table td {
  padding: 0.6rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.ropa-size-table th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--gray);
}

.ropa-size-table td:first-child {
  font-weight: 700;
  color: var(--black);
}

.ropa-size-table tr:last-child td { border-bottom: none; }


/* ════════════════════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════════════════ */

/* Tablet: 3 cards en el outfit, columnas iguales */
@media (max-width: 1100px) {
  .ropa-product {
    grid-template-columns: 1fr 1fr;
    gap: 0 2rem;
  }

  .ropa-outfit__card {
    flex: 0 0 calc(33.333% - 0.67rem);
  }

  .ropa-outfit__arrow {
    display: flex;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .ropa-product {
    grid-template-columns: 1fr;
    gap: 0;
    margin: 0 0 1rem;
    padding: 0;
  }

  /* En mobile la galería vuelve al comportamiento de slider */
  .ropa-gallery__main {
    /* Un solo slide visible a la vez */
    display: block;
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0;
    background: var(--light);
  }

  .ropa-gallery__slide {
    position: absolute;
    inset: 0;
    aspect-ratio: unset;
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .ropa-gallery__slide.is-active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Flechas visibles en mobile */
  .ropa-gallery__arrow {
    display: flex;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.85);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    color: var(--black);
    align-items: center;
    justify-content: center;
    transition: background var(--ease);
  }

  .ropa-gallery__arrow:hover { background: var(--white); }
  .ropa-gallery__arrow--prev { left: 0.75rem; }
  .ropa-gallery__arrow--next { right: 0.75rem; }

  .ropa-info {
    padding: 1.25rem 1rem 1.25rem;
  }

  /* Botón desktop oculto, se usa sticky bar */
  .ropa-cta { display: none; }

  .ropa-sticky-bar { display: flex; }

  .ropa-description {
    margin-top: 0;
    padding: 2.5rem 1rem;
  }

  /* Outfit: 2 cards visibles */
  .ropa-outfit {
    padding: 3rem 1rem 4rem;
  }

  .ropa-outfit__card {
    flex: 0 0 calc(50% - 0.5rem);
  }

  .ropa-outfit__arrow { display: none; }
}

@media (max-width: 480px) {
  .ropa-variants__swatch {
    width: 56px;
    height: 56px;
  }

  .ropa-sizes__btn {
    min-width: 46px;
    height: 42px;
    font-size: 0.72rem;
  }

  /* Outfit: 1.5 cards para dar hint de scroll */
  .ropa-outfit__card {
    flex: 0 0 calc(65% - 0.5rem);
  }
}