/* producto.css — Página de detalle de producto */

/* ── Breadcrumb ───────────────────────────────────────── */
.breadcrumb {
  padding: 0;
  margin-bottom: var(--fm-space-md);
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fm-gray-warm);
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb a {
  color: var(--fm-gray-warm);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--fm-black); }

.breadcrumb__sep { opacity: 0.4; }

.breadcrumb__current { color: var(--fm-black); }


/* ── Layout producto ──────────────────────────────────── */
.producto-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

@media (min-width: 1280px) {
  .producto-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 0 var(--fm-space-2xl);
    padding: 0 var(--fm-margin-desktop) var(--fm-space-3xl);
  }
}


/* ── Galería de imágenes ──────────────────────────────── */
.producto-gallery {
  position: relative;
}

@media (min-width: 1280px) {
  .producto-gallery {
    position: sticky;
    top: calc(96px + var(--fm-space-lg));
  }
}

.producto-gallery__main {
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background-color: var(--fm-gray-surface);
}

.producto-gallery__main-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: opacity 0.4s var(--fm-ease-zoom);
  will-change: opacity;
}

.producto-gallery__thumbs {
  display: flex;
  gap: var(--fm-space-sm);
  padding: var(--fm-space-sm) var(--fm-margin-mobile);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  min-width: 0;
  max-width: 100%;
}

.producto-gallery__thumbs::-webkit-scrollbar { display: none; }

@media (min-width: 1280px) {
  .producto-gallery__thumbs { padding: var(--fm-space-sm) 0; }
}

.producto-gallery__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.55;
  border: 2px solid transparent;
  transition: opacity 0.25s var(--fm-ease-hover),
              border-color 0.25s var(--fm-ease-hover);
}

.producto-gallery__thumb:hover { opacity: 0.85; }

.producto-gallery__thumb--active {
  opacity: 1;
  border-color: var(--fm-black);
}

.producto-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}


/* ── Info del producto ────────────────────────────────── */
.producto-info {
  padding: var(--fm-space-lg) var(--fm-margin-mobile) var(--fm-space-xl);
}

@media (min-width: 1280px) {
  .producto-info {
    padding: 0;
    padding-top: var(--fm-space-lg);
  }
}

.producto-info__badge {
  display: inline-block;
  font-family: var(--fm-font-narrow);
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 4px 10px;
  border: 1px solid currentColor;
  margin-bottom: var(--fm-space-md);
}

.producto-info__badge--stock-low {
  color: var(--fm-terracota);
  border-color: var(--fm-terracota);
}

.producto-info__badge--agotado {
  color: var(--fm-gray-warm);
  border-color: var(--fm-gray-light);
}

.producto-info__marca {
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fm-gray-warm);
  margin-bottom: var(--fm-space-xs);
}

.producto-info__name {
  font-family: var(--fm-font-display);
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: var(--fm-space-sm);
}

.producto-info__price {
  font-family: var(--fm-font-narrow);
  font-size: 1.125rem;
  letter-spacing: 0.05em;
  color: var(--fm-black);
  margin-bottom: var(--fm-space-lg);
}

/* Color swatches */
.producto-info__colors {
  margin-bottom: var(--fm-space-lg);
}

.producto-info__colors-label {
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fm-gray-warm);
  margin-bottom: var(--fm-space-sm);
}

.producto-info__swatches {
  display: flex;
  gap: var(--fm-space-sm);
  flex-wrap: wrap;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.25s var(--fm-ease-hover);
}

.swatch--active,
.swatch:hover { outline-color: var(--fm-black); }

