/* ══════════════════════════════════════════════════════════════
   home.css — Rediseño inspirado en Dafiti / Fashion E-commerce
   Fuentes: Inter + Playfair Display (Google Fonts)
   Paleta: Blanco limpio, gris oscuro, acento terracota
══════════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS (HSL System) ─────────────────────────────── */
:root {
  /* Palette */
  --h-brand:      0;      /* Red base */
  --s-brand:      65%;
  --l-brand:      45%;

  --bg:           hsl(0, 0%, 100%);
  --bg-subtle:    hsl(0, 0%, 98%);
  --surface:      hsl(0, 0%, 100%);
  --dark:         hsl(0, 0%, 7%);
  --gray-700:     hsl(0, 0%, 24%);
  --gray-500:     hsl(0, 0%, 46%);
  --gray-200:     hsl(0, 0%, 91%);
  --gray-100:     hsl(0, 0%, 96%);

  --accent:       hsl(var(--h-brand), var(--s-brand), var(--l-brand));
  --accent-soft:  hsl(var(--h-brand), var(--s-brand), 97%);
  --success:      hsl(145, 63%, 42%);

  /* Typography */
  --font-sans:    'Inter', sans-serif;
  --font-serif:   'Playfair Display', serif;

  /* Spacing & Effects */
  --radius-sm:    2px;
  --radius:       4px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.05);
  --shadow-lg:    0 20px 40px rgba(0,0,0,0.1);
  --transition:   0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ══ NEW HERO (VOGUE-STYLE) ════════════════════════════════════ */
.hero-wrapper {
  position: relative;
  height: 40vh;
  min-height: 280px;
  overflow: hidden;
  background: var(--dark);
}

.hero-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  animation: hero-zoom 20s infinite alternate linear;
}

@keyframes hero-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.1); }
}

.hero-gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 60%),
              linear-gradient(to top, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0) 30%);
  z-index: 1;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8%;
  z-index: 2;
  color: #fff;
}

.hero-content {
  max-width: 700px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 20px;
  opacity: 0.9;
}

.hero-eyebrow-line {
  height: 1px;
  width: 40px;
  background: #fff;
  opacity: 0.5;
}

.hero-heading {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 10vw, 7rem);
  line-height: 0.9;
  margin-bottom: 30px;
  font-weight: 700;
  letter-spacing: -2px;
}

.hero-heading span { display: block; }
.hero-heading-light { font-weight: 400; font-style: italic; opacity: 0.95; font-size: 0.8em; }
.hero-heading-bold { font-weight: 800; text-transform: uppercase; }

.hero-subtext {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 40px;
  max-width: 400px;
  opacity: 0.9;
  letter-spacing: 0.5px;
}

.hero-cta-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.btn-hero {
  padding: 18px 35px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.btn-hero--primary {
  background: #fff;
  color: var(--dark);
}

.btn-hero--primary:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-5px);
}

.btn-hero--ghost {
  border-color: rgba(255,255,255,0.4);
  color: #fff;
  text-decoration: none;
}

.btn-hero--ghost:hover {
  border-color: #fff;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
  color: #fff;
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  right: 8%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.hero-scroll-line {
  width: 1px;
  height: 60px;
  background: linear-gradient(to bottom, #fff, transparent);
}

.hero-scroll-text {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  writing-mode: vertical-lr;
}

/* ══ SECTION HEADER ═══════════════════════════════════════════ */
.section-header {
  padding: 48px 0 16px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 8px;
}
.section-header h1 {
  font-family: var(--font-sans);
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--dark);
  margin-bottom: 4px;
}
.section-header .underline-accent {
  display: none; /* Dafiti uses a clean line, not a colored bar */
}
.section-header p {
  color: var(--gray-500);
  font-size: 0.88rem;
  margin: 0;
}
.results-count {
  font-size: 0.82rem;
  color: var(--gray-500);
  font-weight: 500;
}

/* ══ SORT BAR (Dafiti-style) ══════════════════════════════════ */
.sort-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.sort-bar-label {
  font-size: 0.8rem;
  color: var(--gray-500);
  font-weight: 500;
}
.sort-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sort-chip {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 100px;
  padding: 5px 14px;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.sort-chip:hover,
.sort-chip.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

/* ══ LAYOUT GRID ═════════════════════════════════════════════ */
.products-grid { padding-bottom: 72px; }
.product-col   { padding: 6px 8px; }

/* ══ SIDEBAR — Panel de Filtros Premium ═════════════════════ */

/* Wrapper desktop */
.filter-sidebar {
  padding-right: 28px;
  border-right: 1px solid var(--gray-200);
}

/* ── Header del panel ── */
.filter-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--dark);
}
.filter-panel-title {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--dark);
}
.filter-clear-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color var(--transition);
}
.filter-clear-link:hover { color: var(--accent); text-decoration: none; }

/* ── Sección acordeón (Categoría, Marca, etc.) ── */
.filter-section {
  border-bottom: 1px solid var(--gray-200);
}

