/* ================================================================
   product-shop.css — Estilos para la tienda/catálogo de productos
   ================================================================ */

/* ─── Sidebar ──────────────────────────────────────────────────── */
#shop-sidebar {
    position: sticky;
    top: 76px;
    align-self: flex-start;
}
.sidebar-card {
    background: #fff;
    border: 1px solid #dde4da;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}
.sidebar-header {
    background: #5B8C51;
    color: #fff;
    padding: .8rem 1.1rem;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: .06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: .5rem;
}
#cat-list {
    list-style: none;
    margin: 0;
    padding: .4rem 0;
}

/* Grupo padre con hijos */
.cat-parent-header {
    display: flex;
    align-items: center;
    padding: .6rem 1rem;
    font-weight: 600;
    font-size: .88rem;
    cursor: pointer;
    color: #2d2d2d;
    user-select: none;
    transition: background .15s, color .15s;
}
.cat-parent-header i.cat-main-icon { color: #5B8C51; }
.cat-parent-header:hover { background: #f0f7ee; color: #5B8C51; }
.cat-toggle-icon {
    margin-left: auto;
    font-size: .75rem;
    transition: transform .25s;
}
.cat-parent.expanded .cat-toggle-icon { transform: rotate(-180deg); }

.cat-children {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .3s ease;
}
.cat-parent.expanded .cat-children { max-height: 400px; }

.cat-child-item {
    display: flex;
    align-items: center;
    padding: .45rem 1rem .45rem 2.1rem;
    font-size: .83rem;
    color: #555;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.cat-child-item:hover { background: #f0f7ee; color: #5B8C51; }
.cat-child-item.active {
    background: #e6f3e3;
    color: #3d6e35;
    font-weight: 600;
    border-right: 3px solid #5B8C51;
}

/* Ítems directos (sin hijos) */
.cat-item {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    font-size: .88rem;
    color: #2d2d2d;
    cursor: pointer;
    transition: background .12s, color .12s;
}
.cat-item:hover { background: #f0f7ee; color: #5B8C51; }
.cat-item.active {
    background: #e6f3e3;
    color: #3d6e35;
    font-weight: 600;
    border-right: 3px solid #5B8C51;
}
.cat-item i, .cat-child-item i { color: #5B8C51; }
hr.cat-divider { margin: .3rem 0; border-color: #eee; }

/* SVG icons personalizados del sidebar */
.sidebar-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-right: 8px;
    display: inline-block;
    vertical-align: middle;
}
.cat-parent-header .sidebar-icon { margin-right: 6px; }
/* En el encabezado del contenido el SVG va inline con el título */
.content-header h4 .sidebar-icon {
    width: 22px;
    height: 22px;
    margin-right: 6px;
    vertical-align: -4px;
}

/* ─── Sidebar Mobile (drawer) ──────────────────────────────────── */
#sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 1048;
}
#sidebar-overlay.show { display: block; }

@media (max-width: 991.98px) {
    #shop-sidebar {
        position: fixed;
        top: 0;
        left: -300px;
        width: 285px;
        height: 100vh;
        z-index: 1049;
        background: #fff;
        transition: left .3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 0;
    }
    #shop-sidebar.open { left: 0; }
    .sidebar-card {
        border: none;
        border-radius: 0;
        box-shadow: none;
        height: 100%;
        min-height: 100vh;
    }
}

/* Botón toggle móvil */
#sidebar-toggle {
    background: #5B8C51;
    border-color: #5B8C51;
    color: #fff;
    font-size: .85rem;
    padding: .4rem .9rem;
    border-radius: 6px;
    display: none;
    align-items: center;
    gap: .4rem;
    cursor: pointer;
    border: none;
}
@media (max-width: 991.98px) {
    #sidebar-toggle { display: inline-flex; }
}

/* Botón cerrar sidebar (solo móvil) */
#sidebar-close {
    display: none;
}
@media (max-width: 991.98px) {
    #sidebar-close {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding: .6rem .75rem;
        background: #5B8C51;
        cursor: pointer;
        color: #fff;
        font-size: .85rem;
        gap: .35rem;
    }
}

/* ─── Cards de categoría (landing) ────────────────────────────── */
.cat-landing-card {
    background: #fff;
    border: 2px solid #dde4da;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: border-color .2s, transform .2s, box-shadow .2s;
    height: 100%;
    text-decoration: none;
    display: flex;
    flex-direction: column;
}
.cat-landing-card:hover {
    border-color: #5B8C51;
    transform: translateY(-4px);
    box-shadow: 0 8px 22px rgba(91, 140, 81, .18);
}

/* Foto del producto representativo */
.cat-card-img {
    width: 100%;
    height: 140px;
    background: #f5f7f4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.cat-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    transition: transform .3s ease;
}
.cat-landing-card:hover .cat-card-img img {
    transform: scale(1.06);
}

/* Información del card */
.cat-card-body {
    padding: .8rem .9rem .9rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.cat-card-body h6 {
    font-weight: 700;
    color: #1e2d1b;
    font-size: .88rem;
    margin-bottom: .25rem;
    line-height: 1.3;
}
.cat-card-body .cat-sub-list {
    font-size: .73rem;
    color: #888;
    line-height: 1.5;
    margin-bottom: .4rem;
}
.cat-card-body .cat-go {
    margin-top: auto;
    padding-top: .5rem;
    font-size: .78rem;
    color: #5B8C51;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .25rem;
}

/* ─── Tarjetas de producto (área de contenido) ─────────────────── */
.product-simple-card {
    background: #fff;
    border: 1px solid #e4e4e4;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.product-simple-card:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, .1);
    transform: translateY(-2px);
}
.product-simple-img {
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 170px;
    overflow: hidden;
}
.product-simple-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    width: 100%;
    height: 100%;
}
.product-simple-info {
    padding: .6rem .75rem .75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-simple-info .product-code {
    font-size: .72rem;
    color: #aaa;
    font-family: monospace;
    margin-bottom: .2rem;
}
.product-simple-info .product-name {
    font-size: .8rem;
    font-weight: 600;
    color: #333;
    line-height: 1.35;
}
.product-simple-link-wrap {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}
.product-simple-link-wrap:hover { text-decoration: none; color: inherit; }

/* ─── Encabezado del área de contenido ────────────────────────── */
.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
    padding-bottom: .75rem;
    border-bottom: 2px solid #5B8C51;
}
.content-header h4 {
    margin: 0;
    color: #222;
    font-size: 1.1rem;
    font-weight: 700;
}
.btn-see-all {
    font-size: .8rem;
    color: #5B8C51;
    border: 1px solid #5B8C51;
    padding: .25rem .7rem;
    border-radius: 4px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.btn-see-all:hover { background: #5B8C51; color: #fff; }

.product-count-badge {
    font-size: .78rem;
    color: #999;
    margin-bottom: 1rem;
}

/* ─── Estado de carga ──────────────────────────────────────────── */
.content-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 220px;
}
.content-loading .spinner-border {
    color: #5B8C51;
    width: 2.5rem;
    height: 2.5rem;
}

/* ─── Títulos de la vista landing ─────────────────────────────── */
.landing-section-title {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #5B8C51;
    margin-bottom: 1rem;
    padding-left: .2rem;
}
.landing-intro {
    background: #f3faf1;
    border-left: 4px solid #5B8C51;
    border-radius: 0 6px 6px 0;
    padding: .9rem 1.1rem;
    margin-bottom: 1.5rem;
    font-size: .88rem;
    color: #444;
}
