/* ============================
   PROMO BAR COMPLETO - CSS
   ============================ */

/* Contenedor principal del header */
#top-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 50px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-sizing: border-box;
  z-index: 99999;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* === LADO IZQUIERDO: TEXTO ANIMADO === */
.promo-left {
  flex: 1;
  overflow: hidden;
  height: 100%;
  display: flex;
  align-items: center;
}

.promo-track {
  display: flex;
  align-items: center;
  gap: 40px;
  animation: promo-scroll 50s linear infinite;
  height: 100%;
}

.promo-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  flex-shrink: 0;
}

.promo-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #0066cc;
}

@keyframes promo-scroll {
  to { transform: translateX(-50%); }
}

/* === MENÚ HAMBURGUESA === */
.nav-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-right: 16px;
  z-index: 100001 !important;
}

.nav-btn {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  padding: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background .2s;
}

.nav-btn:hover {
  background: #f5f5f5;
}

.nav-menu {
  position: fixed !important;
  top: 58px !important;
  left: 8px !important;
  background: #fff !important;
  border: 1px solid #e0e0e0 !important;
  border-radius: 0 !important;
  box-shadow: 0 12px 28px rgba(0,0,0,0.18) !important;
  padding: 10px !important;
  min-width: 260px !important;
  width: clamp(240px, 60vw, 340px) !important;
  display: none !important;
  z-index: 999999 !important;
}

.nav-menu.show {
  display: block !important;
}

.nav-group {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav-item {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav-item > a,
.nav-item-btn {
  width: 100% !important;
  text-align: left !important;
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  border-radius: 0 !important;
  border: 0 !important;
  background: #fff !important;
  cursor: pointer !important;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  color: #222 !important;
  transition: background .2s, color .2s !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.nav-item > a:hover,
.nav-item-btn:hover {
  background: rgba(0,102,204,0.1) !important;
}

.nav-sub {
  list-style: none !important;
  margin: 6px 0 8px 0 !important;
  padding: 0 0 0 10px !important;
  display: none !important;
  border-left: 2px solid #eee !important;
}

.nav-sub.show {
  display: block !important;
}

.nav-sub li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.nav-sub a {
  display: block !important;
  padding: 8px 10px !important;
  margin: 2px 0 !important;
  border-radius: 0 !important;
  text-decoration: none !important;
  color: #333 !important;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
  font-size: 13px !important;
  line-height: 1.2 !important;
  transition: background .2s, color .2s !important;
  background: transparent !important;
  border: 0 !important;
  box-sizing: border-box !important;
}

.nav-sub a:hover {
  background: rgba(0,102,204,0.1) !important;
}

/* === LADO DERECHO === */
.promo-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  margin-left: 8px;
}

/* Teléfono */
.contact-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.phone-icon {
  width: 16px;
  height: 16px;
  color: #333;
}

.phone-link {
  color: #333;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color .2s;
}

.phone-link:hover {
  color: #0066cc;
}

.phone-hours {
  color: #999;
  font-size: 11px;
}

/* Carrito */
.cart-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #333;
  text-decoration: none;
  transition: color .2s;
}

.cart-link:hover {
  color: #0066cc;
}

.cart-icon {
  width: 20px;
  height: 20px;
}

/* Selector de idiomas */
.lang-selector {
  position: relative;
}

.lang-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  padding: 0;
  transition: background .2s, transform .1s;
}

.lang-btn:hover {
  background: #f5f5f5;
}

.lang-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 0;
  box-shadow: 0 10px 24px rgba(0,0,0,0.14);
  display: none;
  flex-direction: column;
  min-width: 180px;
  padding: 6px;
  z-index: 100000;
}

.lang-options.show {
  display: flex;
}

.lang-option {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  cursor: pointer;
  border-radius: 0;
  font: 14px/1.2 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #fff;
  border: 0;
  outline: none;
  color: inherit;
  transition: background .2s;
  width: 100%;
}

.lang-option:hover {
  background: #f5f5f5;
}

/* Banderas */
.flag {
  width: 20px;
  height: 12px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 2px;
  flex-shrink: 0;
}

.flag-es {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 480'%3e%3cpath fill='%23c60b1e' d='M0 0h640v480H0z'/%3e%3cpath fill='%23ffc400' d='M0 120h640v240H0z'/%3e%3c/svg%3e");
}

.flag-en {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 480'%3e%3cpath fill='%23012169' d='M0 0h640v480H0z'/%3e%3cpath fill='%23C8102E' d='M75 0l244 181L562 0h78v62L400 241l240 178v61h-80L320 301 81 480H0v-60l239-178L0 64V0h75z'/%3e%3cpath fill='%23fff' d='M424 281l216 159v40L369 281h55zm-184 20l6 35L54 480H0l240-179zM640 0v3L391 191l2-44L590 0h50zM0 0l239 176h-60L0 42V0z'/%3e%3cpath fill='%23C8102E' d='M241 0v480h160V0H241zM0 160v160h640V160H0z'/%3e%3c/svg%3e");
}

.flag-fr {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 480'%3e%3cpath fill='%23fff' d='M0 0h640v480H0z'/%3e%3cpath fill='%23002653' d='M0 0h213.3v480H0z'/%3e%3cpath fill='%23ed2939' d='M426.7 0H640v480H426.7z'/%3e%3c/svg%3e");
}

.flag-de {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 480'%3e%3cpath fill='%23ffce00' d='M0 320h640v160H0z'/%3e%3cpath d='M0 0h640v160H0z'/%3e%3cpath fill='%23d00' d='M0 160h640v160H0z'/%3e%3c/svg%3e");
}