.filter-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
}
.filter-section-toggle:hover .filter-section-label { color: var(--accent); }

.filter-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--dark);
  transition: color var(--transition);
}

.toggle-chevron {
  color: var(--gray-500);
  flex-shrink: 0;
  transition: transform 0.3s ease;
}
.filter-section-toggle.collapsed .toggle-chevron {
  transform: rotate(-90deg);
}

.filter-section-body {
  padding-bottom: 14px;
}

/* ── Filas de checkbox ── */
.filter-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
}
.filter-check-row--child {
  /* La indentación la maneja .filter-subcats con border-left + margin */
}


.filter-checkbox {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--dark);
  border-radius: 2px;
  cursor: pointer;
}
.filter-checkbox--hidden {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-label {
  font-size: 0.84rem;
  color: var(--gray-700);
  cursor: pointer;
  line-height: 1.4;
  transition: color var(--transition);
  user-select: none;
}
.filter-label:hover { color: var(--dark); }
.filter-label--child {
  font-size: 0.80rem;
  color: var(--gray-500);
}
.filter-label--child:hover { color: var(--dark); }

/* ── Grupo padre → hijos ── */
.filter-parent-group {
  /* Sin indentación en el padre: todos los items de primer nivel tienen el mismo aspecto */
}
/* Resaltar el borde cuando hay algo seleccionado dentro */
.filter-parent-group:has(input:checked) {
  border-color: var(--dark);
}

/* Las subcategorías están ocultas por defecto.
   Se muestran via CSS puro cuando .parent-cb está :checked
   O cuando el grupo tiene la clase .expanded (añadida por JS al clicar el nombre) */
.filter-subcats {
  display: none;
  border-left: 2px solid var(--gray-200);
  margin: 2px 0 6px 8px;
  padding-left: 10px;
  padding-top: 4px;
  transition: border-color var(--transition);
}
.filter-parent-group:has(> .filter-check-row > .parent-cb:checked) .filter-subcats,
.filter-parent-group.expanded .filter-subcats {
  display: block;
}

/* Indicador visual en la label del padre: muestra que tiene hijos */
.filter-label--parent {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.filter-label--parent::after {
  content: '›';
  font-size: 0.9rem;
  color: var(--gray-500);
  transition: transform 0.2s ease;
  line-height: 1;
  display: inline-block;
}
/* Rotar la flecha cuando el acordeón está abierto (.expanded o parent :checked) */
.filter-parent-group.expanded .filter-label--parent::after,
.filter-parent-group:has(> .filter-check-row > .parent-cb:checked) .filter-label--parent::after {
  transform: rotate(90deg);
  color: var(--dark);
}


/* ── Size chips grid ── */
.size-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 8px;
}
.size-chip-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 6px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--gray-200);
  color: var(--gray-700);
  cursor: pointer;
  border-radius: 2px;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}
.size-chip-label:hover {
  border-color: var(--dark);
  color: var(--dark);
}
.size-chip-label.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
}

/* ── Botones de acción ── */
.filter-actions {
  padding: 18px 0 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-filter-apply {
  width: 100%;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition), transform 0.15s;
  font-family: var(--font-sans);
}
.btn-filter-apply:hover {
  background: var(--accent);
  transform: translateY(-1px);
}
.btn-filter-clear {
  width: 100%;
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 0;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--gray-500);
  text-decoration: none;
  text-align: center;
  display: block;
  margin-top: 8px;
  transition: border-color var(--transition), color var(--transition);
}
.btn-filter-clear:hover {
  border-color: var(--dark);
  color: var(--dark);
  text-decoration: none;
}

/* Mobile filter toggle */
.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 6px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 9px 18px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: 0.5px;
}

/* Drawer: siempre oculto por defecto (overlay fijo, fuera del flow) */
.filter-sidebar-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1050;
}
.filter-sidebar-wrapper.open {
  display: block;
}
.filter-sidebar-inner {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #fff;
  overflow-y: auto;
  padding: 24px 20px;
  box-shadow: 4px 0 32px rgba(0,0,0,0.18);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.filter-sidebar-wrapper.open .filter-sidebar-inner {
  transform: translateX(0);
}
.filter-close-btn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 20px;
}
.btn-filter-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--dark);
  line-height: 1;
  padding: 0;
}

@media (max-width: 767px) {
  .filter-toggle-btn { display: flex; }
}

/* ══ PRODUCT CARD — Estilo Dafiti ══════════════════════════════
   - Imagen cuadrada sin padding (full-bleed)
   - Fondo blanco
   - Hover: sube el botón desde abajo
══════════════════════════════════════════════════════════════ */
.product-card {
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: 0;
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}
.product-card:hover {
  border-color: var(--gray-200);
  box-shadow: var(--shadow-hover);
}

