/* =========================
   APPLE STYLE HEADER
========================= */

.apple-header {
    position: sticky;
    top: 0;
    z-index: 2000;
    background: #0b0b0b;
     
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.apple-nav {
    height: 84px;
    max-width: 1200px;
    margin: auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ================= LOGO ================= */

.apple-logo img {
    height: 60px;
    width: auto;
    display: block;
    filter: drop-shadow(0 0 6px rgba(237,84,19,0.35));
}

/* ================= BOTONES ================= */

.apple-actions {
    display: flex;
    gap: 10px;
}

.nav-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, color 0.25s ease;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.08);
    color: #ED5413;
}

.nav-btn .material-symbols-outlined {
    font-size: 22px;
}

/* ================= HAMBURGUESA ================= */

.burger {
    width: 42px;
    height: 42px;
    position: relative;
}

.burger span {
    position: absolute;
    left: 10px;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 24px; }
.burger span:nth-child(3) { top: 32px; }

.burger.active span:nth-child(1) {
    transform: rotate(45deg);
    top: 24px;
}

.burger.active span:nth-child(2) {
    opacity: 0;
    transform: scale(0.5);
}

.burger.active span:nth-child(3) {
    transform: rotate(-45deg);
    top: 24px;
}

/* ================= PANEL DESPLEGABLE ================= */

.apple-panel {
    position: absolute;
    top: 84px;
    left: 0;
    width: 100%;
    background: #0b0b0b;

    display: flex;
    flex-direction: column;
    align-items: center;

    overflow: hidden;
    max-height: 0;

    transition: max-height 0.4s ease;
}

.apple-panel.active {
    max-height: 100vh;
    overflow-y: auto;
}

/* ================= LINKS PANEL ================= */

