/* ==========================================================
   Home (index) — estilos específicos
   Dependen de tokens definidos en styles.css:
   --radius, --stroke, --shadow, --muted, --stage-bg, etc.
   ========================================================== */

/* ========== HERO ========== */
.home-hero { padding: 28px 0 10px; }

.home-hero .banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  box-shadow: var(--shadow);
}

.banner-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  padding: 22px;
}

.banner h1 {
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 1.1;
  margin: 0;
  letter-spacing: .2px;
}

.banner p {
  color: var(--muted);
  margin: .6rem 0 1.1rem;
}

.banner-figure {
  aspect-ratio: 16/9;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: var(--stage-bg);
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.banner-figure img { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  object-position: center;
  transition: transform 0.3s ease;
}

.banner-figure:hover img {
  transform: scale(1.05);
}

/* ========== LAYOUT SECCIONES ========== */
.sections { display: grid; gap: 22px; }

/* ========== DESKTOP STYLES ========== */
.meta-bar .badges {
  display: flex; /* Mostrar badges en desktop */
}

/* ========== MOBILE OPTIMIZATIONS ========== */
@media (max-width: 768px) {
  /* Hero section mobile */
  .home-hero {
    padding: 16px 0 8px;
  }
  
  .banner-inner {
    grid-template-columns: 1fr !important;
    gap: 20px;
    padding: 16px;
  }
  
  .banner h1 {
    font-size: 24px !important;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
  }
  
  .banner p {
    font-size: 14px !important;
    margin: 8px 0 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.4;
  }
  
  .banner-figure {
    aspect-ratio: 16/10;
    min-height: 200px;
    max-height: 300px;
  }
  
  .banner-figure img {
    object-fit: cover;
    object-position: center;
    width: 100%;
    height: 100%;
  }
  
  /* Sections mobile */
  .sections {
    gap: 16px !important;
  }
  
  .section-collection {
    padding: 16px 0 !important;
  }
  
  .section-header {
    margin-bottom: 16px !important;
  }
  
  .section-header h3 {
    font-size: 20px !important;
    margin: 0 !important;
  }
  
  .section-header .btn {
    font-size: 12px !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    transition: all 0.2s ease !important;
  }
  
  .section-header .btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    transform: translateY(-1px) !important;
  }
  
  
  /* Meta bar mobile */
  .meta-bar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .meta-bar .badges {
    margin-left: 0;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }
  
  .meta-bar .badge {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
  }
  
  .meta-bar .badge:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
  }
  
  /* Mejoras adicionales para móvil */
  .container {
    padding: 0 12px;
  }
  
  .cta-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .cta-row .btn {
    width: 100%;
    text-align: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .cta-row .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
}

@media (max-width: 480px) {
  .banner h1 {
    font-size: 20px !important;
    line-height: 1.3;
  }
  
  .banner p {
    font-size: 13px !important;
    line-height: 1.5;
  }
  
  .banner-inner {
    padding: 12px !important;
  }
  
  .banner-figure {
    aspect-ratio: 16/9;
    min-height: 180px;
    max-height: 250px;
  }
  
  .banner-figure img {
    object-fit: cover;
    object-position: center;
  }
  
  .cta-row .btn {
    padding: 10px 14px;
    font-size: 14px;
  }
  
  .meta-bar .badge {
    font-size: 11px;
    padding: 5px 8px;
  }
}

@media (max-width: 360px) {
  .banner h1 {
    font-size: 18px !important;
    line-height: 1.4;
  }
  
  .banner p {
    font-size: 12px !important;
    line-height: 1.6;
  }
  
  .banner-inner {
    padding: 10px !important;
  }
  
  .banner-figure {
    aspect-ratio: 16/9;
    min-height: 160px;
    max-height: 220px;
  }
  
  .banner-figure img {
    object-fit: cover;
    object-position: center;
  }
  
  .cta-row .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .meta-bar .badge {
    font-size: 10px;
    padding: 4px 6px;
  }
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 8px;
}

/* ========== GRID DE PRODUCTOS (coleccion.html) ========== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 14px;
}

.product-card {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.02);
  display: flex;
  flex-direction: column;
}

.product-card img {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  background: #0e0e0e;
}

.product-card .meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.price { font-weight: 800; }

/* Accesibilidad: foco visible en CTAs */
.product-card [role="button"]:focus-visible {
  outline: 2px solid rgba(255,255,255,.6);
  outline-offset: 2px;
  border-radius: 10px;
}

/* ========== CARRUSELES — reglas generales y anti “back” macOS ========== */
html, body { overscroll-behavior-x: none; }

.carousel,
.carousel-track {
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
}

.carousel-track { touch-action: pan-x pinch-zoom; }

/* ========== NOVEDADES COMO CARRUSEL INFINITO (transform: translateX) ========== */
/* Usa la misma técnica que los visores 3D */
#novedadesCarousel {
  position: relative;
  overflow: hidden;
  padding: 6px 0;
  user-select: none;
  touch-action: pan-y;
}

#novedadesCarousel > .carousel-track {
  display: flex !important;        /* fuerza fila flexible */
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 14px;
  width: max-content;              /* Permite que el track sea más ancho que el contenedor */

  /* Para carrusel infinito con transform */
  will-change: transform;
}
/* Scrollbar ya no es necesario con transform */

/* Cards: ancho fijo para provocar overflow horizontal */
#novedadesCarousel .product-card {
  flex: 0 0 260px !important;      /* base + evita estiramiento */
  width: 260px !important;
  min-width: 260px;
}

/* Anti-overscroll para el carrusel infinito */
#novedadesCarousel {
  overscroll-behavior-x: contain;
  overscroll-behavior-y: none;
}

/* Responsive: cards más anchas en móvil para mejor foco */
@media (max-width: 640px){
  #novedadesCarousel .product-card {
    flex-basis: 80vw !important;
    width: 80vw !important;
    min-width: 80vw;
  }
}

/* ========== RESPONSIVE GENERAL ========== */
@media (max-width: 1024px){
  .banner-inner { grid-template-columns: 1fr; }
  .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 640px){
  .product-grid { grid-template-columns: 1fr; }
}

/* ========== ACCESIBILIDAD / UX EXTRA ========== */
@media (prefers-reduced-motion: reduce){
  /* Carrusel infinito funciona igual en móvil */
}