/* ── Badge ──── */
.badge-out {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(17,17,17,0.85);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.badge-new {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 2px;
  z-index: 2;
}

/* ── Imagen (full-bleed, 4:5 ratio como Dafiti/Falabella) ──── */
.card-img-wrap {
  background: var(--gray-100);
  aspect-ratio: 4 / 5;
  overflow: hidden;
  display: block;
  position: relative;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s cubic-bezier(.4,0,.2,1);
}
.product-card:hover .card-img-wrap img {
  transform: scale(1.04);
}

/* ── Botón Add to Cart — Desliza desde abajo en hover ──── */
.card-action-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
  z-index: 3;
  padding: 0 12px 12px;
}
.product-card:hover .card-action-overlay {
  transform: translateY(0);
}

/* ── Mobile: botón siempre visible ──── */
@media (max-width: 767px) {
  .card-action-overlay {
    position: static;
    transform: none !important;
    padding: 0 10px 10px;
  }
}

/* ── Cuerpo ──── */
.card-body-custom {
  padding: 12px 12px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-brand {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 3px;
}
.product-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc {
  font-size: 0.76rem;
  color: var(--gray-500);
  line-height: 1.45;
  margin-bottom: 6px;
  display: none; /* oculto en mobile, visible en desktop con espacio */
}
@media (min-width: 576px) {
  .product-desc { display: block; }
}

.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: auto;
  padding-bottom: 4px;
}
.product-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
  letter-spacing: -0.3px;
}
.product-price-currency {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--gray-500);
  margin-right: 1px;
}
.stars {
  color: #F5A623;
  font-size: 0.65rem;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

/* ══ CARD FOOTER / BOTÓN ════════════════════════════════════ */
.card-footer-custom {
  padding: 0 12px 12px;
  background: transparent;
  border-top: none;
}

/* btn-cart: el único botón — sin Buy Now */
.btn-cart {
  width: 100%;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background var(--transition), transform 0.15s;
  font-family: var(--font-sans);
}
.btn-cart:hover {
  background: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}
.btn-cart:active { transform: translateY(0); }

/* Estado agregado */
.btn-cart.added {
  background: var(--success);
  animation: pop 0.2s ease;
}
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}

/* Botón Unavailable */
.btn-out {
  width: 100%;
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 10px 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  cursor: not-allowed;
  display: block;
  font-family: var(--font-sans);
}

/* ══ EMPTY STATE ══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 80px 24px;
}
.empty-state-icon {
  font-size: 3.5rem;
  margin-bottom: 16px;
  opacity: 0.25;
}
.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  color: var(--gray-700);
  margin-bottom: 8px;
}
.empty-state p { color: var(--gray-500); font-size: 0.9rem; }
.btn-empty {
  display: inline-block;
  margin-top: 20px;
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 32px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-decoration: none;
  transition: background var(--transition);
}
.btn-empty:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ══ TOAST ══════════════════════════════════════════════════ */
#cart-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark);
  color: #fff;
  padding: 14px 28px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font-sans);
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease, transform 0.28s ease;
  white-space: nowrap;
}
#cart-toast.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
#cart-toast .toast-icon {
  background: var(--success);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  flex-shrink: 0;
}
#cart-toast .toast-link {
  color: #F5A623;
  font-weight: 600;
  text-decoration: none;
  margin-left: 2px;
}
#cart-toast .toast-link:hover { text-decoration: underline; }

/* ══ RESPONSIVE GRID ══════════════════════════════════════════ */
@media (max-width: 575.98px) {
  .card-img-wrap      { aspect-ratio: 1 / 1; }
  .card-body-custom   { padding: 8px 10px 4px; }
  .card-footer-custom { padding: 0 10px 10px; }
  .product-name       { font-size: 0.8rem; }
  .product-price      { font-size: 0.92rem; }
  .btn-cart           { padding: 9px 0; font-size: 0.74rem; }

  /* Hero mobile */
  .hero-wrapper       { height: 75vh; min-height: 380px; }
  .hero-overlay       { padding: 0 6%; }
  .hero-heading       { font-size: clamp(2.2rem, 12vw, 3.5rem); }
  .hero-subtext       { font-size: 0.95rem; margin-bottom: 28px; }
  .hero-cta-group     { flex-direction: column; align-items: flex-start; gap: 12px; }
  .btn-hero           { padding: 15px 28px; }
  .hero-scroll-hint   { display: none; }
  .hero-eyebrow       { margin-bottom: 14px; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
  .hero-wrapper       { height: 70vh; }
  .hero-overlay       { padding: 0 7%; }
  .hero-heading       { font-size: clamp(2.5rem, 10vw, 4rem); }
}

@media (min-width: 768px) and (max-width: 991px) {
  .product-col { flex: 0 0 33.333%; max-width: 33.333%; }
  .hero-wrapper { height: 75vh; }
}

@media (min-width: 992px) {
  /* 4 columnas en el área de contenido */
  .product-col {
    flex: 0 0 25%;
    max-width: 25%;
  }
}

/* ══ RESET BASE NECESARIO ═══════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
body, html {
  background: var(--bg);
  font-family: var(--font-sans);
  color: var(--dark);
  -webkit-font-smoothing: antialiased;
}