/* ===================================================== */
/* CUPISSA — LAYOUT ESTRUCTURAL */
/* ===================================================== */

/* ========================= */
/* HEADER PRINCIPAL */
/* ========================= */

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 1000;
}

.header-logo img {
  height: 50px;
  object-fit: contain;
}

.logo-light {
  display: none;
  height: 50px;
  transform: scale(1.1);
}

.light-mode .logo-dark {
  display: none;
}

.light-mode .logo-light {
  display: block;
  height: 50px;
  transform: scale(1.1);
}

.header-search {
  flex: 1;
  display: flex;
  justify-content: center;
}

.header-search input {
  width: 60%;
  max-width: 500px;
  padding: 10px 15px;
  border-radius: var(--radius-medium);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.header-search input:focus {
  outline: none;
  border-color: var(--color-pink);
}

.desktop-search-wrapper {
  position: relative;
  width: 60%;
  max-width: 500px;
}

.desktop-search-wrapper input {
  width: 100%;
}

#clearDesktopSearch {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: #aaa;
  display: none;
}

#clearDesktopSearch:hover {
  color: #fff;
}

.header-explora {
  display: flex;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
}

.header-explora:hover {
  color: var(--color-pink);
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-icon {
  position: relative;
  font-size: 20px;
  cursor: pointer;
}

.header-icon .count {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--gradient-main);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 50px;
}

/* ========================= */
/* HEADER NAV DESKTOP */
/* ========================= */

.header-nav {
  display: flex;
  gap: 40px;
  align-items: center;
  font-size: 14px;
}

.nav-link {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.nav-link:hover {
  color: var(--color-pink);
}

/* ========================= */
/* BARRA DE MUNDOS */
/* ========================= */

.mundos-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: var(--mundos-height);
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  z-index: 995;
}

/* Ocultar scrollbar */
.mundos-bar::-webkit-scrollbar {
  display: none;
}

.mundos-bar {
  scrollbar-width: none;
}

.mundo-item {
  padding: 8px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(6px);
  color: var(--text-secondary);
  white-space: nowrap;
  font-size: 13px;
  transition: all var(--transition-fast);
}

.mundo-item:hover {
  border-color: var(--color-pink);
  color: var(--text-primary);
}

.mundo-item.active {
  background: var(--gradient-main);
  color: #fff;
  border: none;
  box-shadow: 0 4px 15px rgba(244,105,154,0.4);
}

main {
  padding-top: calc(var(--header-height) + var(--mundos-height));
}

/* ========================= */
/* FOOTER */
/* ========================= */

