:root {
  --brand:   #FF6B35;
  --dark:    #0A0A0A;
  --bg:      #ffffff;
  --bg-2:    #f7f7f7;
  --bg-3:    #f0f0f0;
  --text-1:  #111111;
  --text-2:  #555555;
  --text-3:  #999999;
  --border:  #e5e5e5;
  --bar-h:   0px;
}

/* ════════════════════════════════════════
   BARRA DE ANUNCIOS
   El PHP solo la renderiza si hay anuncios activos en BD.
   Cuando existe en el DOM, siempre está visible.
   ════════════════════════════════════════ */
.promo-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 38px;
  background: #111;
  color: #fff;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.promo-track {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.promo-msg {
  position: absolute;
  left: 0; right: 0;
  text-align: center;
  font-size: .77rem;
  font-weight: 500;
  opacity: 0;
  transition: opacity .5s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1.5rem;
}
.promo-msg a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.promo-msg.active { opacity: 1; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text-1);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════ */
.navbar-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 2rem;
  height: 64px;
}

#navbar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background .3s ease, box-shadow .3s ease;
}
#navbar.scrolled {
  background: rgba(255,255,255,0.96);
  box-shadow: 0 1px 20px rgba(0,0,0,.08);
}

.navbar-logo {
  font-size: 1.15rem;
  font-weight: 900;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--text-1);
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-logo span { color: var(--brand); }

.navbar-search-wrap { flex: 1; position: relative; max-width: 480px; margin: 0 auto; }
.navbar-search {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: .5rem 1rem;
  transition: border-color .2s, background .2s;
}
.navbar-search:focus-within {
  background: #fff;
  border-color: rgba(255,107,53,.5);
  box-shadow: 0 0 0 3px rgba(255,107,53,.08);
}
.search-icon { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
#nav-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-1);
  font-size: .875rem;
  font-family: 'Inter', sans-serif;
}
#nav-search-input::placeholder { color: var(--text-3); }
.search-kbd {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: .3rem;
  padding: .1rem .4rem;
  font-size: .65rem;
  color: var(--text-3);
  font-family: 'Inter', sans-serif;
  flex-shrink: 0;
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 20px 50px rgba(0,0,0,.12);
  display: none;
}
.search-dropdown.open { display: block; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: .875rem;
  padding: .75rem 1rem;
  text-decoration: none;
  color: var(--text-1);
  transition: background .15s;
}
.search-result-item:hover { background: var(--bg-2); }
.search-result-img {
  width: 44px; height: 44px; border-radius: .5rem;
  background: var(--bg-3); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.search-result-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-info { flex: 1; min-width: 0; }
.search-result-name { font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-1); }
.search-result-name mark { background: none; color: var(--brand); }
.search-result-tag { font-size: .72rem; color: var(--text-3); margin-top: 2px; }
.search-result-price { font-size: .875rem; font-weight: 700; color: var(--brand); flex-shrink: 0; }
.search-see-all {
  display: block; padding: .75rem 1rem; font-size: .8rem;
  color: var(--brand); text-decoration: none;
  border-top: 1px solid var(--border); font-weight: 600;
  text-align: center; transition: background .15s;
}
.search-see-all:hover { background: var(--bg-2); }
.search-loading, .search-empty { padding: 1.25rem 1rem; font-size: .85rem; color: var(--text-3); text-align: center; }
.search-empty strong { color: var(--text-2); }

.navbar-actions { display: flex; align-items: center; gap: .25rem; flex-shrink: 0; }
.nav-link {
  font-size: .8rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-2);
  text-decoration: none; padding: .5rem .75rem;
  border-radius: .5rem; transition: color .15s, background .15s;
}
.nav-link:hover { color: var(--text-1); background: var(--bg-2); }

.nav-drop-wrap { position: relative; }
.nav-icon-btn {
  display: flex; align-items: center; gap: .4rem;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 9999px; padding: .45rem .9rem .45rem .75rem;
  color: var(--text-2); cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: .78rem; font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
}
.nav-icon-btn svg { width: 17px; height: 17px; flex-shrink: 0; }
.nav-icon-btn:hover { background: var(--bg-3); color: var(--text-1); border-color: #ccc; }
.nav-icon-btn[aria-expanded="true"] { background: rgba(255,107,53,.1); border-color: rgba(255,107,53,.4); color: var(--brand); }
.nav-icon-label { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-cart-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--brand); color: #fff;
  font-size: .65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}
.nav-cart-btn { position: relative; padding: .45rem .75rem; }

.nav-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: #fff; border: 1px solid var(--border);
  border-radius: 1.1rem; box-shadow: 0 20px 50px rgba(0,0,0,.12);
  z-index: 200; min-width: 220px;
  opacity: 0; transform: translateY(-8px) scale(.97);
  pointer-events: none; transition: opacity .2s, transform .2s;
}
.nav-dropdown.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