.flag-pt {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 480'%3e%3cpath fill='%23ff0000' d='M0 0h640v480H0z'/%3e%3cpath fill='%23006600' d='M0 0h256v480H0z'/%3e%3cpath fill='%23ffcc00' d='M106.3 186.7a26.7 26.7 0 1 0 0 106.7h43.4a26.7 26.7 0 0 0 0-106.7h-43.4z'/%3e%3c/svg%3e");
}

.flag-it {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 480'%3e%3cpath fill='%23fff' d='M0 0h640v480H0z'/%3e%3cpath fill='%23009234' d='M0 0h213.3v480H0z'/%3e%3cpath fill='%23CE2B37' d='M426.7 0H640v480H426.7z'/%3e%3c/svg%3e");
}

/* === RESPONSIVE MOBILE === */

/* Ocultar menú hamburguesa en desktop */
@media (min-width: 993px) {
  .nav-wrap {
    display: none !important;
  }
}

/* Mobile: [☰] [Promo animado] [🛒] [🇪🇸] */
@media (max-width: 992px) {
  #top-header {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 50px !important;
    padding: 0 8px !important;
    gap: 6px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
    z-index: 99999 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  }

  /* Menú hamburguesa visible en mobile - a la izquierda */
  .nav-wrap {
    display: flex !important;
    order: 1 !important;
    margin: 0 !important;
    margin-right: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    align-items: center !important;
    position: relative !important;
    z-index: 100001 !important;
  }

  .nav-btn {
    padding: 6px !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  }

  .nav-btn svg {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
  }

  .nav-menu {
    position: fixed !important;
    top: 58px !important;
    left: 8px !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    box-shadow: 0 12px 28px rgba(0,0,0,0.18) !important;
    padding: 10px !important;
    min-width: 260px !important;
    width: clamp(240px, 60vw, 340px) !important;
    z-index: 999999 !important;
  }

  .nav-menu.show {
    display: block !important;
  }

  /* Menu list group */
  .nav-group {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Menu items and buttons */
  .nav-item {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .nav-item > a,
  .nav-item-btn {
    width: 100% !important;
    text-align: left !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 12px !important;
    border-radius: 0 !important;
    border: 0 !important;
    background: #fff !important;
    cursor: pointer !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
    font-size: 14px !important;
    line-height: 1.2 !important;
    color: #222 !important;
    transition: background .2s, color .2s !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
  }

  .nav-item > a:hover,
  .nav-item-btn:hover {
    background: rgba(0,102,204,0.1) !important;
  }

  /* Submenu styling */
  .nav-sub {
    list-style: none !important;
    margin: 6px 0 8px 0 !important;
    padding: 0 0 0 10px !important;
    border-left: 2px solid #eee !important;
  }

  .nav-sub.show {
    display: block !important;
  }

  .nav-sub li {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .nav-sub a {
    display: block !important;
    padding: 8px 10px !important;
    margin: 2px 0 !important;
    border-radius: 0 !important;
    text-decoration: none !important;
    color: #333 !important;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    transition: background .2s, color .2s !important;
    background: transparent !important;
    border: 0 !important;
    box-sizing: border-box !important;
  }

  .nav-sub a:hover {
    background: rgba(0,102,204,0.1) !important;
  }

  /* Arrow icon for expandable items */
  .nav-item-btn svg,
  .nav-item > a svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
  }

  /* Promo animado - en el centro, ocupa espacio restante */
  .promo-left {
    flex: 1 !important;
    order: 2 !important;
    min-width: 0 !important;
    max-width: none !important;
    overflow: hidden !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 6px !important;
  }

  /* Animación MÁS LENTA en mobile - 40 segundos */
  .promo-track {
    animation: promo-scroll 40s linear infinite !important;
    font-size: 11px !important;
    gap: 30px !important;
    display: flex !important;
    align-items: center !important;
    height: 100% !important;
  }

  /* Reducir iconos del promo */
  .promo-icon {
    width: 14px !important;
    height: 14px !important;
    flex-shrink: 0 !important;
    color: #0066cc !important;
  }

  .promo-item {
    display: inline-flex !important;
    align-items: center !important;
    font-size: 11px !important;
    gap: 6px !important;
    color: #333 !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  /* Lado derecho - compacto (sin teléfono) */
  .promo-right {
    order: 3 !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
    margin: 0 !important;
    margin-left: 0 !important;
  }

  /* OCULTAR TELÉFONO COMPLETO EN MOBILE */
  .contact-info,
  #top-header .contact-info,
  .promo-right .contact-info {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    position: absolute !important;
    pointer-events: none !important;
  }

  /* Carrito más pequeño */
  .cart-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .cart-icon {
    width: 20px !important;
    height: 20px !important;
    display: block !important;
  }

  /* Selector de idioma más pequeño */
  .lang-selector {
    position: relative !important;
    display: block !important;
  }

  .lang-btn {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  }

  .lang-btn .flag {
    width: 20px !important;
    height: 12px !important;
  }

  .lang-options {
    position: absolute !important;
    top: calc(100% + 6px) !important;
    right: 0 !important;
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 0 !important;
    box-shadow: 0 10px 24px rgba(0,0,0,0.14) !important;
    min-width: 180px !important;
    padding: 6px !important;
    z-index: 100000 !important;
  }
}

/* Reducción de movimiento para accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .promo-track {
    animation: none !important;
  }
}