.footer {
  background-color: var(--bg-secondary);
  padding: 60px 40px 40px;
  border-top: 1px solid var(--border-color);
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.footer a:hover {
  color: var(--color-pink);
}

.footer-bottom {
  margin-top: 40px;
  font-size: 13px;
  text-align: center;
}

/* ========================= */
/* FOOTER SOCIAL */
/* ========================= */

.footer-social {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.footer-social img {
  width: 22px;
  height: 22px;
  filter: brightness(0) invert(1);
  transition: transform var(--transition-fast);
}

.footer-social img:hover {
  transform: scale(1.2);
}

/* ========================= */
/* FOOTER PAYMENT LOGOS */
/* ========================= */

.footer-payment-grid img {
  width: 60px;
  object-fit: contain;
  opacity: 0.9;
  transition: transform var(--transition-fast);
}

.footer-payment-grid img:hover {
  transform: scale(1.05);
}

.contraentrega {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* ========================= */
/* LAYOUT CATÁLOGO */
/* ========================= */

.catalogo-layout {
  display: flex;
  gap: 40px;
  padding: 40px;
}

.filtros-lateral {
  width: 250px;
  position: sticky;
  top: calc(var(--header-height) + var(--mundos-height) + 20px);
  height: fit-content;
}

.catalogo-contenido {
  flex: 1;
}

.filtros-activos {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filtro-tag {
  background: var(--gradient-soft);
  padding: 6px 12px;
  border-radius: 50px;
  font-size: 13px;
  cursor: pointer;
}

/* ========================= */
/* PANEL CARRITO */
/* ========================= */

.carrito-panel {
  position: fixed;
  top: 0;
  right: 0;
  transform: translateX(100%);
  width: 380px;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-medium);
}

.carrito-panel.active {
  transform: translateX(0);
}

.carrito-header {
  padding: 20px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.carrito-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.carrito-footer {
  padding: 20px;
  border-top: 1px solid var(--border-color);
}

.btn-whatsapp {
  width: 100%;
  padding: 12px;
  background: #25D366;
  color: white;
  border-radius: var(--radius-small);
}

/* ========================= */
/* RESPONSIVE */
/* ========================= */

.btn-filtros-mobile {
  display: none;
}

/* ===================================================== */
/* HEADER MOBILE APP STYLE */
/* ===================================================== */

.header-mobile-left {
  display: none;
}

.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

/* Buscador móvil oculto */
.mobile-search {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background: var(--bg-primary);
  padding: 15px 20px;
  transform: translateY(-100%);
  transition: transform var(--transition-medium);
  z-index: 998;
  box-shadow: var(--shadow-soft);
}

.mobile-search.active {
  transform: translateY(0);
}

.mobile-search input {
  width: 100%;
  padding: 10px 15px;
  border-radius: var(--radius-medium);
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Menú drawer vertical */
.mobile-menu {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height));
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  padding: 30px 20px;
  gap: 25px;
  transform: translateY(-100%);
  transition: transform var(--transition-medium);
  z-index: 990;
}

.mobile-menu.active {
  transform: translateY(0);
}

.mobile-menu a {
  font-size: 16px;
  color: var(--text-primary);
}

/* ========================= */
/* CORRECCIÓN FILTROS DESKTOP */
/* ========================= */

@media (min-width: 1025px) {
  .filtros-header-mobile {
    display: none;
  }

  .filtros-lateral {
    background: transparent;
  }
}

.filtros-contenido-scroll {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.filtros-lateral {
  padding-right: 10px;
}

.filtros-contenido-scroll {
  padding: 10px 0;
}

/* ===================================================== */
/* RESPONSIVE 1024px */
/* ===================================================== */

@media (max-width: 1024px) {

  /* ================= BOTÓN FILTRAR ================= */

  .btn-filtros-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: calc(var(--header-height) + var(--mundos-height));
    left: 0;
    width: 100%;
    height: 50px;
    background: var(--gradient-main);
    color: #fff;
    font-weight: 600;
    z-index: 950;
  }

  /* ================= FILTROS LATERAL ================= */

  .filtros-lateral {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: var(--bg-primary);
    padding: 100px 25px 40px 25px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--transition-medium);
    z-index: 3000;
    max-width: 100vw !important;
  }

  .filtros-lateral.active {
    transform: translateX(0);
  }

  .filtros-header-mobile {
    position: fixed;
    top: 25px;
    right: 25px;
    z-index: 3100;
  }

  #cerrarFiltrosMobile {
    font-size: 28px;
    color: #ffffff;
    font-weight: bold;
    cursor: pointer;
  }

  /* ================= LAYOUT CATÁLOGO ================= */

  .catalogo-layout {
    display: block;
    padding: 0 !important;
    gap: 0 !important;
    width: 100%;
    max-width: 100%;
  }

  .catalogo-contenido {
    width: 100%;
    max-width: 100%;
  }

  /* ================= OVERFLOW FIX ================= */

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

  /* ================= FOOTER ================= */

  .footer {
    padding: 40px 20px 30px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .footer-bottom {
    margin-top: 30px;
    text-align: center;
  }

}


/* ========================= */
/* RESTORE DESKTOP HEADER */
/* ========================= */

@media (min-width: 769px) {

  .header {
    justify-content: space-between;
  }

  .header-left {
    display: none;
  }

  .header-logo {
    position: static;
    transform: none;
  }

  .header-search {
    display: flex;
  }

  .header-nav {
    display: flex;
  }

  .mobile-search,
  .mobile-menu {
    display: none !important;
  }

  .header-mobile-left {
  display: none;
}

.search-toggle {
  display: none;
}

.mobile-search,
.mobile-menu {
  display: none !important;
}

}

/* ===================================================== */
/* MOBILE 768px */
/* ===================================================== */

@media (max-width: 768px) {

  /* ================= HEADER ================= */

  .header {
    padding: 0 20px;
    justify-content: space-between;
    background: var(--bg-primary);
    backdrop-filter: none;
    border: none;
  }

  .header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .header-search,
  .header-nav {
    display: none;
  }

  .hamburger {
    display: block;
  }

  .header-mobile-left {
    display: flex;
    align-items: center;
  }

  /* ================= CARRITO ================= */

  .carrito-panel {
    width: 100%;
  }

  /* ================= RASTREO ================= */

  .rastreo-box {
    flex-direction: column;
    align-items: center;
  }

  .rastreo-box input,
  .rastreo-box button {
    width: 100%;
  }

  /* ================= FOOTER ================= */

  .footer {
    padding: 40px 20px 30px;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .footer-bottom {
    margin-top: 30px;
    text-align: center;
  }

  /* ================= BUSCADOR MOBILE ================= */

  .mobile-search-bar {
    display: block;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 56px;
    padding: 8px 20px;
    background: var(--bg-primary);
    backdrop-filter: none;
    border: none;
    z-index: 960;
  }

  .mobile-search-bar input {
    width: 100%;
    height: 40px;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: #111;
    color: var(--text-primary);
  }

.mobile-search-wrapper {
  position: relative;
}

.clear-search {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 16px;
  color: #aaa;
  display: none;
}

.clear-search:hover {
  color: #fff;
}

  /* ================= MUNDOS ================= */

  .mundos-bar {
    position: fixed;
    top: calc(var(--header-height) + 56px);
    left: 0;
    width: 100%;
    background: var(--bg-secondary);
    backdrop-filter: none;
    border: none;
    z-index: 970;
    margin-bottom: -1px;
  }

  /* ================= BOTÓN FILTRAR ================= */

  .btn-filtros-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: calc(var(--header-height) + 56px + var(--mundos-height));
    left: 0;
    width: 100%;
    height: 50px;
    background: var(--gradient-main);
    color: #fff;
    font-weight: 600;
    z-index: 965;
    margin: 0;
    border: none;
    box-shadow: none;
  }

  /* ================= AJUSTE CONTENIDO ================= */

  main {
    padding-top: calc(
      var(--header-height) +
      56px +
      var(--mundos-height) +
      50px
    );
  }

}

@media (max-width: 600px) {

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

}

