/* =========================
   GENERAL
========================= */

body{
    margin:0;
    padding:0;
    background:var(--color-gris);
    font-family:'Poppins', sans-serif;
    overflow-x:hidden;
}

/* =========================
   CONTENEDOR
========================= */

.catalogo-contenedor{
    display:flex;
    gap:20px;
    align-items:flex-start;

    /* ❌ quitar pantalla completa */
    min-height:auto;

    /* ✅ centrar y limitar ancho */
    max-width:1200px;
    margin:30px auto;
    padding:0 15px;
}

/* =========================
   SIDEBAR
========================= */

.sidebar{
    width:260px;
    min-width:220px;
    max-width:260px;
    position:sticky;
    top:20px;
    height:fit-content;
}

.sidebar h2{
    font-size:32px;
    color:var(--color-principal);
    margin-bottom:30px;
}

.filtro{
    border-bottom:1px solid #ccc;
    padding:20px 0;
}

.filtro-titulo{
    display:flex;
    justify-content:space-between;
    align-items:center;
    font-size:18px;
    font-weight:bold;
    margin-bottom:20px;
    color:#333;
}

.filtro ul{
    list-style:none;
    padding:0;
    margin:0;
}

.filtro ul li{
    margin-bottom:12px;
    font-size:15px;
    color:#444;
    cursor:pointer;
    transition:0.3s;
}

.filtro ul li:hover{
    color:var(--color-rojo);
}

.checkbox{
    display:flex;
    align-items:center;
    gap:10px;
    font-size:15px;
    color:#444;
}

.checkbox input{
    width:18px;
    height:18px;
}

/* =========================
   PRODUCTOS
========================= */

.productos{
    flex:1;
 overflow:visible;
  
}

/* GRID RESPONSIVE REAL */
.grid-productos{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(160px, 1fr));
    gap:15px;
}

/* =========================
   CARD PRODUCTO
========================= */

.card-producto{
    background:white;
    border:1px solid #ddd;
    border-radius:6px;
    overflow:hidden;
    position:relative;
    transition:0.3s;
    font-size:13px;
    width:100%;
}

.card-producto:hover{
    transform:translateY(-3px);
    box-shadow:var(--sombra-media);
    border:1px solid rgba(90,45,12,0.2);
}

/* IMAGEN */
.card-producto img{
    width:100%;
    height:140px;
    object-fit:contain;
    background:white;
}

/* BODY */
.card-body{
    padding:10px;
}

/* =========================
   BOTÓN +
========================= */

.btn-mas{
    position:absolute;
    bottom:10px;
    right:10px;
    width:42px;
    height:42px;
    border-radius:50%;
    border:none;
    background:var(--color-rojo);
    color:white;
    font-size:26px;
    cursor:pointer;
    display:flex;
    align-items:center;
    justify-content:center;
    transition:0.3s;
}

.btn-mas:hover{
    transform:scale(1.1);
}

/* =========================
   DESCUENTO
========================= */

.descuento{
    position:absolute;
    top:10px;
    left:10px;
    background:#e31c1c;
    color:white;
    font-size:12px;
    font-weight:bold;
    padding:5px 10px;
    border-radius:5px;
    z-index:5;
}

/* =========================
   TEXTO PRODUCTO
========================= */

.nombre{
    font-size:14px;
    font-weight:bold;
    color:var(--color-negro);
    margin-bottom:5px;
}

.presentacion{
    border:1px solid var(--color-secundario);
    color:var(--color-principal);
    width:100%;
    padding:6px;
    text-align:center;
    border-radius:3px;
    font-size:12px;
    margin-bottom:8px;
}

.precio{
    font-size:16px;
    font-weight:bold;
    color:var(--color-principal);
}

/* STOCK */
.stock{
    margin-top:5px;
    font-size:12px;
}

.stock-ok{
    color:#198754;
}

.stock-bajo{
    color:var(--color-rojo);
}

.badge-no-disponible{
    position:absolute;
    top:10px;
    right:10px;
    background:var(--color-rojo);
    color:var(--color-blanco);
    font-size:12px;
    font-weight:700;
    padding:6px 10px;
    border-radius:6px;
    z-index:20;
    text-transform:uppercase;
}

.badge-pocas-unidades{
    position:absolute;
    top:10px;
    right:10px;
    background:var(--color-dorado);
    color:var(--color-negro);
    font-size:12px;
    font-weight:700;
    padding:6px 10px;
    border-radius:6px;
    z-index:20;
    text-transform:uppercase;
}

