/* ============================================================
   Shop Hero Grid v2.0 — CSS completo
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── WRAPPER principal ── */
.shg-wrapper {
    width: 100%;
    background: #f5f5f5;
    font-family: inherit;
    overflow: hidden;
}

/* ============================================================
   DESKTOP: sidebar izquierdo + main derecho
   ============================================================ */
@media (min-width: 768px) {
    .shg-wrapper {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start;
        border-radius: 10px;
    }

    .shg-sidebar {
        width: 185px;
        min-width: 185px;
        flex-shrink: 0;
        background: #fff;
        border-right: 1px solid #ececec;
        padding: 14px 0 20px;
        max-height: 680px;
        overflow-y: auto;
        align-self: stretch;
    }

    .shg-sidebar-title {
        display: block;
        padding: 0 14px 10px;
        font-weight: 800;
        font-size: 13px;
        color: #111;
        border-bottom: 1px solid #f0f0f0;
        margin-bottom: 4px;
    }

    .shg-sidebar button {
        display: block;
        width: 100%;
        text-align: left;
        border: none;
        background: transparent;
        cursor: pointer;
        font-family: inherit;
        transition: background 0.15s, color 0.15s;
    }
    .shg-sidebar-cat {
        padding: 8px 14px;
        font-size: 12.5px;
        font-weight: 600;
        color: #333;
        line-height: 1.3;
    }
    .shg-sidebar-subcat {
        padding: 5px 14px 5px 26px;
        font-size: 11.5px;
        color: #888;
        line-height: 1.3;
    }
    .shg-sidebar button:hover { background: #fef6f0; color: #c8834a; }
    .shg-sidebar-cat.active    { background: #c8834a !important; color: #fff !important; font-weight: 700; }
    .shg-sidebar-subcat.active { color: #c8834a; font-weight: 600; }

    .shg-main {
        flex: 1 1 0%;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }
}

/* ============================================================
   MÓVIL: tabs horizontales arriba
   ============================================================ */
@media (max-width: 767px) {
    .shg-wrapper {
        display: block !important;
        border-radius: 8px;
    }

    /* Sidebar como barra de tabs horizontal */
    .shg-sidebar {
        width: 100%;
        background: #fff;
        border-bottom: 2px solid #ececec;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0;
    }
    .shg-sidebar::-webkit-scrollbar { display: none; }

    .shg-sidebar-title { display: none !important; }

    .shg-sidebar button {
        flex-shrink: 0;
        white-space: nowrap;
        border: none;
        background: transparent;
        cursor: pointer;
        font-family: inherit;
        padding: 10px 13px;
        font-size: 12px;
        font-weight: 600;
        color: #555;
        border-bottom: 3px solid transparent;
        transition: color 0.15s, border-color 0.15s;
        display: inline-block !important;
        width: auto !important;
    }
    .shg-sidebar-subcat {
        font-size: 11px;
        color: #888;
        padding: 10px 10px;
    }
    .shg-sidebar button:hover { color: #c8834a; }
    .shg-sidebar-cat.active {
        color: #c8834a !important;
        background: transparent !important;
        border-bottom: 3px solid #c8834a !important;
        font-weight: 700;
    }
    .shg-sidebar-subcat.active {
        color: #c8834a !important;
        border-bottom: 3px solid #c8834a !important;
    }

    .shg-main {
        display: block;
        width: 100%;
    }
}

/* ============================================================
   SLIDER DE BANNERS
   ============================================================ */
.shg-slider {
    position: relative;
    overflow: hidden;
    background: #ddd;
    height: 200px;
    width: 100%;
}

@media (min-width: 768px) { .shg-slider { height: 230px; } }

.shg-slides-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(.77,0,.175,1);
}

.shg-slide {
    min-width: 100%;
    height: 100%;
    background: #ccc center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: flex-end;
}
.shg-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0,0,0,.5) 0%, transparent 65%);
    pointer-events: none;
}
.shg-slide-content {
    position: relative;
    z-index: 2;
    padding: 14px 18px;
    color: #fff;
}
.shg-slide-badge {
    display: inline-block;
    background: #e53935;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 3px;
    margin-bottom: 5px;
}
.shg-slide-title {
    font-size: 18px;
    font-weight: 900;
    line-height: 1.15;
    text-shadow: 0 2px 6px rgba(0,0,0,.3);
    margin-bottom: 4px;
}
.shg-slide-subtitle {
    font-size: 11px;
    opacity: .9;
    margin-bottom: 9px;
}
.shg-slide-btn {
    display: inline-block;
    background: #fff;
    color: #222 !important;
    padding: 5px 13px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none !important;
}

