:root {
    --mersol-red: #D2242A;
    --mersol-red-dark: #B71D22;
    --mersol-red-soft: rgba(210, 36, 42, 0.08);

    --mersol-dark: #2E2A26;
    --mersol-dark-2: #403B33;
    --mersol-gray: #706F70;
    --mersol-gray-light: #A3A19E;

    --bg: #F3F4F6;
    --card: #FFFFFF;
    --border: #E7E9EE;
    --text: #2E2A26;
    --muted: #6E7380;

    --success: #1F8B4C;
    --warning: #D08A16;
    --danger: #D2242A;

    --shadow-sm: 0 2px 10px rgba(32, 36, 44, 0.05);
    --shadow-md: 0 10px 30px rgba(32, 36, 44, 0.10);
    --radius-md: 14px;
    --radius-lg: 18px;
    --radius-xl: 22px;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family: "Inter", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    line-height: 1.45;
    background:
        radial-gradient(circle at top left, rgba(210, 36, 42, 0.08) 0%, rgba(210, 36, 42, 0) 28%),
        radial-gradient(circle at right 20%, rgba(64, 59, 51, 0.06) 0%, rgba(64, 59, 51, 0) 24%),
        linear-gradient(180deg, #F7F7F8 0%, #F1F2F4 100%);
    background-attachment: fixed;
}

a {
    color: var(--mersol-red);
    text-decoration: none;
}

a:hover {
    color: var(--mersol-red-dark);
    text-decoration: none;
}

.top-strip {
    background: #0F1114;
    color: rgba(255,255,255,.88);
    font-size: .92rem;
    min-height: 42px;
    display: flex;
    align-items: center;
}

.top-strip a {
    color: rgba(255,255,255,.92);
    margin-left: 1rem;
    font-weight: 500;
}

.top-strip a:hover {
    color: #fff;
}

.store-header {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(231, 233, 238, 0.95);
    box-shadow: 0 2px 12px rgba(0,0,0,.04);
    position: sticky;
    top: 0;
    z-index: 50;
}

.store-header .container,
.store-header .container-fluid {
    padding-top: 16px;
    padding-bottom: 16px;
}

.store-brand {
    font-size: 1.7rem;
    font-weight: 800;
    color: var(--mersol-red);
    text-decoration: none !important;
    letter-spacing: -.02em;
    display: inline-flex;
    align-items: center;
}

.searchbar-wrap {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: 100%;
}

.searchbar-input {
    flex: 1;
    border-radius: 14px;
    border: 1px solid var(--border);
    height: 52px;
    background: rgba(255,255,255,.98);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    padding: 0 16px;
    font-size: 1rem;
}

.searchbar-input:focus {
    outline: none;
    border-color: var(--mersol-red);
    box-shadow: 0 0 0 4px rgba(210, 36, 42, .10);
}

.btn-search {
    background: var(--mersol-red);
    border: 1px solid var(--mersol-red);
    border-radius: 14px;
    height: 52px;
    padding: 0 1.5rem;
    font-weight: 700;
    color: #fff;
    box-shadow: var(--shadow-sm);
    transition: .18s ease;
}

.btn-search:hover,
.btn-search:focus {
    background: var(--mersol-red-dark);
    border-color: var(--mersol-red-dark);
    color: #fff;
}

.header-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: .85rem;
}

.header-action {
    color: var(--mersol-dark);
    font-weight: 600;
    font-size: .95rem;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
}

.header-action:hover {
    color: var(--mersol-red);
}

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: var(--mersol-red-soft);
    color: var(--mersol-red);
    font-size: .78rem;
    font-weight: 700;
    padding: 0 6px;
}

.store-nav {
    padding: .85rem 0 0;
}

.store-nav a {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-right: .65rem;
    margin-bottom: .55rem;
    padding: .5rem .85rem;
    border-radius: 999px;
    background: rgba(255,255,255,.85);
    border: 1px solid var(--border);
    color: var(--mersol-dark);
    font-weight: 600;
    font-size: .93rem;
}

.store-nav a:hover {
    border-color: rgba(210, 36, 42, .16);
    color: var(--mersol-red);
    background: rgba(252, 235, 236, 0.9);
}

