/* =========================================================
   RESET
========================================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #111;
  line-height: 1.4;
}

html {
  scroll-behavior: smooth;
}

/* =========================================================
   PALETA / TOKENS
========================================================= */
:root {
  --red-main: #d62828;
  --red-dark: #b41f1f;
  --yellow-main: #ffc400;
  --yellow-soft: #ffeaa7;
  --blue-hero: #2f80ed;
  --bg-page: #f5f5f5;
  --card-bg: #ffffff;
  --card-soft: #fafafa;
  --text-muted: #555;
  --shadow-soft: 0 2px 6px rgba(0,0,0,0.12);
  --shadow-strong: 0 12px 30px rgba(0,0,0,0.25);
  --radius-card: 12px;
}

/* =========================================================
   TOP BAR
========================================================= */
.top-bar {
  background: var(--red-main);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.top-bar-inner::before {
  content: "🎁";
  margin-right: 4px;
}

/* =========================================================
   HEADER
========================================================= */
.main-header {
  background: var(--red-main);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 14px; /* espacio entre logo y buscador */
}

/* FILA 1 */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-menu {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: none; /* visible solo en mobile */
}

/* Logo tipográfico con animación */
.logo-text {
  position: relative;
  text-decoration: none;
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  line-height: 1;
  white-space: nowrap;

  opacity: 0;
  transform: translateY(6px) scale(0.98);
  animation: logoFadeIn 0.6s ease-out forwards;
}

/* “Virtual” en pill amarillo */
.logo-text span {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  color: #ffe566;
  font-weight: 800;
  box-shadow: 0 0 0 0 rgba(255, 229, 102, 0.0);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

/* Subrayado degradado */
.logo-text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 3px;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffe566, #ffffff);
  opacity: 0.9;
  animation: logoUnderline 0.8s ease-out 0.35s forwards;
}

/* Hover suave en “Virtual” */
.logo-text:hover span {
  box-shadow: 0 0 10px rgba(255, 229, 102, 0.7);
  transform: translateY(-1px);
}

/* Animaciones logo */
@keyframes logoFadeIn {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes logoUnderline {
  0% { width: 0; }
  100% { width: 100%; }
}

/* Carrito con icono de bolsa */
.cart-link {
  position: relative;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
}

.cart-icon {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--yellow-main);
  color: #000;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
}

/* FILA 2 */
.header-middle {
  width: 100%;
}

/* =========================================================
   BUSCADOR
========================================================= */
.search-form {
  display: flex;
  background: #fff;
  border-radius: 999px;
  overflow: hidden;
  border: 2px solid #ffdd55;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}

.search-category {
  border: none;
  padding: 8px 10px;
  font-size: 0.85rem;
  background: #f7f7f7;
  outline: none;
}

.search-form input[type="search"] {
  flex: 1;
  border: none;
  padding: 8px 10px;
  font-size: 0.9rem;
  outline: none;
}

.search-form button {
  border: none;
  padding: 0 20px;
  background: var(--yellow-main);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-form button:hover {
  background: #ffd54d;
}

/* =========================================================
   BARRA ENVÍOS + LINKS
========================================================= */
.shipping-bar {
  background: #e24437; /* rojo más suave */
  box-shadow: 0 2px 4px rgba(0,0,0,0.18);
}

.shipping-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  display: flex;
  align-items: center;          /* todo en mismo nivel */
  justify-content: space-between;
  gap: 12px;
  font-size: 0.9rem;
  color: #fff;
}

.shipping-left {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shipping-bar-icon {
  font-size: 1rem;
}

.shipping-bar-text {
  font-weight: 600;
  line-height: 1.1;
}

/* Links (Nosotros / Contacto) */
.shipping-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-link {
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  font-size: 0.8rem;
  white-space: nowrap;
  line-height: 1.1;
}

.header-small {
  font-size: 0.72rem;
  opacity: 0.9;
}

.header-bold {
  font-weight: 700;
  font-size: 0.85rem;
}

/* =========================================================
   PAGE WRAPPER
========================================================= */
.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px;
}

/* =========================================================
   HERO / SLIDER
========================================================= */
.hero {
  margin-bottom: 24px;
}

.hero-slider {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  height: 360px;
  background: #111;
  color: #fff;
  box-shadow: var(--shadow-strong);
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.45s ease, transform 0.6s ease;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.7),
    rgba(0, 0, 0, 0.45) 40%,
    rgba(0, 0, 0, 0.15) 70%,
    rgba(0, 0, 0, 0) 100%
  );
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
}

