/* ── FUENTES ── */
@font-face {
  font-family: 'HV Fitzgerald';
  src: url('/fuentes/HV-Fitzgerald-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'HV Fitzgerald';
  src: url('/fuentes/HV-Fitzgerald-Italic.ttf') format('truetype');
  font-weight: 400;
  font-style: italic;
}
@font-face {
  font-family: 'Geist';
  src: url('/fuentes/Geist-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: 'Geist';
  src: url('/fuentes/Geist-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
}

/* ── VARIABLES ── */
:root {
  --verde-musgo:  #585E3C;
  --verde-pastel: #D5D5AB;
  --crema:        #F6F3E8;
  --texto-oscuro: #3a3d28;
  --texto-medio:  #6b6a56;
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html { scroll-behavior: smooth; }
body {
  font-family: 'Geist', sans-serif;
  font-weight: 400;
  overflow-x: hidden;
  background: var(--crema);
}

/* ── LOADER ── */
.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--verde-musgo);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.loader-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.page-loader-logo {
  width: min(150px, 40vw); height: auto; display: block;
  animation: page-loader-pulse 1.6s ease-in-out infinite;
}
@keyframes page-loader-pulse {
  0%, 100% { opacity: 0.45; transform: scale(0.96); }
  50%      { opacity: 1;    transform: scale(1); }
}

/* ── HERO ── */
.hero {
  position: relative;
  height: 100vh;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-image: url('/imagenes/logo/fondos/fondo_header5.webp');
  background-size: cover;
  background-position: center;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
}

/* Logo centrado arriba */
.hero-logo-corner {
  position: absolute;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: block;
  transition: opacity 0.2s;
}
.hero-logo-corner:hover { opacity: 0.85; }
.hero-logo-corner img {
  width: min(250px, 38vw);
  height: auto;
  display: block;
}

/* Lupa de búsqueda superior izquierda */
.hero-search-wrap {
  position: absolute;
  top: 24px;
  left: 32px;
  z-index: 10;
}
.hero-search-btn {
  width: 68px;
  height: 68px;
  border-radius: 34px;
  background: var(--verde-musgo);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--crema);
  opacity: 0.9;
  transition: opacity 0.2s ease;
}
.hero-search-btn:hover { opacity: 1; }

/* Overlay de búsqueda */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(58, 61, 40, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 100px 24px 24px;
  overflow-y: auto;
}
.search-overlay.open { display: flex; }

.search-box {
  background: var(--crema);
  border-radius: 6px;
  width: 100%;
  max-width: 620px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(88, 94, 60, 0.12);
  color: var(--texto-medio);
}
.search-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-family: 'Geist', sans-serif;
  font-size: 1rem;
  color: var(--texto-oscuro);
}
.search-input-row input::placeholder { color: rgba(107, 106, 86, 0.55); }
.search-close {
  background: none;
  border: none;
  color: var(--texto-medio);
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px 6px;
  transition: color 0.2s;
}
.search-close:hover { color: var(--texto-oscuro); }

.search-results {
  max-height: 58vh;
  overflow-y: auto;
  padding: 8px;
}
.search-hint,
.search-empty {
  padding: 32px 20px;
  text-align: center;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--texto-medio);
  opacity: 0.65;
}

.search-group-label {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--texto-medio);
  opacity: 0.55;
  padding: 12px 12px 6px;
}

.search-result {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 12px;
  border-radius: 4px;
  background: none;
  border: none;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.search-result:hover { background: rgba(88, 94, 60, 0.08); }
.search-result-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  background: rgba(88, 94, 60, 0.09);
  color: var(--verde-musgo);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.search-result-icon img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.4); }
.search-result-icon svg { width: 26px; height: 26px; }
.search-result-text h4 {
  font-family: 'HV Fitzgerald', serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--texto-oscuro);
  line-height: 1.3;
}
.search-result-text p {
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 0.8rem;
  color: var(--texto-medio);
  opacity: 0.75;
  margin-top: 2px;
}

/* Ícono de usuario superior derecha */
.hero-user-wrap {
  position: absolute;
  top: 24px;
  right: 32px;
  z-index: 10;
}