#catalogApp {
    padding-top: 20px;
    padding-bottom: 28px;
}

.catalog-shell {
    width: 100%;
}

.filter-card,
.results-card,
.detail-card,
.product-card,
.surface-soft {
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.filter-card {
    padding: 1rem;
}

.filter-title,
.results-title,
.section-title {
    font-weight: 800;
    color: var(--mersol-dark);
}

.results-subtitle,
.text-muted {
    color: var(--muted) !important;
}

.filter-card .form-control,
.filter-card select,
.filter-card input,
.toolbar-right .form-control {
    height: 42px;
    border-radius: 12px;
    border: 1px solid #D8DDE5;
}

.filter-card .form-control:focus,
.toolbar-right .form-control:focus {
    border-color: var(--mersol-red);
    box-shadow: 0 0 0 4px rgba(210, 36, 42, .10);
}

.facet-list {
    max-height: 460px;
    overflow-y: auto;
    padding-right: 4px;
}

.facet-list .facet-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: .55rem;
    padding: .7rem .8rem;
    border: 1px solid #ECEFF4;
    background: #FBFBFC;
    border-radius: 12px;
    cursor: pointer;
    color: var(--mersol-dark);
    transition: .16s ease;
    font-weight: 600;
    text-align: left;
}

.facet-link:hover {
    background: rgba(252, 235, 236, 0.95);
    border-color: rgba(210, 36, 42, .16);
    color: var(--mersol-red);
}

.results-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
}

.results-toolbar .right {
    display: flex;
    gap: .75rem;
}

.results-card {
    padding: 1rem;
}

#productsContainer {
    margin-left: -10px;
    margin-right: -10px;
}

#productsContainer > [class*="col-"] {
    padding-left: 10px;
    padding-right: 10px;
    margin-bottom: 20px;
}

.product-card {
    height: 100%;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(210, 36, 42, .16);
}

.product-image {
    background: linear-gradient(180deg, #fff 0%, #fafafa 100%);
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #F0F2F5;
    padding: 14px;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-body {
    padding: 14px;
}

.product-title {
    font-size: 1rem;
    line-height: 1.35rem;
    min-height: 54px;
    margin-bottom: .55rem;
    color: var(--mersol-dark);
    font-weight: 600;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.45rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--mersol-dark);
    margin-bottom: .35rem;
}

.product-shipping {
    color: var(--muted);
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: .35rem;
}

.product-meta,
.variant-mini {
    color: var(--muted);
    font-size: .84rem;
}

.stock-ok {
    color: var(--success);
    font-weight: 700;
}

.stock-low {
    color: #D08A16;
    font-weight: 700;
}

.stock-out {
    color: var(--danger);
    font-weight: 700;
}

.btn-primary {
    background: var(--mersol-red);
    border-color: var(--mersol-red);
    border-radius: 12px;
    font-weight: 700;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--mersol-red-dark);
    border-color: var(--mersol-red-dark);
}

.btn-outline-secondary {
    border-radius: 12px;
    font-weight: 700;
}

.pagination-wrap {
    width: 100%;
    padding: 0 0 10px;
}

.pagination {
    flex-wrap: wrap;
    gap: 6px;
}

.pagination .page-link {
    border-radius: 12px !important;
    border: 1px solid #D8DCE4;
    color: var(--mersol-dark);
    min-width: 42px;
    text-align: center;
    margin: 0;
}

.pagination .page-item.active .page-link {
    background: var(--mersol-red);
    border-color: var(--mersol-red);
    color: #fff;
}

.pagination .page-link:hover {
    background: rgba(252, 235, 236, 0.95);
    color: var(--mersol-red);
}

.loading-state,
.empty-state {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--muted);
}

@media (min-width: 992px) {
    aside.col-lg-3 .filter-card:first-child {
        position: sticky;
        top: 118px;
        z-index: 2;
    }
}

@media (max-width: 991.98px) {
    .header-actions {
        justify-content: flex-start;
        margin-top: .75rem;
    }

    .results-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .results-toolbar .right {
        flex-direction: column;
    }

    .store-nav {
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: .35rem;
    }
}