/* =========================
   PROMOCIONES
========================= */

.badge-promocion{
    position:absolute;
    top:10px;
    left:10px;
    background:#dc3545;
    color:#fff;
    padding:5px 10px;
    border-radius:6px;
    font-size:11px;
    font-weight:600;
    z-index:10;
}

.precio-anterior{
    text-decoration:line-through;
    color:#999;
    font-size:13px;
}

.precio-promocion{
    color:#dc3545;
    font-size:20px;
    font-weight:700;
}

.promo-fin{
    color:#dc3545;
    font-size:12px;
    font-weight:600;
}

/* =========================
   SIN PRODUCTOS
========================= */

.sin-productos{
    background:white;
    padding:40px;
    border-radius:10px;
    text-align:center;
    font-size:20px;
}

/* =========================
   CATEGORÍA ACTIVA
========================= */

.categoria-activa a{
    color:var(--color-dorado) !important;
    font-weight:bold;
    position:relative;
    padding-left:18px;
}

.categoria-activa a::before{
    content:"➜";
    position:absolute;
    left:0;
}

/* =========================
   LINKS FILTRO
========================= */

.filtro ul li a{
    text-decoration:none;
    color:var(--color-dorado);
    transition:0.3s;
    display:block;
}

.filtro ul li a:hover{
    color:var(--color-rojo);
    padding-left:5px;
}

/* =========================
   RESPONSIVE TABLET
========================= */

@media(max-width:480px){

    .catalogo-contenedor{
        flex-direction:column;
    }

    .sidebar{
      width:260px;
    position:relative;
    height:auto;
    }

    .productos{
        max-height:none;
    }
}

/* =========================
   RESPONSIVE MÓVIL
========================= */

@media(max-width:600px){

    .grid-productos{
        grid-template-columns:repeat(2, 1fr);
    }

    .sidebar h2{
        font-size:24px;
    }

    .nombre{
        font-size:13px;
    }

    .precio{
        font-size:14px;
    }
}
.filtro-promociones{
    list-style:none;
    margin:10px 0;
}

.filtro-promociones a{
    display:block;
    padding:12px 15px;
    background:linear-gradient(135deg,#ff6b35,#ff3d00);
    color:#fff;
    text-decoration:none;
    border-radius:10px;
    font-weight:600;
    text-align:center;
    transition:.3s;
    box-shadow:0 3px 10px rgba(255,61,0,.25);
}

.filtro-promociones a:hover{
    transform:translateY(-2px);
    box-shadow:0 6px 15px rgba(255,61,0,.35);
}

.filtro-promociones.categoria-activa a{
    background:linear-gradient(135deg,#e53935,#b71c1c);
}
.filtro-promociones.categoria-activa a{
    background:#ff5722;
    color:#fff;
    border-color:#ff5722;
}

.loading-productos{
    text-align:center;
    padding:40px;
    font-size:18px;
    font-weight:bold;
}
.grid-productos{
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    padding: 10px;
}

/* CARD */
.card-producto{
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,.08);
    transition: .25s;
}

.card-producto:hover{
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,.15);
}

/* LINK */
.card-link{
    text-decoration: none;
    color: inherit;
    display: block;
}

/* IMAGEN */
.img-container{
    position: relative;
    height: 180px;
    overflow: hidden;
}

.img-container img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: .3s;
}

.card-producto:hover img{
    transform: scale(1.05);
}

/* BADGES */
.badge{
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    color: #fff;
}

.badge-red{ background: #e74c3c; }
.badge-orange{ background: #f39c12; }

.badge-discount{
    position: absolute;
    top: 10px;
    right: 10px;
    background: #27ae60;
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
}

/* BODY */
.card-body{
    padding: 10px;
}

.title{
    font-size: 14px;
    margin: 0 0 5px;
    font-weight: 600;
}

.meta{
    font-size: 12px;
    color: #777;
    margin-bottom: 6px;
}

/* PRICE */
.price{
    font-size: 16px;
    font-weight: bold;
    color: #111;
}

.price-old{
    font-size: 12px;
    text-decoration: line-through;
    color: #999;
}

/* EMPTY STATE */
.empty-state{
    text-align: center;
    padding: 40px;
    color: #777;
}
.promo-fin-activa{
    font-size: 12px;
    color: #ffd36a;
    font-weight: 600;
    margin-top: 5px;
}

.promo-fin-finalizada{
    font-size: 12px;
    color: #ff4d4d;
    font-weight: 600;
    margin-top: 5px;
}