/* =========================================================
   ESTILOS EXCLUSIVOS: CATÁLOGO Y BUSCADOR DE TIENDA
========================================================= */

.bg-gris { background-color: #f9f9f9; }

/* ================== STORE TOOLBAR (BUSCADOR EXCLUSIVO) ================== */
.header-bottom-row {
    background-color: var(--color-primario); 
    display: flex; 
    justify-content: center;
    align-items: center; 
    padding: 5px 5%; 
    border-top: 1px solid rgba(255, 255, 255, 0.1); 
    width: 100%; 
    z-index: 995;
}
.search-container { max-width: 600px; width: 100%; }
.search-form { display: flex; border-radius: 6px; overflow: hidden; background: #fff; height: 40px; }
.search-form input { flex: 1; border: none; padding: 8px 15px; outline: none; font-size: 0.95rem; min-width: 0; }
.search-form button { background-color: var(--color-acento); color: white; border: none; padding: 0 20px; font-size: 1.1rem; transition: background 0.3s; cursor: pointer; }
.search-form button:hover { background-color: #005bb5; }

/* ================== LAYOUT TIENDA Y SIDEBAR ================== */
.tienda-layout { display: grid; grid-template-columns: 5fr 19fr; gap: 30px; padding: 40px 5%; max-width: 1500px; margin: 0 auto; align-items: start; }
.btn-mostrar-filtros { display: none; }

.sidebar-categorias { width: 100%; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); height: fit-content; position: sticky; top: 20px; }
.sidebar-header-movil { display: none; }
.titulo-sidebar { font-size: 1.1rem; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 15px; text-transform: uppercase; font-weight: 800; color: var(--color-primario); }
.mt-3 { margin-top: 30px; }

.lista-categorias { list-style: none; }
.cat-item { border-bottom: 1px solid #f0f0f0; }
.cat-item > a { display: inline-block; padding: 12px 0; font-weight: 600; color: #444; font-size: 0.95rem; }
.cat-item.has-children { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; cursor: pointer; }
.cat-item.has-children i { color: #888; font-size: 0.8rem; transition: transform 0.3s; }
.sub-categorias { width: 100%; list-style: none; padding-left: 15px; display: none; margin-bottom: 10px; }
.cat-item.abierta .sub-categorias { display: block; }
.cat-item.abierta > i { transform: rotate(180deg); color: var(--color-acento); }
.sub-categorias li a { display: block; padding: 8px 0; font-size: 0.9rem; color: #666; }

.filtro-precio { padding-top: 10px; }
.slider-precio { width: 100%; margin-bottom: 15px; accent-color: var(--color-acento); }
.rango-valores { display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem; gap: 10px;}
.btn-filtrar-precio { background: #555; color: #fff; padding: 8px 15px; border-radius: 4px; font-weight: 800; font-size: 0.8rem; border: none; cursor: pointer;}

/* ================== GRID DE PRODUCTOS ================== */
.productos-main { width: 100%; }
.grid-productos-tienda { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.card-prod-tienda { background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.06); position: relative; display: flex; flex-direction: column; transition: transform 0.3s; border: 1px solid #eee; }
.card-prod-tienda:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.2); }
.badge-oferta { position: absolute; top: 10px; left: 10px; border: 1px solid #333; padding: 3px 10px; font-size: 0.75rem; font-weight: bold; border-radius: 15px; z-index: 2; text-transform: uppercase; background: rgba(255,255,255,0.9);}
.img-contenedor { width: 100%; aspect-ratio: 1; overflow: hidden; }
.img-contenedor img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.info-prod-tienda { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.cat-etiqueta { font-size: 0.7rem; color: #1c881c; font-weight: 700; margin-bottom: 10px; text-transform: uppercase; }
.titulo-prod { font-size: 0.95rem; line-height: 1.4; font-weight: 600; margin-bottom: auto; color: #222; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; height: 42px; }
.precio-prod { font-size: 1.3rem; font-weight: 800; margin: 15px 0; color: var(--color-primario); }

.btn-add-cart { border: 2px solid #222; background: transparent; color: #222; padding: 10px 8px; border-radius: 25px; font-weight: 700; width: 100%; font-size: 0.8rem; text-transform: uppercase; cursor: pointer; transition: all 0.3s; }
.btn-add-cart:hover { background: #222; color: #fff; }

.paginacion { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 50px; }
.page-num, .page-nav { width: 40px; height: 40px; border-radius: 50%; background: #eaeaea; font-weight: 600; border: none; cursor: pointer;}
.page-num.actual { background: transparent; border: 2px solid #222; cursor: default; }

/* ================== MEDIA QUERIES (TIENDA MÓVIL) ================== */
@media (max-width: 992px) {
    .header-bottom-row { padding: 10px 15px; }
    .search-container { flex: 1; min-width: 0; } 
    .search-form { height: 35px; border-radius: 20px; }
    .search-form input { padding: 5px 12px; font-size: 0.85rem; }
    .search-form button { padding: 0 15px; font-size: 1rem; }
    
    .tienda-layout { display: flex; flex-direction: column; padding: 25px 20px; gap: 15px;}
    .btn-mostrar-filtros { display: block; width: 100%; padding: 15px; background: #fff; border: 1px solid #ddd; border-radius: 8px; font-weight: 700; margin-bottom: 10px; font-size: 0.9rem; text-transform: uppercase; }

    /* Sidebar Flotante en Móvil */
    .sidebar-categorias { position: fixed; top: 0; left: 0; transform: translateX(-100%); height: 100vh; width: 85%; max-width: 350px; z-index: 1060; border-radius: 0; overflow-y: auto; transition: transform 0.4s ease; padding: 0; }
    .sidebar-categorias.activo { transform: translateX(0); }
    
    .sidebar-header-movil { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 20px 25px; 
        border-bottom: 1px solid #eee; 
        background: #fff; 
    }
    
    .sidebar-header-movil h3 { 
        font-size: 1.1rem; 
        font-weight: 800; 
        text-transform: uppercase; 
        margin: 0; 
    }

    /* --- ESTILO PARA LA "X" DE CERRAR FILTROS --- */
    .btn-cerrar-filtro-estilizado {
        background: transparent;
        border: none;
        color: #aaa;
        font-size: 1.5rem;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 5px;
        transition: color 0.3s ease, transform 0.3s ease;
    }

    .btn-cerrar-filtro-estilizado:hover,
    .btn-cerrar-filtro-estilizado:active {
        color: var(--color-acento);
        transform: scale(1.1);
    }

    .sidebar-categorias .titulo-sidebar, .sidebar-categorias ul, .sidebar-categorias .filtro-precio { padding-left: 25px; padding-right: 25px; }
    .sidebar-categorias .titulo-sidebar { margin-top: 20px; }
    
    .grid-productos-tienda { grid-template-columns: repeat(3, 1fr); gap: 15px; }
}

@media (max-width: 576px) {
    .grid-productos-tienda { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .card-prod-tienda { border-radius: 6px; }
    .info-prod-tienda { padding: 12px; }
    .cat-etiqueta { font-size: 0.6rem; margin-bottom: 5px;}
    .titulo-prod { font-size: 0.8rem; height: 36px; line-height: 1.3; } 
    .precio-prod { font-size: 1rem; margin: 10px 0; }
    .btn-add-cart { font-size: 0.7rem; padding: 10px; border-width: 1px; }
    .paginacion { gap: 5px; margin-top: 30px;}
    .page-num, .page-nav { width: 35px; height: 35px; font-size: 0.9rem; }
}