/* ============================================================
   COMUNIK2 — Componentes compartidos
   Header / Ticker / Nav / Carrito / Footer / WhatsApp flotante
   ============================================================ */

/* ===================== Botones base ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 24px;
  border-radius: var(--r-full);
  transition: transform var(--t), background var(--t), box-shadow var(--t);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-red {
  background: var(--red);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(204, 0, 0, 0.28);
}
.btn-red:hover { background: var(--red-dark); }

.btn-dark {
  background: var(--dark);
  color: var(--white);
}
.btn-dark:hover { background: var(--gray-900); }

.btn-wa {
  background: var(--green-wa);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.30);
}
.btn-wa:hover { background: var(--green-wa-dark); }

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid rgba(255, 255, 255, 0.7);
}
.btn-outline:hover { background: rgba(255, 255, 255, 0.15); }

.btn-block { width: 100%; }

.btn:disabled,
.btn[disabled] {
  background: #cfcfcf;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
}

/* ===================== ICONOS INLINE COMPARTIDOS ===================== */
/* Iconos line-style reutilizables (heredan color con currentColor).
   Tamaño pensado para acompañar texto en línea. */
.ico-inline {
  width: 16px;
  height: 16px;
  display: inline-block;
  vertical-align: -3px;
  flex-shrink: 0;
}
.ico-flame { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }
.ico-check { width: 15px; height: 15px; display: inline-block; vertical-align: -2px; }

/* Estrellas de rating (SVG relleno naranja) */
.rating-stars {
  display: inline-block;
  width: 96px;
  height: 19px;
  vertical-align: middle;
}

/* ===================== TICKER ===================== */
.ticker {
  background: var(--dark);
  color: var(--white);
  height: 30px;
  overflow: hidden;
  display: flex;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.ticker__track {
  display: flex;
  gap: 56px;
  white-space: nowrap;
  padding-left: 56px;
  animation: ticker-scroll 22s linear infinite;
}
.ticker__track span {
  display: inline-flex;
  align-items: center;
  gap: 20px;
}
.ticker__track span svg {
  flex-shrink: 0;
  opacity: 0.9;
}
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
/* ===================== TICKER DE EN MEDIO ===================== */
.ticker-medio {

  background: var(--gray-200);
  color: var(--black);
  height: 100px;
  overflow: hidden;
  display: flex;
  align-items: center;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: 0.1em;

}


/* ===================== HEADER ===================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.header__bar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--dark);
}
.logo b { color: var(--red); }

/* Nav principal */
.main-nav { flex: 1; display: flex; justify-content: center;}
.main-nav ul { display: flex; align-items: center; gap: 28px; }
.main-nav a {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-900);
  position: relative;
  padding: 4px 0;
  transition: color var(--t);
}
.main-nav a:hover { color: var(--red); }
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--red);
  transition: width var(--t);
}
.main-nav a:hover::after { width: 100%; }

.badge-hot {
  background: var(--red);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--r-full);
  margin-left: 5px;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Bloque de acciones derecha */
.header__actions { display: flex; align-items: center; gap: 12px; }

/* Dropdown ayuda */
.help { position: relative; }
.help__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--gray-900);
  padding: 8px 10px;
  border-radius: var(--r-sm);
  transition: background var(--t);
}
.help__btn:hover { background: var(--gray-100); }
.help__pop {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 270px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--t);
}
.help__pop.open { opacity: 1; visibility: visible; transform: translateY(0); }
.help__pop h4 { font-size: 0.95rem; margin-bottom: 12px; }
.help__row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  padding: 7px 0;
  color: var(--gray-900);
}
.help__row svg { flex-shrink: 0; }
.help__row strong { display: block; font-size: 0.72rem; color: var(--gray-500); font-weight: 600; }

/* Botón carrito */
.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: var(--r-full);
  background: var(--dark);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--t), background var(--t);
}
.cart-btn:hover { background: var(--gray-900); transform: translateY(-2px); }
.cart-count {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 20px; height: 20px;
  padding: 0 5px;
  background: var(--red);
  color: #fff;
  border-radius: var(--r-full);
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}

/* Hamburguesa */
.hamburger {
  display: none;
  width: 44px; height: 44px;
  border-radius: var(--r-sm);
  align-items: center;
  justify-content: center;
  color: var(--dark);
}
.hamburger:hover { background: var(--gray-100); }

/* Drawer móvil */
.mobile-nav {
  position: fixed;
  top: 0; left: 0;
  width: 82%;
  max-width: 320px;
  height: 100%;
  background: var(--white);
  z-index: var(--z-cart);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform 0.32s ease;
  display: flex;
  flex-direction: column;
  padding: 20px;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 10px;
}
.mobile-nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 15px 4px;
  border-bottom: 1px solid var(--border);
  color: var(--gray-900);
}
.mobile-nav a:hover { color: var(--red); }
.mobile-nav__foot { margin-top: auto; font-size: 0.85rem; color: var(--gray-500); }

