/**
 * Portal Riedel - CSS consolidado y ordenado
 * 1. Fuentes locales
 * 2. Base / Reset
 * 3. Variables y tema
 * 4. Componentes (navegación, cards, formularios)
 * 5. Utilidades
 */

/* ========== 1. FUENTES LOCALES (public/fonts) ========== */
@font-face {
  font-family: 'Function';
  src: url('../fonts/function_regular.eot');
  src: url('../fonts/function_regular.eot?#iefix') format('embedded-opentype'),
       url('../fonts/function_regular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* function_bold.woff y function_italic.woff provocan OTS parsing error; se usa síntesis del navegador */
@font-face {
  font-family: 'Function';
  src: url('../fonts/function_regular.eot');
  src: url('../fonts/function_regular.eot?#iefix') format('embedded-opentype'),
       url('../fonts/function_regular.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Function';
  src: url('../fonts/function_regular.eot');
  src: url('../fonts/function_regular.eot?#iefix') format('embedded-opentype'),
       url('../fonts/function_regular.woff') format('woff');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

/* ========== 2. BASE / RESET ========== */
:root {
  /* Altura del header fijo; main usa este valor en padding-top para no solaparse */
  --header-height: 5rem;
}
@media (min-width: 768px) {
  :root {
    --header-height: 6.7rem;
  }
}

body {
  font-family: 'Function', sans-serif;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========== TRANSICIONES DE ENTRADA (TODAS LAS VISTAS) ========== */
.content-entrance > * {
  opacity: 0;
  animation: contentEntrance 0.5s ease-out forwards;
}
.content-entrance > *:nth-child(1) { animation-delay: 0.05s; }
.content-entrance > *:nth-child(2) { animation-delay: 0.12s; }
.content-entrance > *:nth-child(3) { animation-delay: 0.19s; }
.content-entrance > *:nth-child(4) { animation-delay: 0.26s; }
.content-entrance > *:nth-child(5) { animation-delay: 0.33s; }
.content-entrance > *:nth-child(6) { animation-delay: 0.4s; }
.content-entrance > *:nth-child(7) { animation-delay: 0.47s; }
.content-entrance > *:nth-child(8) { animation-delay: 0.54s; }
.content-entrance > *:nth-child(n+9) { animation-delay: 0.6s; }
@keyframes contentEntrance {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

details > summary::-webkit-details-marker {
  display: none;
}

/* ========== 2. MATERIAL SYMBOLS ========== */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ========== 3. COMPONENTES - NAVEGACIÓN ========== */
.nav-link {
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.3s;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0.5rem;
  left: 0;
  width: 100%;
  height: 2px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.nav-link:hover {
  color: #fff;
}
.nav-link:hover::after {
  transform: scaleX(1);
}
/* Ítem activo (sección actual): subrayado visible */
.nav-link-active::after {
  transform: scaleX(1);
}
.nav-link-active:not(.text-accent-gold) {
  color: #fff;
}
/* Menú móvil: ítem activo con barra dorada */
.nav-link-mobile.border-l-accent-gold {
  border-left-color: #C5A059;
}
/* Sin fondo ni resaltado al hover/tap en botones del header (hamburguesa, carrito) */
header button {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}
/* Ofertas: subrayado en dorado para combinar con el borde */
.nav-link.border-accent-gold::after {
  background: #C5A059;
}
.nav-item {
  display: flex;
  align-items: center;
  align-self: stretch;
  position: relative;
}

.mega-menu {
  position: fixed;
  left: 0;
  right: 0;
  top: 5rem;
  width: 100%;
  background: #050505;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 50;
}
@media (min-width: 768px) {
  .mega-menu {
    top: 6.8rem;
  }
}

.nav-item:hover .mega-menu {
  opacity: 1;
  visibility: visible;
}

/* ========== TRANSICIONES DE CONTENIDO (GLOBAL) ========== */
a {
  transition: color 0.25s ease, background-color 0.25s ease, border-color 0.25s ease, opacity 0.25s ease;
}
.high-contrast-card,
[class*="card"] {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.high-contrast-card img,
.collection-card img,
[class*="card"] img,
.group img {
  transition: transform 0.4s ease, opacity 0.4s ease, filter 0.4s ease;
}
.collection-card .overlay-content {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== 3. COMPONENTES - CARDS Y LAYOUT ========== */
.high-contrast-card {
  border: 1px solid rgba(5, 5, 5, 0.05);
  transition: all 0.5s;
}
.high-contrast-card:hover {
  border-color: rgba(5, 5, 5, 0.2);
}

.italic-tagline {
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

.product-card:hover .cart-button {
  opacity: 1;
  transform: translateY(0);
}

.cart-button {
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Split layout (detalle producto): en móvil columna única, en lg+ dos columnas */
.split-layout {
  display: grid;
  grid-template-columns: 1fr;
  min-height: auto;
}
@media (min-width: 1024px) {
  .split-layout {
    grid-template-columns: 1.2fr 0.8fr;
    min-height: calc(100vh - 80px);
  }
}

/* ========== 3. COMPONENTES - FORMULARIOS Y INPUTS ========== */
.input-minimal {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-left: 0;
  padding-right: 0;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-minimal:focus {
  outline: none;
  box-shadow: none;
  border-bottom-color: #ffffff;
  background: transparent;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-premium {
  background-color: #ffffff;
  color: #000000;
  transition: all 0.3s ease;
  font-family: 'Inter', sans-serif;
}

.btn-premium:hover {
  background-color: rgb(197 160 89);
  color: #050505;
  letter-spacing: 0.15em;
}

/* Botones: transición de color al hacer hover */
button {
  transition: background-color 0.25s ease, color 0.25s ease;
}
button:hover {
  background-color: rgb(197 160 89);
  color: #050505;
}

/* Icono carrito en header: sin fondo al hover */
#cart-offcanvas-open:hover {
  background-color: transparent;
}

/* Icono búsqueda en header: sin fondo */
#search-overlay-open {
  background-color: transparent;
}
#search-overlay-open:hover {
  background-color: transparent;
}

/* ========== 3. COMPONENTES - SCROLLBAR ========== */
.custom-scrollbar::-webkit-scrollbar {
  width: 2px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

.custom-scrollbar::-webkit-scrollbar {
  width: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #444;
}

/* ========== 3. COMPONENTES - TOGGLE / FILTROS ========== */
.toggle-switch {
  position: relative;
  display: inline-flex;
  height: 1rem;
  width: 2rem;
  flex-shrink: 0;
  cursor: pointer;
  align-items: center;
  border-radius: 9999px;
  border: 2px solid transparent;
  transition: background-color 0.2s;
}
.toggle-switch:focus {
  outline: none;
}

.toggle-dot {
  pointer-events: none;
  display: inline-block;
  height: 0.75rem;
  width: 0.75rem;
  transform: translateX(0);
  border-radius: 9999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
  transition: transform 0.2s ease-in-out;
}

input:checked + .toggle-switch .toggle-dot {
  transform: translateX(1rem);
}

input:checked + .toggle-switch {
  background: rgba(255, 255, 255, 0.4);
}

.filter-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: 1.5rem;
  display: block;
}
@media (max-width: 639px) {
  .filter-section-title {
    font-size: 13px;
  }
}

/* ========== 3. COMPONENTES - BADGES Y ETIQUETAS ========== */
.discount-badge {
  background: #059669;
  color: #fff;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.luxury-thumbnail {
  background: #F8F8F8;
}

/* ========== 3. COMPONENTES - CHECKOUT / PROGRESO ========== */
.progress-line {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.progress-line::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  height: 1px;
  width: 100%;
  background: #E5E5E5;
  z-index: -10;
}

/* ========== 3. COMPONENTES - TIPOGRAFÍA ========== */
.riedel-logo {
  letter-spacing: 0.15em;
  font-weight: 300;
}

.font-function {
  font-family: 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

.function-bold {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
}

.function-italic {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-style: italic;
}

.gold-text {
  color: #C5A059;
}

/* ========== 4. UTILIDADES ========== */
.no-scrollbar::-webkit-scrollbar {
  display: none;
}

.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.bw-photo {
  filter: grayscale(100%) contrast(115%) brightness(0.8);
}

.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.minimal-border {
  border: 1px solid #000000;
}

/* ========== 3. COMPONENTES - MARCAS ========== */
.brand-logo-grayscale {
  filter: grayscale(100%) contrast(200%);
  transition: filter 0.3s ease;
}
.brand-logo-grayscale:hover {
  filter: grayscale(0%) contrast(100%);
}

/* ========== 3. COMPONENTES - COLECCIONES ========== */
.function-bold-tight {
  font-weight: 900;
  letter-spacing: -0.05em;
}
.coleccion-reveal {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.coleccion-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.coleccion-reveal:nth-child(1).is-visible { transition-delay: 0s; }
.coleccion-reveal:nth-child(2).is-visible { transition-delay: 0.1s; }
.coleccion-reveal:nth-child(3).is-visible { transition-delay: 0.2s; }
.coleccion-reveal:nth-child(4).is-visible { transition-delay: 0.1s; }
.coleccion-reveal:nth-child(5).is-visible { transition-delay: 0.2s; }
.coleccion-reveal:nth-child(6).is-visible { transition-delay: 0.3s; }
.coleccion-reveal:nth-child(n+7).is-visible { transition-delay: 0.2s; }
.function-italic-light {
  font-style: italic;
  font-weight: 300;
}
.collection-card:hover .overlay-content {
  transform: translateY(-10px);
}
.collection-card img {
  transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.collection-card:hover img {
  transform: scale(1.05);
}

/* ========== 3. COMPONENTES - QUIÉNES SOMOS ========== */
.b-w-contrast {
  filter: grayscale(100%) contrast(1.1);
}
.hero-gradient {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.8) 100%);
}

/* Checkout: método de pago seleccionado */
.metodo-pago-option:has(input:checked) {
  border-color: #C5A059;
  background: rgba(255, 255, 255, 0.1);
}
.metodo-pago-option:has(input:checked) .material-symbols-outlined {
  color: #C5A059;
}