.shg-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(255,255,255,.85);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}
.shg-prev { left: 7px; }
.shg-next { right: 7px; }

.shg-dots {
    position: absolute;
    bottom: 7px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}
.shg-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}
.shg-dot.active { background: #fff; transform: scale(1.4); }

/* ============================================================
   ÁREA DE PRODUCTOS — CARRUSEL HORIZONTAL UNA FILA
   ============================================================ */
.shg-products-area {
    padding: 12px 14px 16px;
    background: #f5f5f5;
    min-height: 180px;
}

.shg-products-title {
    font-size: 15px;
    font-weight: 800;
    color: #222;
    margin-bottom: 10px;
}

.shg-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 24px;
    color: #888;
    font-size: 12px;
}
.shg-spinner {
    width: 16px; height: 16px;
    border: 2px solid #e0e0e0;
    border-top-color: #c8834a;
    border-radius: 50%;
    animation: shg-spin 0.8s linear infinite;
    flex-shrink: 0;
}
@keyframes shg-spin { to { transform: rotate(360deg); } }

/* ── CARRUSEL: una sola fila, scroll horizontal ── */
.shg-products-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    gap: 10px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}
.shg-products-grid::-webkit-scrollbar {
    height: 4px;
}
.shg-products-grid::-webkit-scrollbar-track { background: transparent; }
.shg-products-grid::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* ── Tarjeta — ancho fijo para que todas sean iguales en la fila ── */
.shg-product-card {
    flex: 0 0 160px;
    width: 160px;
    min-width: 160px;
    scroll-snap-align: start;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}
.shg-product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(0,0,0,.12);
}

@media (min-width: 768px) {
    .shg-product-card {
        flex: 0 0 175px;
        width: 175px;
        min-width: 175px;
    }
}

.shg-badge-discount {
    position: absolute;
    top: 6px; left: 6px;
    background: #e53935;
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 2;
}

.shg-product-img-wrap {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f5f5f5;
}
.shg-product-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}
.shg-product-card:hover .shg-product-img-wrap img { transform: scale(1.04); }

.shg-product-info {
    padding: 8px 9px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.shg-product-brand {
    font-size: 9px;
    color: #bbb;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.shg-product-name {
    font-size: 11.5px;
    font-weight: 600;
    color: #222;
    line-height: 1.3;
    text-decoration: none !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.shg-product-name:hover { color: #c8834a; }

.shg-product-price {
    margin-top: auto;
    padding-top: 4px;
}
.shg-product-price .price {
    font-size: 13px;
    font-weight: 800;
    color: #222;
}
.shg-product-price .price ins { text-decoration: none; }
.shg-product-price .price del {
    font-size: 10px;
    color: #bbb;
    font-weight: 400;
    margin-left: 2px;
}

.shg-add-to-cart {
    display: block !important;
    margin-top: 7px;
    width: 100%;
    padding: 7px 4px;
    background: #c8834a !important;
    color: #fff !important;
    border: none !important;
    border-radius: 5px;
    font-size: 10.5px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.2s;
    font-family: inherit;
    line-height: 1.2;
}
.shg-add-to-cart:hover { background: #b5703b !important; }

.shg-no-products {
    text-align: center;
    padding: 24px 16px;
    color: #aaa;
    font-size: 12px;
    flex-shrink: 0;
}

/* MOBILE TAB FIX — fill grey gap */
@media (max-width: 767px) {
    .shg-sidebar::after {
        content: '';
        display: block;
        flex: 1 1 auto;
        min-width: 20px;
        background: #fff;
    }
    .shg-sidebar button {
        background: #fff !important;
    }
}
