/* =====================
   VARIABLES DE MARCA
===================== */
:root{
  --bg-main:#0e122f;
  --bg-card:#15194b;
  --text-main:#ffffff;
  --text-muted:#b6c2e2;
  --neon:#00CFFF;
  --badge:rgba(14,18,47,.95);

  --header-height:56px;

  /* ✅ Para iPhone con notch (safe area) */
  --safe-top: env(safe-area-inset-top, 0px);

  /* ✅ Esta la ajusta JS automáticamente */
  --sticky-ui-real: 0px;

  --font-ui: 'Inter', system-ui, -apple-system, sans-serif;
  --font-title: 'Space Grotesk', system-ui, sans-serif;

}


body {
  font-family: var(--font-ui);
}

h1, h2, h3, .price {
  font-family: var(--font-title);
  letter-spacing: -0.02em;
}



/* =====================
   RESET + BASE
===================== */
*{
  box-sizing:border-box;
  font-family:'Inter',system-ui,sans-serif;
}

html, body{
  height:100%;
  overflow-x:hidden;
  max-width:100%;
}

body{
  margin:0;
  background:radial-gradient(circle at top,#15194b,#0e122f);
  color:var(--text-main);
  -webkit-overflow-scrolling:touch;
}

/* =====================
   HEADER (FIJO Y ESTABLE)
===================== */
header{
  position:fixed;
  top:0;
  left:0;
  width:100%;

  padding-top:var(--safe-top);
  height:calc(var(--header-height) + var(--safe-top));

  display:flex;
  align-items:center;
  gap:15px;
  padding-left:40px;
  padding-right:40px;

  background:linear-gradient(90deg,#0e122f,#15194b);
  box-shadow:0 6px 20px rgba(0,0,0,.45);
  z-index:9999;

  transform:translateZ(0);
  will-change:transform;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
}

header img{ height:34px; }

header h1{
  margin:0;
  font-size:1.2rem;
  line-height:1;
}

/* =====================
   TOP UI FIJA
===================== */
.sticky-top-ui{
  position: fixed;
  top: calc(var(--header-height) + var(--safe-top));
  left: 0;
  width: 100%;
  z-index: 12000;

  padding: 6px 0;

  padding-left: 50px;
  padding-right: 50px;
  box-sizing: border-box;

  background: rgba(14,18,47,.78);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,.08);

  overflow: visible;
  isolation: isolate;
}

/* =========================================================
   ✅ LAYOUT DE 1 SOLA FILA EN EL STICKY (DESKTOP)
   (Título | Tabs | Filtro) SIN QUE SE MUEVA EL CENTRO
========================================================= */
@media (min-width:769px){

  /* ✅ Fila: 2 columnas reales (título | filtro), y la barra va centrada absoluta */
  .top-ui-row{
    position: relative;                 /* 👈 necesario para centrar absoluto */
    display: grid;
    grid-template-columns: 1fr 280px;   /* izquierda flexible | derecha fija */
    align-items: center;
    column-gap: 16px;
  }

  /* ✅ Título: no empuja, se corta */
  .top-ui-title{
    margin: 0;
    font-size: 1.15rem;
    line-height: 1;

    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    padding-right: 160px; /* 👈 reserva espacio para que no se monte debajo de la barra centrada */
  }

  /* ✅ Barra centrada en TODO el sticky (viewport), no solo en la columna */
  .top-ui-row .categories-bar{
    position: absolute;     /* 👈 clave */
    left: 50%;
    transform: translateX(-50%);
    top: 50%;
    transform: translate(-50%, -50%);

    margin: 0;
    padding: 4px 8px;
    gap: 8px;

    z-index: 1;             /* por encima del fondo */
  }

  .category-pill{
    min-width: 92px;
    padding: 5px 10px;
    font-size: .76rem;
    gap: 6px;
  }

  /* ✅ Filtro fijo a la derecha */
  .top-ui-row .filter-custom{
    width: 280px;
    max-width: 280px;
    justify-self: end;
    z-index: 2; /* por encima si hay overlap */
  }

  .filter-label{
    margin-bottom: 2px;
    font-size: .72rem;
  }

  .filter-select{
    padding: 8px 12px;
    font-size: .8rem;
    border-radius: 12px;
  }
}


/* =====================
   MAIN (COMPENSACIÓN HEADER + TOP UI REAL)
===================== */
main{
  padding-top:calc(var(--header-height) + var(--safe-top) + var(--sticky-ui-real) + 12px);
  padding-left:50px;
  padding-right:50px;
  padding-bottom:110px;
}

/* =====================
   HEADER PRODUCTOS (compat)
===================== */
.products-header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
  margin-bottom:0;
}

