@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;800;900&display=swap');

/* =========================
   BASE GENERAL ESCOLI
   ========================= */

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: 'Roboto', sans-serif;
  color: #333;
  line-height: 1.6;
  background-color: #f8f9fa;
}

img,
video {
  max-width: 100%;
  height: auto;
}

/* =========================
   BASE DEL HEADER
   ========================= */
.hdv-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9000;
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(115deg, #1a0b2e 0%, #370C56 55%, #451044 100%);
  transition: box-shadow .35s ease, background .35s ease;
}

/* Hairline dorada superior — la firma */
.hdv-header::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232,202,160,.6), transparent);
  pointer-events: none;
}

/* Estado al hacer scroll */
.hdv-header.hdv-scrolled {
  background: rgba(26, 11, 46, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .35);
}

.hdv-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 28px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

/* =========================
   LOGO
   ========================= */
.hdv-logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  text-decoration: none;
}

.hdv-logo img {
  height: 44px;
  width: auto;
  transition: filter .35s ease, transform .35s ease;
  filter: drop-shadow(0 0 6px rgba(216, 178, 110, .18));
}

.hdv-logo:hover img {
  filter: drop-shadow(0 0 12px rgba(216, 178, 110, .4));
  transform: scale(1.04);
}

/* =========================
   NAV (DESKTOP)
   ========================= */
.hdv-nav {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.hdv-nav-main {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.hdv-nav-auth {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 14px;
}

.hdv-link {
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .3px;
  padding: 9px 15px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: all .3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.hdv-link .hdv-ico {
  color: #d8b26e;
  font-size: 12.5px;
  opacity: .85;
  transition: transform .3s ease;
}

.hdv-link:hover {
  background: rgba(216, 178, 110, .10);
  border-color: rgba(216, 178, 110, .35);
  color: #f3e3c5;
}

.hdv-link:hover .hdv-ico { transform: scale(1.12); }

.hdv-link:focus-visible,
.hdv-btn-login:focus-visible,
.hdv-cart:focus-visible,
.hdv-burger:focus-visible,
.hdv-user-trigger:focus-visible {
  outline: 2px solid #d8b26e;
  outline-offset: 3px;
}

.hdv-caret {
  font-size: 10px;
  opacity: .6;
  transition: transform .25s ease;
}

/* =========================
   DROPDOWNS (DESKTOP: hover)
   ========================= */
.hdv-drop { position: relative; }

.hdv-drop-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  min-width: 290px;
  padding: 10px;
  margin: 0;
  list-style: none;
  background: rgba(26, 11, 46, .92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(216, 178, 110, .25);
  border-radius: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .28s ease;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  z-index: 9100;
}

/* Puente invisible: no se pierde el hover al bajar al menú */
.hdv-drop-menu::before {
  content: '';
  position: absolute;
  top: -14px; left: 0; right: 0;
  height: 14px;
}

.hdv-drop:hover .hdv-drop-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hdv-drop:hover .hdv-caret { transform: rotate(180deg); }

.hdv-drop-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, .88);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 14px;
  border-radius: 11px;
  border-left: 2px solid transparent;
  transition: all .22s ease;
}

.hdv-drop-link i {
  color: #d8b26e;
  width: 18px;
  text-align: center;
  font-size: 13px;
}

.hdv-drop-link:hover {
  background: linear-gradient(90deg, rgba(216, 178, 110, .14), transparent);
  border-left-color: #d8b26e;
  color: #fff;
}

/* =========================
   CTA LOGIN (invitado)
   ========================= */
.hdv-btn-login {
  background: linear-gradient(135deg, #e8caa0, #d8b26e 55%, #c69a55);
  color: #2a0a3d;
  border-radius: 999px;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .5px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(216, 178, 110, .3);
  transition: all .3s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hdv-btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(216, 178, 110, .45);
}

/* =========================
   CARRITO
   ========================= */
.hdv-cart {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, .08);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-decoration: none;
  transition: all .3s ease;
}

.hdv-cart:hover {
  background: rgba(216, 178, 110, .2);
  color: #f3e3c5;
}

.hdv-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #F74436;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(247, 68, 54, .5);
}

/* =========================
   USER DROPDOWN (autenticado)
   ========================= */
.hdv-user { position: relative; }

.hdv-user-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid transparent;
  transition: all .25s ease;
}

.hdv-user-trigger:hover {
  background: rgba(216, 178, 110, .14);
  border-color: rgba(216, 178, 110, .3);
}

.hdv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8caa0, #d8b26e 55%, #b8863f);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #2a0a3d;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(216, 178, 110, .3);
}

.hdv-user-caret {
  font-size: 10px;
  color: rgba(255, 255, 255, .85);
  transition: transform .25s ease;
}

.hdv-user.hdv-open .hdv-user-caret { transform: rotate(180deg); }

.hdv-user-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 240px;
  background: rgba(26, 11, 46, .95);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(216, 178, 110, .25);
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .25s ease;
  z-index: 9200;
}

.hdv-user.hdv-open .hdv-user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hdv-user-info {
  padding: 8px 10px 12px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(216, 178, 110, .18);
}

.hdv-user-info::before {
  content: "Mi cuenta";
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #d8b26e;
  margin-bottom: 6px;
}

.hdv-user-info strong {
  display: block;
  font-size: 15px;
  color: #fff;
  font-weight: 700;
  margin-bottom: 3px;
  line-height: 1.25;
}

.hdv-user-info small {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, .55);
  line-height: 1.35;
  word-break: break-word;
}

.hdv-user-menu a,
.hdv-user-menu button {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px 12px;
  border: none;
  background: transparent;
  border-radius: 11px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, .88);
  transition: all .2s ease;
  border-left: 2px solid transparent;
}