@media (max-width: 767.98px) {
    .searchbar-wrap {
        flex-direction: column;
    }

    .searchbar-input,
    .btn-search {
        width: 100%;
    }

    .store-brand {
        font-size: 1.45rem;
    }

    #catalogApp {
        padding-top: 14px;
    }

    .product-image {
        height: 180px;
    }
}
.login-modal-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.login-modal-card .modal-body {
    padding: 1.5rem;
}

#loginCode {
    font-size: 1.4rem;
    letter-spacing: .35rem;
    font-weight: 700;
}

#productDetailApp {
    padding-top: 20px;
    padding-bottom: 30px;
}

.detail-card {
    overflow: hidden;
}

.detail-image-wrap {
    min-height: 460px;
    background: rgba(255,255,255,0.95);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.detail-image-wrap img,
#detailImage {
    max-width: 100%;
    max-height: 420px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.detail-brand {
    color: var(--muted);
    font-weight: 700;
    margin-bottom: .5rem;
    text-transform: uppercase;
    font-size: .85rem;
    letter-spacing: .04em;
}

.detail-title {
    font-size: 2.1rem;
    line-height: 1.15;
    font-weight: 800;
    color: var(--mersol-dark);
    margin-bottom: .75rem;
    letter-spacing: -.02em;
    word-break: break-word;
}

.detail-code,
.detail-currency {
    color: var(--muted);
    font-size: .95rem;
}

.detail-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--mersol-dark);
    margin: .6rem 0 .15rem;
}

.detail-stock {
    font-size: 1rem;
    font-weight: 700;
}

.quantity-box .qty-shell {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
}

.qty-btn {
    width: 42px;
    height: 42px;
    border: 1px solid #D8DDE5;
    background: #fff;
    color: var(--mersol-dark);
    font-weight: 700;
}

.qty-input {
    width: 72px;
    height: 42px;
    border: 1px solid #D8DDE5;
    border-left: none;
    border-right: none;
    text-align: center;
    outline: none;
}

.action-stack .btn {
    border-radius: 12px;
    font-weight: 700;
}

.seller-card {
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow-sm);
    padding: 1.25rem;
}

.seller-badge {
    display: inline-block;
    background: rgba(210, 36, 42, 0.08);
    color: var(--mersol-red);
    border: 1px solid rgba(210, 36, 42, 0.12);
    border-radius: 999px;
    padding: .3rem .7rem;
    font-size: .8rem;
    font-weight: 700;
    margin-bottom: .7rem;
}

.seller-card h5 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--mersol-dark);
    margin-bottom: .45rem;
}

.seller-meta {
    color: var(--muted);
    margin-bottom: .35rem;
}

.seller-rating {
    color: var(--mersol-dark);
    font-weight: 600;
    margin-bottom: .85rem;
}

.seller-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
}

.seller-benefits li {
    margin-bottom: .55rem;
    color: var(--mersol-dark);
}

.safe-list > div {
    margin-bottom: .65rem;
    color: var(--mersol-dark);
}

#detailDimensions .pill,
#detailDimensions .option-pill {
    margin-right: .4rem;
    margin-bottom: .4rem;
}

.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (max-width: 991.98px) {
    .detail-image-wrap {
        min-height: 320px;
    }

    .detail-image-wrap img,
    #detailImage {
        max-height: 280px;
    }

    .detail-title {
        font-size: 1.65rem;
    }
}