.products-header h2{
  margin:0;
  line-height:1.15;
  white-space:nowrap;
  font-size:1.35rem;
}

/* =====================
   FILTER CUSTOM PRO
===================== */
.filter-custom{
  position: relative;
  z-index: 13000;
}

@media (min-width:769px){
  .filter-custom{
    width: 280px;
    max-width: 280px;
    flex-shrink: 0;
  }
}

.filter-label{
  display:block;
  font-size:.8rem;
  color:var(--text-muted);
  margin-bottom:6px;
}

.filter-select{
  width: 100%;
  min-height: 44px;

  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;

  padding:12px 16px;
  border-radius:14px;

  background:linear-gradient(180deg,#15194b,#10144a);
  border:1px solid rgba(255,255,255,.18);
  color:var(--text-main);

  cursor:pointer;
  font-size:.85rem;

  box-shadow:0 0 12px rgba(0,0,0,.45);
  transition:.25s;
}

.filter-select:hover{
  border-color:var(--neon);
  box-shadow:
    0 0 14px rgba(0,207,255,.45),
    0 0 30px rgba(0,207,255,.25);
}

.filter-selected{
  flex: 1;
  min-width: 0;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.filter-arrow{
  display:flex;
  align-items:center;
  justify-content:center;
  opacity:.75;
  transition:transform .25s ease, opacity .25s ease;
}

.filter-custom.open .filter-arrow{
  transform:rotate(180deg);
  opacity:1;
}

.filter-options{
  display: none;
  position: absolute;
  width: 100%;

  top: calc(100% + 8px);
  left: 0;
  margin: 0;

  padding: 6px;
  list-style: none;

  z-index: 14000;

  background: linear-gradient(180deg,#0e122f,#0b0f2a);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.15);
  box-shadow:
    0 18px 45px rgba(0,0,0,.7),
    0 0 22px rgba(0,207,255,.15);
}

.filter-custom.open .filter-options{ display:block; }

.filter-options li{
  margin:0;
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  font-size:.8rem;
}

.filter-options li:hover{
  background:rgba(0,207,255,.15);
  color:var(--neon);
}

/* =====================
   PRODUCTS GRID
===================== */
.products{
  display:grid;
  grid-template-columns:repeat(auto-fill, 320px);
  gap:28px;
  justify-content:center;
}

/* =====================
   CARD (UNIFICADO)
===================== */
.card{
  background:
    linear-gradient(
      180deg,
      rgba(21,25,75,.95),
      rgba(16,20,74,.92)
    );

  border-radius:18px;
  padding:22px;

  border: 1px solid rgba(2, 105, 157, 0.549);

  box-shadow:
    0 12px 30px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.03),
    0 0 18px rgba(0,207,255,.06);

  transition:.35s;
  position:relative;
  overflow:hidden;

  display:flex;
  flex-direction:column;
}

.card:hover{
  transform: translateY(-5px);
  box-shadow:
    0 20px 50px rgba(0,0,0,.7),
    0 0 28px rgba(0,207,255,.18);
}

.card::before{
  content:"";
  position:absolute;
  inset:0;
  border-radius:18px;
  pointer-events:none;

  background:
    radial-gradient(
      circle at top,
      rgba(0,207,255,.08),
      transparent 60%
    );
}

.card::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:18px;
  pointer-events:none;

  background-image:
    repeating-linear-gradient(
      0deg,
      rgba(255,255,255,.015),
      rgba(255,255,255,.015) 1px,
      transparent 1px,
      transparent 2px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(0,0,0,.015),
      rgba(0,0,0,.015) 1px,
      transparent 1px,
      transparent 2px
    );
}

.card-footer{
  margin-top:auto;
}

.card-desc{
  margin: 4px 0 10px;
  color: var(--text-muted);
  font-size: .9rem;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* --- Ajuste espacio entre nombre y descripción --- */
.card h3{
  margin: 12px 0 4px;   /* antes el navegador le mete mucho margen */
  line-height: 1.1;    /* más compacto */
}



.card-footer .price{
  margin-top: 6px;
}




/* =====================
   BADGE
===================== */
.badge{
  position:absolute;
  top:0;
  left:0;
  z-index:10;
  pointer-events:none;
  isolation:isolate;

  /*✅ OPCIÓN 1 (RECOMENDADA): Badge azul neón corporativo 🔵✨*/
  background: linear-gradient(
    180deg,
    #00e6ff,
    #00bcd4
  );
  color:#001821;

  box-shadow:
    0 0 12px rgba(0,207,255,.8),
    0 0 28px rgba(0,207,255,.45);
  
  font-size:1.05rem;
  font-weight:800;
  padding:8px 24px;
  border-radius:18px 0 18px 0;

  transition: all 0.3s ease;
}

/* =====================
   IMAGE
===================== */
.product-image{
  width:100%;
  aspect-ratio:16/9;
  border-radius:14px;
  overflow:hidden;
  margin-bottom:18px;
}

.product-image img{
  width:100%;
  height:100%;
  object-fit:cover;

  transform-origin: center top;
  transition: transform .6s cubic-bezier(.22,1,.36,1);
}

.card:hover .product-image img{
  transform:scale(1.35);
}

/* =====================
   META INFO (duración / pantallas)
===================== */
.product-meta{
  display:flex;
  align-items:center;
  gap:16px;
  margin: 10px 0 18px;
  color:var(--text-muted);
  font-size:.82rem;
}

.meta-item{
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
  padding:0;
  border:none;
  background:transparent;
}

.meta-item svg{
  width:14px;
  height:14px;
  stroke-width:2.2;
  color:var(--neon);
  opacity:.9;
}

/* =====================
   PRICE & DETAILS
===================== */

.price{
  font-family: var(--font-title);
  font-size:1.4rem;
  font-weight:700;
  color:var(--neon);
  margin:14px 0 6px;
}


.price span {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-left: 4px;
}




.details{
  color:var(--text-muted);
  font-size:.9rem;
  margin-bottom:26px;
}

/* =====================
   BOTÓN COMPRAR
===================== */
.card button{
  width:100%;
  padding:16px;
  border:none;
  border-radius:16px;
  background:var(--neon);
  color:#001821;
  font-weight:800;
  font-size:1.15rem;
  cursor:pointer;

  box-shadow:
    0 0 10px rgba(0,207,255,.9),
    0 0 26px rgba(0,207,255,.6),
    0 0 52px rgba(0,207,255,.4);

  transition:transform .25s ease, box-shadow .25s ease;

  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.card button:hover{
  transform:scale(1.07);
  box-shadow:
    0 0 16px rgba(0,207,255,1),
    0 0 40px rgba(0,207,255,.85),
    0 0 70px rgba(0,207,255,.6);
}

.card button:disabled{
  background:#555;
  color:#ccc;
  box-shadow:none;
  transform:none;
}

/* =====================
   CATEGORIES BAR
===================== */
.categories-bar{
  display:flex;
  align-items:center;
  gap:10px;
  margin:4px auto 6px;
  padding:8px 10px;

  width:fit-content;
  border-radius:999px;

  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  backdrop-filter:blur(10px);
  box-shadow:0 12px 28px rgba(0,0,0,.35);
}

.category-pill{
  min-width:110px;
  padding:8px 14px;
  border-radius:999px;

  background:rgba(255,255,255,.08);
  border:1px solid rgba(255,255,255,.18);

  color:rgba(255,255,255,.9);
  font-weight:700;
  font-size:.8rem;
  letter-spacing:.2px;
  text-shadow:0 1px 2px rgba(0,0,0,.35);

  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;

  transition:
    transform .15s ease,
    background .2s ease,
    border-color .2s ease,
    box-shadow .2s ease,
    color .2s ease;
}

.category-pill:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.12);
  border-color:rgba(0,207,255,.35);
  box-shadow:0 0 16px rgba(0,207,255,.18);
}

.category-pill.active{
  background:rgba(0,207,255,.16);
  border-color:rgba(0,207,255,.55);
  color:#fff;
  box-shadow:
    0 0 12px rgba(0,207,255,.35),
    0 0 28px rgba(0,207,255,.18);
}

/* =====================
   WHATSAPP FLOAT
===================== */
.whatsapp-float{
  position:fixed;
  bottom:calc(24px + env(safe-area-inset-bottom));
  right:24px;

  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 14px;
  font-size:.85rem;
  font-weight:700;

  background:#249a0a;
  color:#fff;
  border-radius:999px;
  text-decoration:none;

  box-shadow:0 10px 25px rgba(0,0,0,.35);
  z-index:20000;

  transition:box-shadow .25s ease, transform .2s ease;
}

.whatsapp-float img{ width:20px; height:20px; }

.whatsapp-float:hover{
  transform:scale(1.05);
  box-shadow:
    0 0 12px rgba(36,154,10,.9),
    0 0 28px rgba(36,154,10,.7),
    0 0 50px rgba(36,154,10,.5);
}

.whatsapp-float:active{
  transform:scale(1.03);
  box-shadow:
    0 0 10px rgba(36,154,10,.9),
    0 0 24px rgba(36,154,10,.7),
    0 0 40px rgba(36,154,10,.5);
}

/* =====================
   FOOTER PRO
===================== */
.site-footer{
  margin-top:2px;
  padding:24px 0;
  border-top:1px solid rgba(255,255,255,.10);
  background:linear-gradient(180deg, rgba(14,18,47,0), rgba(14,18,47,.65));
}

.footer-inner{
  max-width:1100px;
  margin:0 auto;
  padding:0 50px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.footer-brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
}

.footer-logo{
  width:34px;
  height:34px;
  border-radius:10px;
}

.footer-text{
  display:flex;
  flex-direction:column;
  line-height:1.2;
}

.footer-text strong{ font-size:.95rem; }
.footer-text span{ font-size:.8rem; color:var(--text-muted); }

.footer-meta{
  display:flex;
  align-items:center;
  gap:10px;
  font-size:.85rem;
  color:var(--text-muted);
  flex-wrap:wrap;
  justify-content:flex-end;
}

.footer-link{
  color:var(--neon);
  text-decoration:none;
  font-weight:700;
}
.footer-link:hover{ text-decoration:underline; }
.footer-dot{ opacity:.6; }

/* =====================
   LIGHTBOX
===================== */
.lightbox{
  display:none;
  position:fixed;
  inset:0;
  padding:20px;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.75);
  backdrop-filter:blur(2px);
  z-index:50000;
}