.hdv-user-menu a:hover,
.hdv-user-menu button:hover {
  background: linear-gradient(90deg, rgba(216, 178, 110, .14), transparent);
  border-left-color: #d8b26e;
  color: #fff;
}

.hdv-user-menu i {
  width: 18px;
  text-align: center;
  color: #d8b26e;
  font-size: 13px;
}

.hdv-user-menu form { margin: 0; }

.hdv-user-menu .hdv-logout { color: #ff8a80; }

/* =========================
   BOTÓN HAMBURGUESA
   ========================= */
.hdv-burger {
  display: none;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all .3s ease;
  z-index: 9300;
}

.hdv-burger span {
  display: block;
  width: 21px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all .35s ease;
}

.hdv-burger.hdv-open {
  border-color: rgba(216, 178, 110, .4);
  background: rgba(216, 178, 110, .1);
}

.hdv-burger.hdv-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hdv-burger.hdv-open span:nth-child(2) { opacity: 0; }
.hdv-burger.hdv-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   MÓVIL (≤1180px)
   ============================================================ */
@media (max-width: 1180px) {
  .hdv-bar {
    height: 64px;
    padding: 0 16px;
  }

  .hdv-logo img { height: 38px; }

  .hdv-burger { display: flex; }

  /* Panel overlay */
  .hdv-nav {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    padding: 92px 22px 40px;
    background: linear-gradient(160deg, #1a0b2e 0%, #370C56 60%, #451044 100%);
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    overflow-y: auto;
    z-index: 9250;
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    transition: transform .38s cubic-bezier(.4, 0, .2, 1), opacity .38s ease;
  }

  .hdv-nav.hdv-active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }

  .hdv-nav-main,
  .hdv-nav-auth {
    width: 100%;
    max-width: 380px;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
  }

  .hdv-nav-auth { margin-top: 10px; }

  /* Links en píldoras */
  .hdv-link {
    width: 100%;
    justify-content: center;
    font-size: 16px;
    padding: 15px;
    border: 1px solid rgba(216, 178, 110, .25);
    border-radius: 999px;
    margin-bottom: 13px;
    background: rgba(255, 255, 255, .04);
  }

  /* Dropdowns → acordeón */
  .hdv-drop { width: 100%; }

  .hdv-drop-menu {
    position: static;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    background: rgba(0, 0, 0, .22);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 1px solid rgba(216, 178, 110, .15);
    border-radius: 16px;
    margin: -6px 0 13px;
    padding: 8px;
    box-shadow: none;
  }

  .hdv-drop-menu::before { display: none; }

  .hdv-drop.hdv-open .hdv-drop-menu { display: block; }
  .hdv-drop.hdv-open .hdv-caret { transform: rotate(180deg); }

  /* En móvil el hover no aplica: anulamos el hover de escritorio */
  .hdv-drop:hover .hdv-drop-menu {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .hdv-drop-link { border-radius: 10px; }

  /* CTA login dorado destacado */
  .hdv-btn-login {
    width: 100%;
    max-width: 260px;
    margin: 8px auto 0;
    justify-content: center;
    padding: 14px;
    font-size: 14.5px;
  }

  /* User dropdown dentro del panel */
  .hdv-user { width: 100%; }

  .hdv-user-trigger {
    width: 100%;
    justify-content: center;
    padding: 10px;
    border: 1px solid rgba(216, 178, 110, .25);
    background: rgba(255, 255, 255, .04);
  }

  .hdv-user-menu {
    position: static;
    width: 100%;
    margin-top: 10px;
    transform: none;
    background: rgba(0, 0, 0, .22);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .hdv-user.hdv-open .hdv-user-menu { transform: none; }
}

/* Ajustes finos en pantallas muy pequeñas */
@media (max-width: 400px) {
  .hdv-logo img { height: 34px; }
  .hdv-cart { width: 40px; height: 40px; }
}

/* =========================
   ACCESIBILIDAD: reduced motion
   ========================= */
@media (prefers-reduced-motion: reduce) {
  .hdv-header,
  .hdv-nav,
  .hdv-link,
  .hdv-drop-menu,
  .hdv-user-menu,
  .hdv-burger span,
  .hdv-btn-login,
  .hdv-cart,
  .hdv-caret,
  .hdv-user-caret,
  .hdv-logo img {
    transition: none !important;
    animation: none !important;
  }
}
/* ============================================================
   FIX GENERAL MOBILE — EVITAR DESBORDE HORIZONTAL
   ============================================================ */

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
}

* {
  box-sizing: border-box;
}

.hdv-header,
.hdv-bar,
.hdv-nav {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .hdv-header,
  .hdv-bar,
  .hdv-nav {
    width: 100% !important;
    max-width: 100% !important;
  }

  .hdv-nav {
    overflow-x: hidden;
  }
}
/* ============================================================
   AJUSTE DESKTOP — MENÚ MÁS LEGIBLE Y CENTRADO
   ============================================================ */

@media (min-width: 1181px) {
  .hdv-nav {
    justify-content: center;
  }

  .hdv-nav-main {
    flex: 1 1 auto;
    justify-content: center;
    gap: 12px;
  }

  .hdv-link {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .2px;
    padding: 10px 16px;
  }

  .hdv-link .hdv-ico {
    font-size: 14px;
  }

  .hdv-caret {
    font-size: 11px;
  }

  .hdv-nav-auth {
    flex: 0 0 auto;
    margin-left: 14px;
  }
}
/* ============================================================
   AJUSTE DESKTOP — BAJAR CONTENIDO DEL INICIO
   ============================================================ */

@media (min-width: 1181px) {
  main > *:first-child {
    padding-top: 45px !important;
  }
}