.swatch--camel       { background-color: #C9B99A; }
.swatch--taupe       { background-color: #A8957E; }
.swatch--negro       { background-color: var(--fm-black); }
.swatch--crudo       { background-color: var(--fm-beige); border: 1px solid var(--fm-gray-light); }
.swatch--bordeaux    { background-color: var(--fm-borgona); }
.swatch--cacao       { background-color: #6B4226; }
.swatch--moka        { background-color: #5C3D2E; }
.swatch--topo        { background-color: #B8A898; }
.swatch--taupe-humo  { background-color: #8E8278; }
.swatch--navy        { background-color: #1B2A4A; }
.swatch--borgona     { background-color: #7A1030; }
.swatch--caffe       { background-color: #4A2E1A; }
.swatch--cognac      { background-color: #B5762A; }
.swatch--plata       { background-color: #C0C0C0; border: 1px solid var(--fm-gray-light); }
.swatch--oro         { background-color: #C8A84B; }
.swatch--cafe-rojizo { background-color: #7B3F2A; }

/* CTA buttons */
.producto-info__actions {
  display: flex;
  flex-direction: row;
  gap: var(--fm-space-sm);
  margin-bottom: var(--fm-space-sm);
  align-items: stretch;
}

.btn--add-cart {
  flex: 1;
  padding: 16px;
  background-color: var(--fm-black);
  color: var(--fm-white);
  font-family: var(--fm-font-narrow);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background-color 0.25s var(--fm-ease-hover),
              transform 0.2s var(--fm-ease-hover);
}

.btn--add-cart:active { transform: scale(0.98); }

@media (hover: hover) and (pointer: fine) {
  .btn--add-cart:hover { background-color: var(--fm-black-hover); }
}

.btn--add-cart:disabled {
  background-color: var(--fm-gray-light);
  color: var(--fm-gray-warm);
  cursor: default;
}

.btn--consultar {
  width: 100%;
  padding: 14px;
  margin-bottom: var(--fm-space-xl);
  background: none;
  border: 1px solid var(--fm-gray-light);
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fm-gray-warm);
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.25s var(--fm-ease-hover),
              color 0.25s var(--fm-ease-hover),
              transform 0.2s var(--fm-ease-hover);
}

/* "Avísame cuando esté disponible" — solo visible en productos agotados */
.aviso-stock {
  margin-bottom: var(--fm-space-lg);
}

.aviso-stock__label {
  display: block;
  margin-bottom: var(--fm-space-sm);
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fm-gray-warm);
}

.aviso-stock__row {
  display: flex;
  gap: var(--fm-space-sm);
}

.aviso-stock__input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--fm-gray-light);
  background: var(--fm-white);
  font-family: var(--fm-font-body);
  font-weight: 300;
  font-size: 14px;
  color: var(--fm-black);
}

.aviso-stock__input:focus {
  outline: none;
  border-color: var(--fm-black);
}

.aviso-stock__btn {
  padding: 12px 20px;
  background: var(--fm-black);
  border: none;
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fm-white);
  cursor: pointer;
  white-space: nowrap;
}

.aviso-stock__btn:disabled {
  background: var(--fm-gray-light);
  color: var(--fm-gray-warm);
  cursor: default;
}

.aviso-stock__msg {
  margin: var(--fm-space-sm) 0 0;
  font-family: var(--fm-font-body);
  font-weight: 300;
  font-size: 13px;
  color: var(--fm-gray-warm);
}

.btn--consultar:active { transform: scale(0.98); }

@media (hover: hover) and (pointer: fine) {
  .btn--consultar:hover {
    border-color: var(--fm-black);
    color: var(--fm-black);
  }
}

/* Added to cart feedback */
.btn--add-cart.btn--added {
  background-color: var(--fm-salvia);
}

/* Wishlist button */
.btn--wishlist {
  width: 48px;
  height: 48px;
  border: 1px solid var(--fm-gray-light);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--fm-gray-warm);
  flex-shrink: 0;
  transition: border-color 0.25s var(--fm-ease-hover),
              color 0.25s var(--fm-ease-hover),
              transform 0.2s var(--fm-ease-hover);
}

.btn--wishlist:active { transform: scale(0.88); }

@media (hover: hover) and (pointer: fine) {
  .btn--wishlist:hover {
    border-color: var(--fm-black);
    color: var(--fm-black);
  }
}

.btn--wishlist--active {
  color: var(--fm-terracota);
  border-color: var(--fm-terracota);
}

.btn--wishlist--active svg path {
  fill: var(--fm-terracota);
  stroke: var(--fm-terracota);
}


/* ── Secciones de información ─────────────────────────── */
.producto-sections {
  padding: 0 var(--fm-margin-mobile) var(--fm-space-xl);
}

@media (min-width: 1280px) {
  .producto-sections { padding: 0; }
}

.producto-section {
  border-top: 1px solid var(--fm-gray-light);
  padding: var(--fm-space-lg) 0;
}

.producto-section__title {
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fm-black);
  margin-bottom: var(--fm-space-md);
}

.producto-section__text {
  font-family: var(--fm-font-body);
  font-weight: 300;
  font-size: 14px;
  line-height: 1.7;
  color: var(--fm-gray-warm);
}

.producto-section__text + .producto-section__text {
  margin-top: var(--fm-space-md);
}

/* Tabla de detalles técnicos */
.producto-detalles {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.producto-detalles tr {
  border-bottom: 1px solid var(--fm-gray-surface);
}

.producto-detalles td {
  padding: 10px 0;
  vertical-align: top;
  font-family: var(--fm-font-body);
  font-weight: 300;
  color: var(--fm-gray-warm);
}

.producto-detalles td:first-child {
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fm-black);
  width: 40%;
  padding-right: var(--fm-space-md);
}


/* ── Relacionados ─────────────────────────────────────── */
.producto-relacionados {
  padding: var(--fm-space-xl) var(--fm-margin-mobile) var(--fm-space-2xl);
  border-top: 1px solid var(--fm-gray-light);
}

@media (min-width: 1280px) {
  .producto-relacionados {
    padding: var(--fm-space-xl) var(--fm-margin-desktop) var(--fm-space-3xl);
  }
}

.producto-relacionados__title {
  font-family: var(--fm-font-narrow);
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--fm-gray-warm);
  margin-bottom: var(--fm-space-lg);
}

.producto-relacionados__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--fm-space-md) var(--fm-gutter-mobile);
}

@media (min-width: 768px) {
  .producto-relacionados__grid {
    gap: var(--fm-space-lg) var(--fm-gutter-tablet);
  }
}

@media (min-width: 1280px) {
  .producto-relacionados__grid {
    gap: var(--fm-space-xl) var(--fm-gutter-desktop);
  }
}

/* Loading skeleton */
.producto-skeleton {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  background: linear-gradient(90deg, var(--fm-gray-surface) 25%, var(--fm-beige-light) 50%, var(--fm-gray-surface) 75%);
  background-size: 200% 100%;
}

@keyframes skeleton-pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