.hero-user-btn {
  width: 68px;
  height: 68px;
  border-radius: 34px;
  background: var(--verde-musgo);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0px;
  cursor: pointer;
  color: var(--crema);
  opacity: 0.9;
  overflow: hidden;
  transition: width 0.32s ease, border-radius 0.32s ease, gap 0.32s ease, opacity 0.2s ease;
}
.hero-user-btn:hover {
  width: 106px;
  border-radius: 34px;
  gap: 5px;
  opacity: 1;
}

.btn-chevron {
  flex-shrink: 0;
  width: 0;
  opacity: 0;
  transition: width 0.32s ease, opacity 0.25s ease;
}
.hero-user-btn:hover .btn-chevron {
  width: 13px;
  opacity: 1;
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--crema);
  border-radius: 3px;
  padding: 6px 0;
  min-width: 148px;
  box-shadow: 0 4px 20px rgba(58, 61, 40, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.user-dropdown.visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}
.user-dropdown-item {
  display: block;
  width: 100%;
  padding: 11px 18px;
  background: none;
  border: none;
  text-align: left;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 0.88rem;
  color: var(--texto-oscuro);
  cursor: pointer;
  transition: background 0.15s;
  letter-spacing: 0.02em;
}
.user-dropdown-item:hover { background: rgba(88, 94, 60, 0.08); }
.user-dropdown-item { text-decoration: none; }

.user-dropdown-divider {
  height: 1px;
  background: rgba(88, 94, 60, 0.12);
  margin: 4px 12px;
}

.user-dropdown-signout {
  color: #8a3a2e;
}
.user-dropdown-signout:hover { background: rgba(138, 58, 46, 0.07); }

/* Frase central (visible por defecto) */
.hero-quote {
  position: absolute;
  top: max(32%, 175px);
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
  width: 90%;
}
.hero-quote.hidden { opacity: 0; }

.hero-quote-text {
  font-family: 'HV Fitzgerald', serif;
  font-style: italic;
  font-size: clamp(1.4rem, 2.8vw, 2.2rem);
  color: var(--crema);
  letter-spacing: 0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
  line-height: 1.25;
}

.hero-quote-author {
  font-family: 'HV Fitzgerald', serif;
  font-style: normal;
  font-weight: 400;
  font-size: clamp(0.78rem, 1.4vw, 1rem);
  color: rgba(246, 243, 232, 0.65);
  letter-spacing: 0.12em;
  margin-top: 16px;
}

/* Texto central al hacer hover en los íconos */
.hero-label {
  position: absolute;
  top: max(32%, 175px);
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'HV Fitzgerald', serif;
  font-style: italic;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  color: var(--crema);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.25);
}
.hero-label.visible { opacity: 1; }

/* Íconos de navegación inferior izquierda */
.hero-nav {
  position: absolute;
  bottom: 44px;
  left: 48px;
  z-index: 10;
  display: flex;
  gap: 14px;
  align-items: flex-end;
}
.hero-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  opacity: 0.82;
  text-decoration: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.hero-nav-item:hover {
  opacity: 1;
  transform: scale(1.12);
}
/* Etiqueta debajo del ícono: solo en mobile/tablet, donde no hay hover cómodo */
.hero-nav-label {
  display: none;
  font-family: 'Geist', sans-serif;
  font-weight: 500;
  font-size: 0.64rem;
  letter-spacing: 0.03em;
  color: var(--crema);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
}
.hero-nav-item img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  display: block;
}

/* La etiqueta se activa por capacidad de hover real, no por ancho de pantalla:
   así una tablet en horizontal (que cae en el mismo ancho que una notebook)
   también la recibe, mientras que una notebook con mouse no la ve de más. */
@media (hover: none), (pointer: coarse) {
  .hero-nav-label { display: block; }
}

/* ── RESPONSIVE ──
   1366px → notebooks más chicas (13"/14", muy común 1366×768)
   1024px → notebook compacta / tablet horizontal
   768px  → tablet vertical (activa el layout "mobile")
   430px  → teléfonos en general (incluye iPhone Pro Max)
   400px  → teléfonos angostos (iPhone estándar / mini / SE)
*/
@media (max-width: 1366px) {
  .hero-logo-corner img { width: min(234px, 37vw); }

  .hero-search-wrap { top: 22px; left: 30px; }
  .hero-search-btn  { width: 67px; height: 67px; border-radius: 33.5px; }

  .hero-user-wrap { top: 22px; right: 30px; }
  .hero-user-btn  { width: 67px; height: 67px; border-radius: 33.5px; }
  .hero-user-btn:hover { width: 104px; }

  .hero-nav { gap: 13px; left: 44px; bottom: 40px; }
  .hero-nav-item img { width: 67px; height: 67px; }
}

