/* styles.css - limpio y modular */
:root{
  --gap: 16px;
  --bg: #f5f6f8;
  --card: #fff;
  --accent: #111827;
  --muted: #6b7280;
  --btn: #111827;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter, system-ui, Arial, sans-serif;
  background:var(--bg);
  color:var(--accent);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
img {
    /* max-width: 100%; */
    height: auto;
    display: block;
}

.btn-wsp {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #25D366;
    color: white;
    font-size: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    z-index: 100000;
}

.btn-wsp:hover {
  text-decoration: none;
  color: #25D366;
  background-color: white;
}


/* Header */
.site-header{
  display:flex;
  flex-direction: row;
  justify-content:space-between;
  align-items:center;
  padding:12px 24px;
  background:#ffffff;
  box-shadow:0 2px 6px rgba(0,0,0,0.04);
  position:sticky;
  top:0;
  z-index:60;
  flex-wrap:wrap;
  gap:12px;
}

.site-header h1, .site-header p {
  position:-webkit-sticky;
  margin:0;
}

.hamburguesa {
  display: none;
  font-size: 18px;
  background: black;
  color: white;
  border: none;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 6px;
}

.menu-seccion-btn {
  display: none;
}

/* Mostrar siempre el botón de filtros (ID específico) en desktop y mobile */
#btn-filtros {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
}

.brand{font-weight:700;font-size:1.2rem}
.main-nav ul{list-style:none;margin:0;padding:0;display:flex;gap:12px;align-items:center}
.main-nav a{color:var(--accent);text-decoration:none}

.site-footer {
  justify-content: center;
  justify-items: center;
  display:flex;
  flex-direction: row;
  align-items:center;
  padding:12px 24px;
  background:#ffffff;
  box-shadow:0 2px 6px rgba(0,0,0,0.04);
  position:sticky;
  top:0;
  z-index:60;
  flex-wrap:wrap;
  gap:12px;
}

/* Opcional: ajustar estilos de los otros elementos si es necesario */
.site-footer div {
  display: flex;                  /* Para que el contenido interno también pueda alinearse centrado */
  align-items: center;
}
.site-footer img {
  display: block;                 /* Evita espacios extra debajo de la imagen */
}

/* ========== MENÚ DE SECCIONES ========== */
.menu-seccion-dropdown {
  position: static;
  display:flex;
  flex-direction: column;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-seccion-dropdown.active {
  pointer-events: all;
  opacity: 1;
}

.menu-seccion-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-seccion-dropdown.active .menu-seccion-overlay {
  opacity: 1;
}

.menu-seccion-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: white;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding-top: 0;
  overflow-y: auto;
  z-index: 1000;
}

.menu-seccion-dropdown.active .menu-seccion-content {
  transform: translateX(0);
}

.menu-seccion-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #333;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.menu-seccion-close:hover {
  color: #000;
}

.menu-seccion-content h2 {
  padding: 16px 20px;
  margin: 0;
  font-size: 20px;
  border-bottom: 1px solid #eee;
  margin-top: 8px;
}

#menu-seccion-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
}

#menu-seccion-list li {
  border-bottom: 1px solid #f0f0f0;
  position: relative;
}

#menu-seccion-list a {
  display: block;
  padding: 16px 20px;
  color: #333;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s ease, color 0.2s ease;
}

#menu-seccion-list a:hover {
  background: #f5f5f5;
  color: #000;
}

#menu-seccion-list a:active {
  background: #e8e8e8;
}

/* ========== SUBMENU ========== */
.menu-item-with-submenu {
  position: relative;
}

.submenu {
  position: fixed;
  list-style: none;
  padding: 0;
  margin: 0;
  background: #f9f9f9;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  border-top: 1px solid #eee;
}

.menu-item-with-submenu:hover .submenu {
  max-height: 500px;
}

.submenu li {
  border-bottom: 1px solid #f0f0f0;
}

.submenu li a {
  padding: 12px 20px 12px 32px;
  font-size: 14px;
  color: #666;
}

.submenu li a:hover {
  background: #f0f0f0;
  color: #000;
}