.account-drop { padding: 1rem; width: 220px; }
.dd-greeting { font-size: .8rem; color: var(--text-3); margin-bottom: .75rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); }
.dd-eyebrow { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); margin-bottom: .5rem; }
.dd-item {
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .75rem; border-radius: .6rem;
  font-size: .85rem; font-weight: 500; color: var(--text-2);
  text-decoration: none; cursor: pointer;
  background: none; border: none; width: 100%; text-align: left;
  font-family: 'Inter', sans-serif; transition: background .15s, color .15s;
}
.dd-item svg { width: 15px; height: 15px; opacity: .5; }
.dd-item:hover { background: var(--bg-2); color: var(--text-1); }
.dd-danger { color: #dc2626 !important; }
.dd-danger:hover { background: rgba(220,38,38,.06) !important; }
.dd-sep { height: 1px; background: var(--border); margin: .5rem 0; }
.dd-or { display: flex; align-items: center; gap: .5rem; margin: .75rem 0; }
.dd-or::before, .dd-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.dd-or span { font-size: .7rem; color: var(--text-3); }
.dd-cta-primary {
  display: block; text-align: center; padding: .65rem 1rem;
  background: var(--text-1); color: #fff;
  border-radius: .6rem; font-size: .85rem; font-weight: 700;
  text-decoration: none; margin-bottom: .5rem; transition: background .15s;
}
.dd-cta-primary:hover { background: #333; }
.dd-cta-secondary {
  display: block; text-align: center; padding: .65rem 1rem;
  background: var(--bg-2); color: var(--text-2);
  border-radius: .6rem; font-size: .85rem; font-weight: 600;
  text-decoration: none; border: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.dd-cta-secondary:hover { background: var(--bg-3); color: var(--text-1); }
.dd-cta-ghost { display: block; text-align: center; padding: .5rem; font-size: .8rem; color: var(--text-3); text-decoration: none; transition: color .15s; margin-top: .25rem; }
.dd-cta-ghost:hover { color: var(--text-2); }
.dd-title { font-size: .85rem; font-weight: 700; color: var(--text-1); }
.dd-count { font-size: .75rem; color: var(--text-3); }

.cart-drop { width: 320px; display: flex; flex-direction: column; }
.cart-drop-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.1rem .75rem; border-bottom: 1px solid var(--border); }
.cart-drop-list { max-height: 280px; overflow-y: auto; padding: .5rem; }
.cart-drop-list::-webkit-scrollbar { width: 4px; }
.cart-drop-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 9999px; }
.cart-drop-empty { text-align: center; padding: 2rem 1rem; color: var(--text-3); font-size: .85rem; }
.cart-drop-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .5rem; border-radius: .6rem; transition: background .15s; }
.cart-drop-item:hover { background: var(--bg-2); }
.cart-drop-img { width: 48px; height: 48px; border-radius: .5rem; background: var(--bg-3); overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cart-drop-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-drop-info { flex: 1; min-width: 0; }
.cart-drop-name { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-1); }
.cart-drop-meta { font-size: .72rem; color: var(--text-3); margin-top: 2px; }
.cart-drop-price { font-size: .8rem; font-weight: 700; color: var(--brand); flex-shrink: 0; }
.cart-drop-more { text-align: center; font-size: .75rem; color: var(--text-3); padding: .4rem; }
.cart-drop-footer { border-top: 1px solid var(--border); padding: .875rem 1.1rem 1rem; }
.cart-drop-total { display: flex; justify-content: space-between; align-items: center; margin-bottom: .875rem; font-size: .85rem; color: var(--text-2); }
.cart-drop-total strong { font-size: 1.05rem; font-weight: 800; color: var(--text-1); }

/* ════════════════════════════════════════
   VIDEO SCRUBBING (solo index)
   ════════════════════════════════════════ */
#scrub-video { pointer-events: none; user-select: none; }
.overlay-panel { opacity: 0; pointer-events: none; transition: none; }
.overlay-panel.is-active { pointer-events: auto; }

/* ════════════════════════════════════════
   PRODUCTO CARD (tienda, home)
   ════════════════════════════════════════ */
.product-card-link {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: transform .3s ease, border-color .3s ease, box-shadow .3s ease;
  text-decoration: none;
  color: var(--text-1);
}
.product-card-link:hover {
  transform: translateY(-4px);
  border-color: #ccc;
  box-shadow: 0 12px 40px rgba(0,0,0,.08);
}
.product-img-wrap {
  aspect-ratio: 3/4; overflow: hidden;
  background: var(--bg-3);
  display: flex; align-items: center; justify-content: center;
}
.product-img-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.product-card-link:hover .product-img-wrap img { transform: scale(1.04); }
.product-info { padding: 1rem 1.25rem 1.25rem; }
.product-name { font-weight: 700; font-size: .9rem; color: var(--text-1); }
.product-price { font-weight: 900; font-size: 1.1rem; color: var(--text-1); margin-top: .25rem; }

