/* ─────────────────────────────────────────────
   MARGO — Componentes
───────────────────────────────────────────── */

/* ══════════════════════════════════════
   CATALOG — página de inicio
══════════════════════════════════════ */

.catalog-header {
  background: var(--color-surface);
  border-bottom: var(--border-thin);
}

.catalog-header-inner {
  padding: var(--space-14) 0 var(--space-11);
}

.catalog-header .eyebrow {
  margin-bottom: var(--space-3);
}

.catalog-title {
  font-size: 40px;
  font-weight: 300;
  letter-spacing: -1px;
  color: var(--color-text-primary);
  line-height: 1;
}

.catalog-title em {
  font-style: italic;
  color: var(--color-text-tertiary);
}

.catalog-body {
  padding: var(--space-13) 0 var(--space-17);
}

/* ── Product grid ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--color-border);
}

/* ── Product card ── */
.product-card {
  background: var(--color-surface);
  cursor: pointer;
  overflow: hidden;
  text-decoration: none;
  display: block;
}

.product-card-img {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--color-img-placeholder);
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-image);
}

.product-card:hover .product-card-img img {
  transform: scale(1.04);
}

.product-card-body {
  padding: var(--space-5) var(--space-7) var(--space-7);
  border-top: var(--border-thin);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.product-card-name {
  font-size: 14px;
  font-weight: 400;
  color: var(--color-text-primary);
}

.product-card-price {
  font-size: 13px;
  font-weight: 300;
  color: var(--color-text-secondary);
}

/* ══════════════════════════════════════
   PRODUCT — página de detalle
══════════════════════════════════════ */

.product-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: calc(100vh - var(--nav-height));
}

/* ── Galería ── */
.product-gallery {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  max-height: calc(100vh - var(--nav-height));
  background: var(--color-surface-alt);
  overflow: hidden;
  display: flex;
  flex-direction: row;
  gap: 1px;
}

.gallery-thumbs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--color-border);
  width: var(--thumb-width);
  flex-shrink: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
  width: var(--thumb-width);
  height: var(--thumb-width);
  flex-shrink: 0;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity var(--transition-normal), box-shadow var(--transition-normal);
  background: var(--color-surface-alt);
}

.gallery-thumb.active {
  opacity: 1;
  box-shadow: inset 0 0 0 2px var(--color-text-primary);
}
.gallery-thumb:hover:not(.active) { opacity: 0.7; }

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

.gallery-main {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition-slow);
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--color-surface);
  border: none;
  width: var(--arrow-size);
  height: var(--arrow-size);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-primary);
  font-size: 18px;
  opacity: 0;
  transition: opacity var(--transition-normal), background var(--transition-fast);
  z-index: 2;
}

.gallery-main:hover .gallery-arrow { opacity: 1; }
.gallery-arrow:hover                { background: var(--color-bg); }
.gallery-arrow.prev                 { left: 16px; }
.gallery-arrow.next                 { right: 16px; }

/* ── Info panel ── */
.product-info {
  padding: var(--space-15) var(--space-15) var(--space-16);
  border-left: var(--border-thin);
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
}

.product-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-tertiary);
  cursor: pointer;
  margin-bottom: var(--space-15);
  border: none;
  background: none;
  padding: 0;
  transition: color var(--transition-normal);
  text-decoration: none;
}

.product-back:hover { color: var(--color-text-primary); }
.product-back::before { content: '←'; font-size: 14px; }

.product-eyebrow {
  margin-bottom: var(--space-4);
}

.product-name {
  font-size: 36px;
  font-weight: 300;
  letter-spacing: -0.8px;
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
  line-height: 1.05;
}

.product-price {
  font-size: 20px;
  font-weight: 300;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-12);
}

.product-divider {
  margin-bottom: var(--space-11);
}

.product-desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--color-text-secondary);
  line-height: 1.8;
  margin-bottom: var(--space-12);
}

/* ── Acabados ── */
.swatches-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-6);
}

.swatches-selected {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--color-text-secondary);
}

.swatches-row {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-13);
}

.swatch {
  width: var(--swatch-size);
  height: var(--swatch-size);
  border-radius: var(--radius-full);
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.swatch:hover { transform: scale(1.1); }

.swatch.active {
  border-color: var(--color-text-primary);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-text-primary);
}

/* ── Especificaciones ── */
.specs {
  margin-bottom: var(--space-13);
}

.specs-label {
  margin-bottom: var(--space-6);
}

.spec-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: var(--space-3) 0;
  border-bottom: var(--border-thin);
  font-size: 13px;
}

.spec-key { color: var(--color-text-tertiary); font-weight: 400; }
.spec-val { color: var(--color-text-primary);  font-weight: 400; }

/* ── CTA ── */
.btn-primary {
  display: block;
  width: 100%;
  padding: var(--space-6);
  background: var(--color-brand);
  color: #fff;
  border: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  margin-top: auto;
  transition: background var(--transition-normal);
  text-align: center;
  text-decoration: none;
}

.btn-primary:hover { background: var(--color-brand-dark); }

.copy-confirm {
  font-size: 11px;
  color: var(--color-brand);
  letter-spacing: 0.08em;
  text-align: center;
  margin-top: var(--space-3);
  opacity: 0;
  transition: opacity var(--transition-slow);
}

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */
@media (max-width: 900px) {
  .catalog-title      { font-size: 28px; }
  .product-grid       { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .product-layout     { grid-template-columns: 1fr; }
  .product-gallery    { position: relative; top: 0; height: 70vw; flex-direction: column; }
  .gallery-thumbs     { flex-direction: row; width: 100%; height: var(--thumb-width); overflow-x: auto; overflow-y: hidden; }
  .gallery-thumb      { width: var(--thumb-width); height: var(--thumb-width); }
  .product-info       { padding: var(--space-11) var(--layout-padding-x-mobile) var(--space-13); }
  .product-back       { margin-bottom: var(--space-10); }
}

@media (max-width: 560px) {
  .product-grid { grid-template-columns: minmax(0, 1fr); }
}