/* ========== BANNER SUBSECCIÓN ========== */
.submenu-banner {
  padding: 8px 20px;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: white;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

/* iamgen del banner */

.imgcel{
  display: none;
}
.imgpc{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}
@media (max-width: 768px) {
  .imgpc{
    display: none;
  }
  .imgcel{
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
  }
}

/* Cart dropdown */
.cart-wrapper{position:relative}
.cart-btn{
  background:transparent;
  border:1px solid transparent;
  padding:8px 10px;
  border-radius:6px;
  cursor:pointer;
  font-size:1rem;
}
.cart-dropdown{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  width:320px;
  max-height:360px;
  background:var(--card);
  border-radius:8px;
  box-shadow:0 8px 30px rgba(0,0,0,0.12);
  overflow:hidden;
  transform-origin:top right;
  display:none;
  z-index:70;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .14s ease, transform .14s ease;
  z-index: 9999;
}
.cart-dropdown[aria-hidden="false"]{
  display:block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cart-wrapper:hover .cart-dropdown {
  display: block;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  z-index: 9999;
}

.cart-list{max-height:240px;overflow:auto;padding:8px}
.cart-item{
  display:flex;
  gap:8px;
  padding:8px;
  border-bottom:1px solid #eee;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.cart-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
.cart-item img{width:56px;height:56px;object-fit:cover;border-radius:6px}

/* Layout */
.layout{display:flex;gap:var(--gap);padding:20px;align-items:flex-start}
.price-min-max{
  margin-top: 9px;
  width: 100px;
  padding: 6px;
  border: 1px solid #ccc;
  border-radius: 4px;
}
.filter-actions{
  gap:28px;margin-top:12px;
}
.cerrar-filtros {
  display: none;
  position: absolute;
  right: 10px;
  top: 10px;
  border: none;
  background: none;
  font-size: 24px;
  cursor: pointer;
}
.filters{
  width:250px;
  background:var(--card);
  padding:16px;
  border-radius:8px;
  box-shadow:0 6px 18px rgba(0,0,0,0.03);
  position:static;
  top:72px;
  /* height:calc(100vh - 120px); */
  overflow:auto;
  font-size: larger;
  justify-content: space-between;
}

/* Mantener el panel de filtros oculto por defecto hasta que se quite la clase 'oculto' */
#filters.oculto { display: none; }
.filter-colors{
  display:flex;
  gap:8px;
  flex-direction: column;
  margin-top:8px;
}
.catalog{
  flex:1;
}
.hero-banner{
  position: relative;
  margin-bottom: 18px;
}

.hero-banner img.imagen-presentacion{
  width: 100%;
  height: auto;
  border-radius: 10px;
}

.hero-banner::before{
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 10px;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

.hero-text{
  position: absolute;
  left: 50%;
  top: 87%;
  transform: translate(-50%, -50%);
  z-index: 2;
  color: #000000;
  text-align: center;
  max-width: 900px;
  padding: 18px 22px;
}

/* .hero-text p{font-size:2rem;line-height:1.15;margin:0} */

@media (max-width: 1460px){
  .hero-text{display:none}
}
.catalog-top{display:flex;justify-content:space-between;align-items:center;padding:8px 0}
.cards-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(220px,1fr));
  gap:16px;
  margin-top:12px;
}

/* Card */
.card{
  background:var(--card);
  border-radius:8px;
  position:relative;
  display: flex;
  flex-direction: column;
  overflow:hidden;
  box-shadow:0 4px 16px rgba(0,0,0,0.05);
  cursor:pointer;
  transition:transform .12s ease;
}
.card:hover{transform:translateY(-6px)}
.card-media{width:100%;height:260px;overflow:hidden;position:relative}
.card-media img{width:100%;height:100%;object-fit:cover;display:block;
  /* transition:opacity .3s ease; */
}
.card-body{padding:12px;}
.card-title{font-weight:600;margin:0 0 6px}
.card-price{font-weight:700;margin-bottom:8px}
.card-add{
  display: block;
  font-size: large;
  margin-top: 10px;
  margin-left: auto;
  background: black;
  color: white;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  border-radius: 6px;
}

/* Modal */
.modal{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.45);
  z-index:90;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
.modal[aria-hidden="false"]{opacity:1;pointer-events:auto}
.modal-content{
  background:var(--card);
  width:min(1100px,95%);
  max-height:90vh;
  overflow:auto;
  border-radius:10px;
  padding:18px;
  position:relative;
}
.modal-close{position:absolute;right:12px;top:12px;border:none;background:transparent;font-size:18px;cursor:pointer}
.modal-grid{display:grid;grid-template-columns:1fr 360px;gap:16px}
.modal-images{display:flex;flex-direction:column;gap:8px}
.modal-images img{width:100%;height:420px;object-fit:cover;border-radius:8px}
.modal-info{padding:8px}

/* Buttons */
.btn{ font-size: large;
  background:var(--btn);color:white;border:none;padding:10px 14px;border-radius:8px;margin:auto;cursor:pointer}
.btn.secondary{background:transparent;color:var(--btn);border:1px solid #e5e7eb}

/* Estilos para botones de color en el panel de filtros */
.filter-color-btn{
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ddd;
  cursor: pointer;
  display: inline-block;
  margin-right: 8px;
  margin-bottom: 8px;
  padding: 0;
  vertical-align: middle;
  transition: transform .15s ease, box-shadow .15s ease, border-color .12s ease;
}

/* mapeo básico de colores usados en products.json */
.filter-color-btn[data-color="blanco"]{ background:#ffffff; border-color:#c7c7c7; }
.filter-color-btn[data-color="negro"]{ background:#111111; border-color:#111111; }
.filter-color-btn[data-color="gris"]{ background:#808080; border-color:#808080; }
.filter-color-btn[data-color="melange"]{ background: linear-gradient(135deg, #d3d3d3 0%, #808080 100%); border-color:#808080; }

/* Variantes de Azul-marino (soporte mayúsculas/minúsculas/espacios) */
.filter-color-btn[data-color="Azul-marino"],
.filter-color-btn[data-color="azul-marino"],
.filter-color-btn[data-color="Azul Marino"],
.filter-color-btn[data-color="azul marino"]{
  background:#0b3d91; border-color:#0b3d91;
}

/* Efectos */
.filter-color-btn:hover{ transform: scale(1.06); border-color:#666; box-shadow:0 6px 16px rgba(0,0,0,0.08); }

.filter-color-btn.activo{
  box-shadow: 0 0 0 3px white, 0 0 0 6px #111827;
  border-color: #111827;
}

/* checkmark sobre el botón activo */
.filter-color-btn.activo::after{
  content: '✓';
  position: absolute;
  font-size: 14px;
  color: white;
  width: 20px;
  height: 20px;
  line-height: 20px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  transform: translateY(-2px);
}

/* Ajuste visual para botones claros donde el check debe ser oscuro */
.filter-color-btn[data-color="blanco"].activo::after{
  background:white; color:#111827;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}

/* espacio contenedor */
#filter-color { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }

/* ========== RESPONSIVE ========== */
@media (max-width:900px){
  .layout{flex-direction:column;padding:12px}
  .filters{width:100%;height:auto;position:static}
  .catalog-top{display: flex; justify-content: space-between; flex-direction: row; align-items: center;}
  .cards-grid{ 
    display: flex;
    flex-wrap: wrap; 
    margin: 0 auto; 
    justify-content: center;  
  }
  .card{
    margin: 5px;
  }
  .catalog{
    flex: 1;
    display: grid;
    gap: 10px;
  }
  .catalog img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
  }
}

/* ========== MODO MOBILE ========== */
@media (max-width: 768px) {
    .cart-dropdown{
        width: 250px; 
    }
    .cerrar-filtros {
      display: block;
      padding: 55px;
    }
    .card{
      margin: 5px;
    }
    .hamburguesa {
        display: block;
    }

    .submenu {
      position: relative;
      top: 100%;
      left: 0;
      background: white;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      border-radius: 4px;
      min-width: 180px;
      max-height: 0;
      overflow: hidden;
      transition: max-height 0.3s ease, opacity 0.3s ease;
      opacity: 0;
      z-index: 1001;
      border: 1px solid #eee;
      margin-top: 0;
      list-style: none;
      padding: 0;
    }
    .menu-item-with-submenu {
      position: relative;
    }
    .menu-item-with-submenu:hover .submenu {
      max-height: 400px;
      opacity: 1;
    }
    .submenu li {
      border: none;
    }
    .submenu li a {
      padding: 12px 16px;
      font-size: 13px;
      color: #333;
      border-bottom: none;
      display: block;
      white-space: nowrap;
    }
    .submenu li a:hover {
      background: #f5f5f5;
      color: #000;
    }
    .submenu-banner {
      display: none;
    }

    .menu-seccion-btn {
        display: block;
        order: -1;
    }

    /* Mejor control de alto y scroll para aside filtros en móvil */
    #filters {
        background: #f2f2f2;
        padding: 15px;
        position: sticky;
        top: 60px;
        left: 0;
        width: 100%;
        max-height: calc(100vh - 72px); /* permite que el aside no exceda la ventana */
        overflow-y: auto;                /* habilita scroll interno cuando sea necesario */
        -webkit-overflow-scrolling: touch;/* mejor scrolling en iOS */
        z-index: 5;
    }

    /* Asegurar que el contenedor .filters también tenga scrolling si se muestra fuera del flujo */
    .filters {
        /* mantener comportamiento general, pero permitir scroll interno */
        max-height: calc(100vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    #filters.oculto {
        display: none;
    }

    #filters {
        background: #f2f2f2;
        padding: 15px;
        position: sticky;
        top: 60px;
        left: 0;
        width: 100%;
        height: 100%;
        overflow-y: auto;
        z-index: 5;
    }

    main {
        margin-left: 0 !important;
    }

    .menu-seccion-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 999;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .menu-seccion-dropdown.active {
        pointer-events: all;
        opacity: 1;
    }

    .menu-seccion-content {
        position: absolute;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        background: white;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        display: flex;
        flex-direction: column;
        overflow-y: auto;
    }

    .menu-seccion-dropdown.active .menu-seccion-content {
        transform: translateX(0);
    }
}

/* ========== VERSIÓN DESKTOP (se hace por separado) ========== */
@media (min-width: 769px) {
  .menu-seccion-btn {
    display: none;
  }

  .menu-seccion-dropdown {
    position: static;
    width: auto;
    height: auto;
    opacity: 1;
    pointer-events: all;
    background: none;
    z-index: auto;
  }

  .menu-seccion-overlay {
    display: none;
  }

  .menu-seccion-content {
    position: relative;
    width: auto;
    max-width: none;
    height: auto;
    background: none;
    box-shadow: none;
    transform: none;
    padding: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
  }

  .menu-seccion-close {
    display: none;
  }

  .menu-seccion-content h2 {
    display: none;
  }

  #menu-seccion-list {
    display: flex;
    flex-direction: row;
    gap: 0;
    margin: 0;
    padding: 0;
  }

  #menu-seccion-list li {
    border: none;
    position: relative;
  }

  #menu-seccion-list a {
    padding: 12px 16px;
    border-bottom: 2px solid transparent;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--accent);
  }

  #menu-seccion-list a:hover {
    background: transparent;
    color: #000;
    border-bottom-color: #000;
  }


  /*--------------- submenu -------------*/
  .menu-item-with-submenu {
    position: relative;
  }

  .menu-item-with-submenu:hover .submenu {
    max-height: 400px;
    opacity: 1;
  }

  .submenu li {
    border: none;
  }

  .submenu li a {
    padding: 12px 16px;
    font-size: 13px;
    color: #333;
    border-bottom: none;
    display: block;
    white-space: nowrap;
  }

  .submenu li a:hover {
    background: #f5f5f5;
    color: #000;
  }

  .submenu-banner {
    display: none;
  }
}

.filter-group {
  display: block;
}

.filter-group.hidden {
  display: none;
}