/* ════════════════════════════════════════
   TALLAS
   ════════════════════════════════════════ */
.size-btn {
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .5rem .875rem;
  font-size: .875rem;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  background: #fff;
  transition: all .2s;
}
.size-btn:hover { border-color: var(--text-1); color: var(--text-1); }
.size-btn.active { background: var(--text-1); border-color: var(--text-1); color: #fff; }
.size-btn.out-of-stock { opacity: .35; cursor: not-allowed; text-decoration: line-through; }

/* ════════════════════════════════════════
   BOTONES GLOBALES
   ════════════════════════════════════════ */
.btn-primary {
  background: var(--text-1);
  color: #fff;
  font-weight: 700;
  border-radius: 9999px;
  padding: .875rem 2.25rem;
  font-size: .9rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .2s, transform .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  cursor: pointer; border: none; font-family: 'Inter', sans-serif;
  text-decoration: none;
}
.btn-primary:hover { background: #333; transform: scale(1.01); }
.btn-primary:active { transform: scale(.99); }
.btn-primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: transparent;
  color: var(--text-1);
  font-weight: 600;
  border-radius: 9999px;
  padding: .875rem 2.25rem;
  font-size: .9rem;
  border: 1.5px solid var(--border);
  transition: border-color .2s, background .2s;
  cursor: pointer; text-transform: uppercase; letter-spacing: .04em;
  font-family: 'Inter', sans-serif; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-secondary:hover { border-color: var(--text-1); background: var(--bg-2); }

/* ════════════════════════════════════════
   CARRITO (página /carrito)
   ════════════════════════════════════════ */
.cart-item {
  display: grid; grid-template-columns: 80px 1fr auto;
  gap: 1rem; align-items: center;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
}
.cart-item-img {
  width: 80px; height: 80px; border-radius: .75rem;
  object-fit: cover; background: var(--bg-3);
}
.qty-btn {
  width: 2rem; height: 2rem; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-1); font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.qty-btn:hover { border-color: var(--text-1); background: var(--bg-2); }

/* ════════════════════════════════════════
   STRIPE
   ════════════════════════════════════════ */
#stripe-element-container .StripeElement {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: .75rem;
  padding: 1rem;
  transition: border-color .2s;
}
#stripe-element-container .StripeElement--focus { border-color: var(--brand); }

/* ════════════════════════════════════════
   FORMULARIOS
   ════════════════════════════════════════ */
.form-input {
  width: 100%; background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: .75rem; padding: .875rem 1rem;
  color: var(--text-1); font-size: .95rem;
  font-family: 'Inter', sans-serif;
  transition: border-color .2s; outline: none;
}
.form-input::placeholder { color: var(--text-3); }
.form-input:focus { border-color: var(--text-1); background: #fff; }

.form-label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--text-3); text-transform: uppercase;
  letter-spacing: .1em; margin-bottom: .5rem;
}

/* ════════════════════════════════════════
   TOAST
   ════════════════════════════════════════ */
#toast {
  position: fixed; bottom: 2rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text-1);
  border-radius: 9999px;
  padding: .875rem 1.75rem;
  color: #fff; font-weight: 600; font-size: .875rem;
  z-index: 9999; transition: transform .4s cubic-bezier(.34, 1.56, .64, 1);
  white-space: nowrap; pointer-events: none;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ════════════════════════════════════════
   ANIMACIONES
   ════════════════════════════════════════ */
.fade-up { opacity: 0; transform: translateY(40px); transition: opacity .7s ease, transform .7s ease; }
.fade-up.visible { opacity: 1; transform: translateY(0); }
.scroll-arrow { animation: bounce 1.5s infinite; }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(6px); } }

/* ════════════════════════════════════════
   NAVBAR MODO OSCURO (solo sección video)
   ════════════════════════════════════════ */
#navbar.nav-dark {
  background: rgba(10,10,10,.85);
  border-bottom-color: rgba(255,255,255,.06);
}
#navbar.nav-dark .navbar-logo { color: #fff; }
#navbar.nav-dark .nav-link { color: rgba(255,255,255,.7); }
#navbar.nav-dark .nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
#navbar.nav-dark .navbar-search { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
#navbar.nav-dark #nav-search-input { color: #fff; }
#navbar.nav-dark #nav-search-input::placeholder { color: rgba(255,255,255,.35); }
#navbar.nav-dark .search-icon { color: rgba(255,255,255,.4); }
#navbar.nav-dark .nav-icon-btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); color: rgba(255,255,255,.8); }
#navbar.nav-dark .nav-icon-btn:hover { background: rgba(255,255,255,.14); color: #fff; }
#navbar.nav-dark .nav-cart-badge { border-color: #0a0a0a; }