.cart-item-card {
        display: flex;
        align-items: center;
        gap: 18px;
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 16px;
        padding: 18px;
        box-shadow: 0 2px 10px rgba(0,0,0,.04);
        overflow: hidden;
    }

    .cart-item-media {
        flex: 0 0 140px;
        width: 140px;
        height: 140px;
        border-radius: 12px;
        overflow: hidden;
        background: #f8f9fa;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .cart-item-media img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        display: block;
    }

    .cart-item-info {
        flex: 1 1 auto;
        min-width: 0;
    }

    .cart-item-title {
        display: block;
        font-size: 1.05rem;
        font-weight: 700;
        color: #212529;
        text-decoration: none;
        margin-bottom: 6px;
        line-height: 1.3;
    }

    .cart-item-title:hover {
        color: #c62828;
        text-decoration: none;
    }

    .cart-item-price {
        font-size: 1.4rem;
        font-weight: 800;
        color: #212529;
        margin-top: 10px;
    }

    .cart-item-qty {
        flex: 0 0 110px;
        width: 110px;
    }

    .cart-item-total {
        flex: 0 0 150px;
        width: 150px;
        text-align: right;
    }

    .cart-item-total strong {
        font-size: 1.1rem;
        display: block;
        margin-top: 4px;
    }

    .summary-card {
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 16px;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,.04);
        position: sticky;
        top: 20px;
    }

    .summary-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 10px;
        font-size: 1rem;
    }

    .summary-row.total {
        font-size: 1.15rem;
        font-weight: 800;
        border-top: 1px solid #eee;
        padding-top: 10px;
        margin-top: 10px;
    }

    .summary-note {
        font-size: .95rem;
        color: #6c757d;
        margin-top: 8px;
    }

    .empty-state-card {
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 16px;
        padding: 28px;
        box-shadow: 0 2px 10px rgba(0,0,0,.04);
    }

    @media (max-width: 991.98px) {
        .cart-item-card {
            flex-wrap: wrap;
            align-items: flex-start;
        }

        .cart-item-media {
            flex: 0 0 100%;
            width: 100%;
            height: 220px;
        }

        .cart-item-info,
        .cart-item-qty,
        .cart-item-total {
            flex: 0 0 100%;
            width: 100%;
        }

        .cart-item-total {
            text-align: left;
        }

        .summary-card {
            position: static;
            margin-top: 20px;
        }
    }

    /* carrusel */

      .related-carousel-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .related-carousel-track {
        display: flex;
        gap: 16px;
        overflow-x: auto;
        scroll-behavior: smooth;
        scroll-snap-type: x mandatory;
        padding: 8px 4px 12px;
        width: 100%;
    }

    .related-carousel-track::-webkit-scrollbar {
        height: 8px;
    }

    .related-carousel-track::-webkit-scrollbar-thumb {
        background: #d0d7de;
        border-radius: 20px;
    }

    .related-card {
        flex: 0 0 220px;
        min-width: 220px;
        max-width: 220px;
        background: #fff;
        border: 1px solid #e9ecef;
        border-radius: 14px;
        overflow: hidden;
        box-shadow: 0 2px 10px rgba(0,0,0,.04);
        scroll-snap-align: start;
    }

    .related-card img {
        width: 100%;
        height: 180px;
        object-fit: contain;
        background: #fff;
        display: block;
        padding: 12px;
    }

    .related-content {
        padding: 12px;
    }

    .related-brand {
        font-size: .8rem;
        color: #6c757d;
        margin-bottom: 6px;
        text-transform: uppercase;
    }

    .related-name {
        display: block;
        font-size: .95rem;
        font-weight: 700;
        line-height: 1.3;
        color: #212529;
        text-decoration: none;
        min-height: 48px;
    }

    .related-name:hover {
        color: #c62828;
        text-decoration: none;
    }

    .related-price {
        font-size: 1.1rem;
        font-weight: 800;
        margin-top: 10px;
        color: #212529;
    }

    .related-nav {
        border: 0;
        background: #fff;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,.12);
        font-size: 24px;
        line-height: 1;
        color: #495057;
        flex: 0 0 38px;
    }

    .related-nav:hover {
        background: #f8f9fa;
    }

    @media (max-width: 768px) {
        .related-card {
            flex: 0 0 180px;
            min-width: 180px;
            max-width: 180px;
        }

        .related-card img {
            height: 150px;
        }

        .related-nav {
            display: none;
        }
    }

    /* filtros */

        .catalog-sidebar {
            position: sticky;
            top: 20px;
        }
    
        .filters-card {
            position: static;
            /* quitar sticky aquí */
        }
    
        .sidebar-card,
        .filters-card {
            margin-bottom: 16px;
        }
                .catalog-sidebar {
                    position: sticky;
                    top: 20px;
                    max-height: calc(100vh - 40px);
                    overflow-y: auto;
                    padding-right: 6px;
                }