@media (max-width: 1024px) {
  .hero-logo-corner img { width: min(220px, 36vw); }
  .hero-nav { gap: 12px; left: 40px; bottom: 38px; }
  .hero-nav-item img { width: 66px; height: 66px; }

  .hero-search-btn { width: 66px; height: 66px; border-radius: 33px; }
  .hero-user-btn { width: 66px; height: 66px; border-radius: 33px; }
}

@media (max-width: 768px) {
  .hero-logo-corner { top: 20px; }
  .hero-logo-corner img { width: min(140px, 38vw); height: auto; }

  .hero-search-wrap { left: 20px; top: 20px; }
  .hero-search-btn { width: 48px; height: 48px; border-radius: 24px; }
  .hero-search-btn svg { width: 17px; height: 17px; }

  .hero-user-wrap { right: 20px; top: 20px; }
  .hero-user-btn { width: 48px; height: 48px; border-radius: 24px; }
  .hero-user-btn:hover { width: 48px; gap: 0; }
  .btn-chevron { display: none; }

  .search-overlay { padding: 84px 16px 16px; }
  .search-input-row { padding: 16px 18px; }
  .search-results { max-height: 64vh; }

  .hero-nav { left: 20px; bottom: 28px; gap: 14px; }
  .hero-nav-item img { width: 54px; height: 54px; }

  .hero-quote { width: 78%; }
  .hero-quote-text { font-size: clamp(1rem, 4.5vw, 1.5rem); line-height: 1.2; }
  .hero-quote-author { font-size: clamp(0.68rem, 2.8vw, 0.85rem); margin-top: 10px; }

  .hero-label { font-size: clamp(1.4rem, 7vw, 2.4rem); }
}

/* Teléfonos (incluye iPhone Pro Max) */
@media (max-width: 430px) {
  .hero-logo-corner { top: 14px; }
  .hero-logo-corner img { width: min(120px, 36vw); }

  .hero-search-wrap { left: 14px; top: 14px; }
  .hero-search-btn { width: 42px; height: 42px; border-radius: 21px; }
  .hero-search-btn svg { width: 15px; height: 15px; }

  .hero-user-wrap { right: 14px; top: 14px; }
  .hero-user-btn { width: 42px; height: 42px; border-radius: 21px; }

  .hero-nav { left: 14px; bottom: 20px; gap: 10px; }
  .hero-nav-item img { width: 46px; height: 46px; }
  .hero-nav-label { font-size: 0.58rem; }

  .hero-quote { width: 86%; }
  .hero-quote-text { font-size: clamp(0.95rem, 5vw, 1.3rem); }

  .search-overlay { padding: 76px 12px 12px; }
  .search-result-icon { width: 38px; height: 38px; }
}

/* Teléfonos angostos: iPhone estándar, mini, SE */
@media (max-width: 400px) {
  .hero-logo-corner img { width: min(105px, 34vw); }
  .hero-nav { gap: 8px; }
  .hero-nav-item img { width: 42px; height: 42px; }
  .hero-nav-label { font-size: 0.54rem; }
  .hero-quote-text { font-size: clamp(0.86rem, 5vw, 1.15rem); }
  .hero-label { font-size: clamp(1.2rem, 8vw, 2rem); }

  .hero-search-btn { width: 38px; height: 38px; border-radius: 19px; }
  .hero-search-btn svg { width: 14px; height: 14px; }
  .hero-user-btn { width: 38px; height: 38px; border-radius: 19px; }
}

/* En pantallas sin hover cómodo (celular/tablet), los íconos de navegación
   van centrados abajo en vez de pegados a la izquierda. Va al final del
   archivo a propósito: así gana por orden a los "left" de los breakpoints
   de arriba, en vez de depender de un ancho puntual. */
@media (hover: none), (pointer: coarse) {
  .hero-nav { left: 50%; transform: translateX(-50%); }
}