.apple-panel a {
    color: #0b0b0b;
    text-decoration: none;
    font-size: 1.15rem;
    padding: 16px 0;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.apple-panel.active a {
    opacity: 1;
    transform: translateY(0);
}

/* ================= SUBMENÚS ================= */

.menu-item {
    width: 100%;
    text-align: center;
}

.menu-title {
    display: block;
    padding: 14px 0;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    color: #fff;
}

.submenu {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.menu-item.open .submenu {
    max-height: 500px;
    opacity: 1;
}

.submenu a {
    padding: 10px 0;
    font-size: 0.95rem;
    color: #cfcfcf;
}

.submenu a:hover,
.menu-title:hover {
    color: #ED5413;
}

/* ================= BUSCADOR ================= */
.header-search{
  position: absolute;     /* ✅ vuelve a absolute */
  top: 100%;              /* ✅ justo debajo del header/nav */
  left: 0;
  width: 100%;
  background: #000;
  padding: 1rem;
  display: none;
  z-index: 3000;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-search.active{ display:block; }


.header-search input {
  width: 100%;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: none;
  outline: none;
  font-size: 1rem;
}

/* ================= CARRITO ================= */

.cart-btn {
    position: relative;
}

#cart-count {
    position: absolute;
    top: -4px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    background: #ED5413;
    color: #000;
    font-size: 11px;
    font-weight: 800;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ================= RESPONSIVE ================= */
/* =========================
   DESKTOP: NAV | LOGO | ICONOS (SIN TOCAR HTML)
   ========================= */
@media (min-width: 1024px) {

  :root{
    --header-h: 96px;
    --nav-left-w: 520px; /* ancho reservado para navegación (ajústalo) */
    --actions-right-w: 160px; /* ancho reservado para iconos (ajústalo) */
  }

  /* Oculta hamburguesa en PC */
  .burger{ display:none !important; }

  /* El header será el "contenedor" del nav absoluto */
  .apple-header{ position: relative; }

  /* Barra superior (fila principal) */
  .apple-nav{
    height: var(--header-h);
    display: flex !important;
    align-items: center;
    justify-content: center; /* para centrar el logo */
    padding-left: calc(var(--nav-left-w) + 24px);   /* deja espacio al nav */
    padding-right: calc(var(--actions-right-w) + 24px); /* deja espacio a iconos */
  }

  /* LOGO al centro real */
  .apple-logo{ position: relative; z-index: 2600; }
  .apple-logo img{ height: 70px; }

  /* ICONOS a la derecha (lupa + bolso) */
  .apple-actions{
    position: absolute;
    right: 28px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2600;
    display:flex;
    align-items:center;
    gap: 14px;
    width: var(--actions-right-w);
    justify-content: flex-end;
  }

  /* NAV a la izquierda (visual, aunque esté fuera del div) */
  .apple-panel{
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%) !important;

    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: flex-start;
    gap: 22px;

    width: var(--nav-left-w);
    max-height: none !important;
    overflow: visible !important;

    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;

    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    z-index: 2600;
  }

  /* Texto visible (tu CSS lo tenía negro sobre negro) */
  .apple-panel a,
  .apple-panel .menu-title{
    color: #fff !important;
    opacity: 1 !important;
    transform: none !important;
    white-space: nowrap;
  }

  /* Submenús flotantes (no empujan nada) */
  .menu-item{ position: relative; }
  .submenu{
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: #141414;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
    padding: 10px 0;
    display: none;
    z-index: 3000;
    min-width: 220px;
  }
  .submenu.active{ display:block; }
  .submenu a{ display:block; padding: 12px 16px !important; }

  /* En PC no uses overlay (solo era para móvil) */
  .menu-overlay{ display:none !important; }
}

.cart-btn {
  position: relative;
}

.cart-count {
  position: absolute;
  top: -4px;
  right: -6px;
  background: #3cff00;
  color: #000;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
  display: none;
}
/* ===== Alinear logo + íconos (fix) ===== */

.apple-nav{
  height: 78px;               /* el alto que quieres */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo centrado verticalmente */
.apple-logo{
  display: flex;
  align-items: center;
}
.apple-logo .logo-img{
  height: 56px;
  width: auto;
  display: block;
}

/* Acciones (search + carrito) alineadas */
.apple-actions{
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botones con tamaño fijo (clave) */
.nav-btn{
  width: 42px;
  height: 42px;
  padding: 0;                /* evita que se “muevan” */
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Tamaño del ícono */
.nav-btn .material-symbols-outlined{
  font-size: 24px;
  line-height: 1;
}
.top-bar{
  background: #ED5413;
  color: #000;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 7px 10px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}
.top-bar{
  background:#ED5413;
  color:#000;
  font-size:.85rem;
  font-weight:700;
  padding:7px 10px;
  overflow:hidden;
  position:relative;
  white-space:nowrap;
}

.top-bar-text{
  display:inline-block;
  will-change: transform, opacity;
}

/* sale a la izquierda */
.top-bar-text.out{
  animation: topOut .35s ease forwards;
}

/* entra desde la derecha */
.top-bar-text.in{
  animation: topIn .45s ease forwards;
}

@keyframes topOut{
  from{ transform: translateX(0); opacity: 1; }
  to{ transform: translateX(-120%); opacity: 0; }
}

@keyframes topIn{
  from{ transform: translateX(120%); opacity: 0; }
  to{ transform: translateX(0); opacity: 1; }
}
/* ====== Scope: que los estilos SOLO afecten al HEADER ====== */
@media (min-width: 1024px){
  .apple-header .apple-logo{
    display:flex;
    align-items:center;
    justify-content:center;
    transform: translateY(2px);
  }

  .apple-header .apple-logo img{
    height: 62px;
    display:block;
  }
}

/* ====== Reset: por si el footer usa apple-logo ====== */
footer .apple-logo,
.footer .apple-logo{
  transform: none !important;
  position: static !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

footer .apple-logo img,
.footer .apple-logo img{
  height: auto !important;
}
/* ✅ Sticky del bloque completo (top-bar + header) */
.site-header{
  position: sticky;
  top: 0;
  z-index: 3000;
}

/* ya no hace falta que el header sea sticky si el wrapper lo es */
.site-header .apple-header{
  position: relative;
  top: auto;
}

/* =========================================================
   SUGERENCIAS DE BÚSQUEDA DEL HEADER (AUTOCOMPLETADO)
========================================================= */
.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #0b0b0b;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 4000;
    padding: 1.2rem 1.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.7);
    display: none;
    max-height: 400px;
    overflow-y: auto;
    text-align: left;
}

.search-results.active {
    display: block;
}

/* En PC centramos el panel de sugerencias y le damos estilo flotante de tarjeta */
@media (min-width: 1024px) {
    .search-results {
        left: 50%;
        transform: translateX(-50%);
        max-width: 600px;
        border-radius: 0 0 14px 14px;
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-top: none;
    }
}

.search-results-title {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.8rem;
    font-weight: 700;
}

.search-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.65rem 0.8rem;
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem;
    border-radius: 8px;
    transition: background 0.25s ease, color 0.25s ease;
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #ED5413;
}

.search-result-item span.arrow {
    color: #555;
    font-weight: bold;
    transition: color 0.25s ease;
}

.search-result-item:hover span.arrow {
    color: #ED5413;
}

/* Miniatura de imagen de producto */
.search-result-thumb {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px;
    flex-shrink: 0;
}

/* Resaltado de texto coincidente */
.search-result-item strong {
    color: #ED5413;
    font-weight: 700;
}

/* Estado sin resultados */
.search-no-results {
    text-align: center;
    padding: 1.5rem 1rem;
    color: #888;
}

.search-no-results .icon {
    font-size: 32px;
    color: #555;
    margin-bottom: 0.6rem;
    display: block;
}

.search-no-results p {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
    color: #ccc;
}

.search-no-results p strong {
    color: #ED5413;
}