.hero-content {
  position: relative;
  padding: 32px 48px;
  max-width: 460px;
}

.hero-content h1 {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 8px;
}

.hero-content p {
  font-size: 1rem;
  margin-bottom: 18px;
  color: rgba(255,255,255,0.92);
}

.btn-hero {
  display: inline-block;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--yellow-main);
  color: #000;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.btn-hero:hover {
  background: #ffd54d;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

/* Flechas del slider */
.hero-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.45);
  background: rgba(0,0,0,0.55);
  color: #fff;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.hero-btn:hover {
  background: rgba(0,0,0,0.85);
  transform: translateY(-50%) scale(1.05);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.4);
}

.hero-prev { left: 14px; }
.hero-next { right: 14px; }

/* =========================================================
   FEATURE CARDS
========================================================= */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.feature-card {
  border-radius: var(--radius-card);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
  box-shadow: var(--shadow-soft);
}

.feature-gamer {
  background: linear-gradient(135deg, #ff6f61, #d62828);
  color: #fff;
}

.feature-board {
  background: linear-gradient(135deg, #ffdd57, #ffb347);
  color: #432818;
}

.feature-card h2 {
  font-size: 1.1rem;
  margin-bottom: 4px;
}

.feature-card p {
  font-size: 0.9rem;
  max-width: 260px;
}

.feature-btn {
  margin-top: 12px;
  align-self: flex-start;
  padding: 6px 14px;
  font-size: 0.85rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  border: none;
  cursor: pointer;
}

/* =========================================================
   SECCIONES DE PRODUCTOS
========================================================= */
.home-section {
  margin-bottom: 28px;
}

.home-section h2 {
  font-size: 1.3rem;
  margin-bottom: 12px;
}

/* Grilla */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

/* Tarjeta de producto */
.product-card {
  background: var(--card-bg);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

/* Imagen */
.product-image {
  text-align: center;
  margin-bottom: 8px;
}

.product-image img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Nombre y precio */
.product-title {
  font-size: 0.9rem;
  margin-bottom: 4px;
  min-height: 38px;
}

.product-price {
  font-weight: 700;
  color: #b12704;
  margin-bottom: 8px;
  font-size: 0.95rem;
}

/* Botón agregar */
.btn-add {
  margin-top: auto;
  padding: 7px 8px;
  border-radius: 999px;
  border: none;
  background: var(--red-main);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.12s ease;
}

.btn-add:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.18);
}

/* =========================================================
   FOOTER
========================================================= */
.main-footer {
  background: var(--red-main);
  color: #fff;
  margin-top: 24px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 16px 24px;
}

.footer-top {
  margin-bottom: 10px;
}

.footer-logo {
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  color: #fff;
}

.footer-top p {
  font-size: 0.9rem;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 10px;
}

.footer-links a {
  font-size: 0.85rem;
  color: #ffe6e6;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.footer-bottom {
  font-size: 0.8rem;
  color: #ffe6e6;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 900px) {
  .header-inner {
    padding-bottom: 8px;
  }

  .shipping-bar-inner {
    flex-wrap: wrap;  /* puede partirse pero sigue en fila */
    row-gap: 4px;
  }

  .shipping-links {
    margin-left: auto;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .hero-slider {
    height: 280px;
  }

  .hero-content {
    padding: 20px 24px;
  }

  .hero-content h1 {
    font-size: 1.6rem;
  }
}

@media (max-width: 640px) {
  .btn-menu {
    display: inline-block;
  }

  .search-category {
    display: none;
  }

  .page {
    padding: 12px;
  }

  .hero-slider {
    height: 230px;
  }

  .hero-content {
    padding: 16px 18px;
    max-width: 75%;
  }

  .hero-content h1 {
    font-size: 1.35rem;
  }

  .hero-content p {
    font-size: 0.9rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .logo-text {
    font-size: 1.2rem;
  }

  /* mobile: envíos + enlaces siguen en el mismo nivel hasta que ya no quepan */
  .shipping-bar-inner {
    flex-wrap: wrap;
    align-items: center;
  }

  .shipping-links {
    gap: 14px;
  }
}