/* ===================== OVERLAY GENÉRICO ===================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--t), visibility var(--t);
}
.overlay.open { opacity: 1; visibility: visible; }

/* ===================== CARRITO SIDEBAR ===================== */
.cart {
  position: fixed;
  top: 0; right: 0;
  width: 420px;
  max-width: 100%;
  height: 100%;
  background: var(--white);
  z-index: var(--z-cart);
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.32s ease;
  display: flex;
  flex-direction: column;
}
.cart.open { transform: translateX(0); }
.cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}
.cart__head h3 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.cart__close {
  width: 38px; height: 38px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-900);
  transition: background var(--t);
}
.cart__close:hover { background: var(--gray-100); }

.cart__items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
}
.cart__empty {
  text-align: center;
  color: var(--gray-500);
  padding: 60px 20px;
}
.cart__empty svg { margin: 0 auto 16px; opacity: 0.4; }

.cart-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.cart-item__img {
  width: 70px; height: 70px;
  border-radius: var(--r-sm);
  background: var(--gray-100);
  object-fit: cover;
  border: 1px solid var(--border);
}
.cart-item__name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; }
.cart-item__color { font-size: 0.75rem; color: var(--gray-500); margin-top: 2px; }
.cart-item__price { color: var(--red); font-weight: 800; font-size: 0.9rem; margin-top: 4px; }
.cart-item__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  margin-top: 6px;
  overflow: hidden;
}
.cart-item__qty button {
  width: 26px; height: 26px;
  font-size: 1rem; font-weight: 700;
  color: var(--gray-900);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--t);
}
.cart-item__qty button:hover { background: var(--gray-100); }
.cart-item__qty span { min-width: 26px; text-align: center; font-weight: 700; font-size: 0.85rem; }
.cart-item__remove {
  color: var(--gray-500);
  align-self: flex-start;
  transition: color var(--t);
}
.cart-item__remove:hover { color: var(--red); }

.cart__foot {
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--gray-100);
}
.cart__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cart__total span { font-weight: 600; color: var(--gray-900); }
.cart__total b { font-size: 1.5rem; font-weight: 900; color: var(--red); }
.cart__note { font-size: 0.75rem; color: var(--gray-500); text-align: center; margin-top: 10px; }

/* ===================== WHATSAPP FLOTANTE ===================== */
.wa-float {
  position: fixed;
  bottom: 24px; right: 24px;
  width: 58px; height: 58px;
  border-radius: var(--r-full);
  background: var(--green-wa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-wa);
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.45);
  animation: wa-pulse 2.2s infinite;
  transition: transform var(--t);
}
.wa-float:hover { transform: scale(1.1); }
@keyframes wa-pulse {
  0%   { box-shadow: 0 8px 24px rgba(37,211,102,0.45), 0 0 0 0 rgba(37,211,102,0.5); }
  70%  { box-shadow: 0 8px 24px rgba(37,211,102,0.45), 0 0 0 16px rgba(37,211,102,0); }
  100% { box-shadow: 0 8px 24px rgba(37,211,102,0.45), 0 0 0 0 rgba(37,211,102,0); }
}

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--gray-100);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.1fr;
  gap: 40px;
  padding-block: 56px;
}
.footer__brand .logo { margin-bottom: 14px; display: inline-block; }
.footer__contact { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.footer__contact .help__row { padding: 2px 0; }
.footer__libro {
  display: inline-block;
  /*border: 2px solid var(--red);*/
  border-radius: var(--r-sm);
  overflow: hidden;
  max-width: 100px;
  transition: transform var(--t);
}
.footer__libro:hover { transform: translateY(-3px); }
.footer__libro img { width: 100%; height: auto; display: block; }

.footer__col h4 {
  font-size: 0.95rem;
  font-weight: 800;
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.footer__col ul { display: flex; flex-direction: column; gap: 11px; }
.footer__col a {
  font-size: 0.9rem;
  color: var(--gray-900);
  transition: color var(--t), padding-left var(--t);
}
.footer__col a:hover { color: var(--red); padding-left: 4px; }

.socials { display: flex; gap: 12px; }
.socials a {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  transition: transform var(--t), box-shadow var(--t);
}
.socials a:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.s-fb { background: #1877F2; }
.s-ig { background: linear-gradient(45deg, #F58529, #DD2A7B, #8134AF); }
.s-yt { background: #FF0000; }
.s-tk { background: #000000; }

.footer__bottom {
  background: #111;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  padding: 18px;
  font-size: 0.82rem;
}

/* ===================== RESPONSIVE COMPONENTES ===================== */
@media (max-width: 900px) {
  .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .main-nav, .help { display: none; }
  .hamburger { display: flex; }
  .cart { width: 100%; }
}
@media (max-width: 560px) {
  .footer__grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 768px) {
  /* Footer centrado en móvil */
  .footer__grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer__brand {
    display: flex;
    flex-direction: column;
    align-items: center;
  }
  .footer__contact {
    align-items: center;
  }
  .footer__contact .help__row {
    justify-content: center;
    text-align: left;
  }
  .footer__libro {
    margin: 16px auto 0;
  }

  /* Columnas como acordeón */
  .footer__col h4 {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 0;
    border-top: 1px solid rgba(255,255,255,.1);
    margin: 0;
    user-select: none;
  }
  .footer__col h4::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform .25s;
  }
  .footer__col.open h4::after {
    transform: rotate(-135deg);
  }
  .footer__col ul {
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
  }
  .footer__col.open ul {
    max-height: 300px;
    padding-bottom: 12px;
  }
  .socials {
    justify-content: center;
  }
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}