.lightbox.show{ display:flex; }

#lightbox-img{
  max-width:min(900px, 92vw);
  max-height:82vh;
  border-radius:14px;
  box-shadow:0 20px 60px rgba(0,0,0,.6);
}

/* =====================
   ICONOS (LUCIDE)
===================== */
.category-pill svg{
  width:16px;
  height:16px;
  stroke-width:2.2;
  color:currentColor;
}

.card button svg{
  width:18px;
  height:18px;
  stroke-width:2.2;
}

.filter-arrow svg{
  width:18px;
  height:18px;
  stroke-width:2.5;
}

/* Texto del botón Comprar */
.btn-text-mobile{ display:none; }

/* =====================
   DESKTOP: sticky compacto
===================== */
@media (min-width:769px){
  .sticky-top-ui{
    padding: 4px 0;
    padding-left: 50px;
    padding-right: 50px;
  }

  .products-header h2{
    font-size: 1.2rem;
    line-height: 1.1;
  }

  .filter-label{
    margin-bottom: 4px;
    font-size: .75rem;
  }

  .filter-select{
    padding: 10px 14px;
    font-size: .82rem;
  }

  .filter-arrow svg{
    width: 16px;
    height: 16px;
  }
}

/* =====================
   MOBILE
===================== */
@media (max-width:768px){
  header{
    padding-left:20px;
    padding-right:20px;
    position:fixed;
    top:0;
    transform:none !important;
    will-change:auto !important;
  }

  .sticky-top-ui{
    padding-left:16px;
    padding-right:16px;
  }

  .top-ui-row{
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .top-ui-title{
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.1;
    white-space: normal;
  }

  main{
    padding-left:16px;
    padding-right:16px;
    padding-top: calc(var(--header-height) + var(--safe-top) + var(--sticky-ui-real) + 8px);
  }

  .products{
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap:16px;
  }

  .card{
    padding:18px;
  }

  .price{ font-size:1.25rem; }

  .details{
    font-size:.8rem;
    margin-bottom:16px;
  }

  .card button{
    font-size:1rem;
    padding:12px;
  }

  .categories-bar{
    width:100%;
    max-width:100%;
    box-sizing:border-box;

    overflow-x:auto;
    -webkit-overflow-scrolling:touch;

    justify-content:flex-start;
    padding:6px 10px;
    margin:0;
  }
  .categories-bar::-webkit-scrollbar{ height:0; }

  .category-pill{
    flex:0 0 auto;
    white-space:nowrap;
    min-width:100px;
    padding:7px 12px;
    font-size:.78rem;
    letter-spacing:.15px;
  }

  .filter-custom{
    width: 100%;
    max-width: 100%;
  }

  .filter-select{ width:100%; }

  header h1{
    font-size:1.05rem;
    margin:0;
    line-height:1;
  }

  .products-header{
    flex-direction:column;
    align-items:flex-start;
    gap:8px;
  }

  .products-header h2{
    white-space:normal;
    font-size:1.15rem;
    line-height:1.2;
  }

  .btn-text-full{ display:none; }
  .btn-text-mobile{ display:inline; }

  .whatsapp-float{
    right:14px;
    bottom:14px;
    transform:scale(1.03);
    box-shadow:
      0 0 10px rgba(36,154,10,.85),
      0 0 26px rgba(36,154,10,.6),
      0 0 42px rgba(36,154,10,.45);
  }

  body{ padding-bottom:50px; }

  .footer-inner{
    padding:0 16px;
    flex-direction:column;
    align-items:flex-start;
  }

  .product-meta{
    display:grid;
    grid-template-columns: 1fr 1fr;
    gap:6px 10px;
    font-size:.78rem;
  }

  /* =====================
    BADGE movil
  ===================== */
  .badge {
    font-size: 0.85rem;
    padding: 5px 14px;
    border-radius: 14px 0 14px 0;

    box-shadow:
      0 0 8px rgba(0, 207, 255, 0.7),
      0 0 18px rgba(0, 207, 255, 0.4);
  }




  .footer-meta{ justify-content:flex-start; }
}


/* =====================
   TABLET (3 columnas)
===================== */
@media (min-width:769px) and (max-width:1024px){

  /* ✅ Grid de productos en 3 columnas */
  .products{
    grid-template-columns: repeat(3, 1fr);
    gap: 18px; /* puedes ajustar a 16/20 según gusto */
  }

  /* Opcional: un poco menos padding para que no se sienta apretado */
  main{
    padding-left: 24px;
    padding-right: 24px;
  }

  /* Opcional: que la card no se vea gigante */
  .card{
    padding: 18px;
  }
}





/* ============================
   Breakpoint intermedio estilo móvil:
   filtro debajo (full width)
============================ */
@media (min-width: 769px) and (max-width: 1180px) {

  .top-ui-row{
    display: grid;
    grid-template-columns: 1fr; /* todo a 1 columna */
    grid-template-rows: auto auto auto;
    row-gap: 10px;
    align-items: start;
  }

  /* Título */
  .top-ui-title{
    padding-right: 0;
    white-space: normal;
  }

  /* Categorías: sin absoluto y centradas */
  .top-ui-row .categories-bar{
    position: static;
    transform: none;
    margin: 0 auto;
    justify-content: center;
  }

  /* Filtro: full width debajo */
  .top-ui-row .filter-custom{
    width: 100%;
    max-width: 100%;
    justify-self: stretch;
  }

  .filter-select{
    width: 100%;
  }
}





/* ============================
   Dropdown del filtro: scroll interno cuando hay muchos items
============================ */

/* Altura máxima + scroll */
.filter-options{
  max-height: min(320px, calc(100vh - 220px));
  overflow-y: auto;
  overscroll-behavior: contain; /* evita que el scroll “se vaya” al body */
  -webkit-overflow-scrolling: touch;
}

/* Mejor “feel” del scroll */
.filter-options li{
  line-height: 1.2;
}

/* Scrollbar (opcional, no rompe nada) */
.filter-options::-webkit-scrollbar{
  width: 10px;
}
.filter-options::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,.18);
  border-radius: 999px;
}
.filter-options::-webkit-scrollbar-track{
  background: rgba(0,0,0,.15);
  border-radius: 999px;
}

/* En móvil: permite más alto para listas grandes */
@media (max-width:768px){
  .filter-options{
    max-height: min(420px, calc(100vh - 180px));
  }
}
