/* Global styles */
:root {
    --body-bg: #F5F5F5;
}

body {
    background-color: var(--body-bg) !important;
}

.bg-body {
    background-color: var(--body-bg) !important;
}

/* Products Page Specific Styles */

/* Header styling for products page */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper img {
    height: 50px;
}

.main-nav {
    display: flex;
    align-items: center;
}

.nav-list {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: #333;
    font-weight: 500;
}

.user-actions {
    display: flex;
    gap: 15px;
}

.icon-link {
    color: #333;
    font-size: 1.2rem;
}

/* === Active Filters Card Styles ====================== */
#active-filters-card {
    transition: opacity 0.3s ease, transform 0.3s ease;
    opacity: 1;
    transform: translateY(0);
}

#active-filters-card.hiding {
    opacity: 0;
    transform: translateY(-10px);
}

/* === Search Bar Styles ====================== */
.search-container {
    margin-bottom: 0rem;
}

.search-input {
    padding-left: 2.5rem;
    padding-right: 3rem;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background-color: #fff;
    transition: all 0.3s ease;
    font-size: 14px;
}

.search-input:focus {
    border-color: #F92E2E;
    box-shadow: 0 0 0 0.2rem rgba(249, 46, 46, 0.1);
    background-color: #fff;
}

.btn-clear-search {
    position: absolute;
    right: 12px;
    top: 20%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    z-index: 10;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-clear-search:hover {
    background-color: #f8f9fa;
    color: #F92E2E;
}

/* Show clear button when input has content */
.search-input:focus+.search-icon+.btn-clear-search {
    display: block;
}

.has-content .btn-clear-search {
    display: block !important;
}

/* === Notification Bar – Figma specs ====================== */
.notification-wrapper {
    padding: 0;
    /* mismo ancho que el navbar   */
    margin: 0 auto;
    /* centrada horizontalmente     */
}

.notification-bar {
    background: #F92E2E;
    color: #FFFFFF;
    padding: 12px 32px;
    /* Figma: 32 px laterales */
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    width: 100%;
    gap: 1rem;
    /* espacio entre texto y botón */
}

/* Ajustes al botón cerrar para que mantenga posición y tamaño */
.close-notification {
    opacity: 1;
    /* asegúrate de que se vea */
    font-size: 1rem;
    line-height: 1;
}

/* Versión mobile: ancho completo sin bordes redondeados */
@media (max-width: 991.98px) {
    .notification-wrapper {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    .notification-bar {
        border-radius: 0;
        padding-left: 16px;
        /* ≈ 1 rem en mobile */
        padding-right: 16px;
    }
}


/* Products page layout */
.products-page {
    padding: 30px 0 60px;
}

.brand-title {
    color: #F92E2E;
    font-size: 2rem;
    margin-bottom: 25px;
}

.products-layout {
    display: flex;
    gap: 30px;
}

/* Filters section - contains both badges and sidebar */
.filters-section {
    flex: 0 0 250px;
    /* Mismo ancho que filters-sidebar */
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Sidebar filters */
.filters-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filters-sidebar h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #333;
}

.filter-group {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
}

.filter-header h3 {
    font-size: 1rem;
    color: #333;
}

.filter-header i {
    transition: transform 0.3s ease;
}

.filter-header.collapsed i {
    transform: rotate(180deg);
}

.filter-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.filter-options.show {
    max-height: 600px;
    /* Altura máxima que puede alcanzar */
    transition: max-height 0.3s ease-in;
    overflow-y: auto;
}

/* Custom scrollbar for filter options */
.filter-options.show::-webkit-scrollbar {
    width: 6px;
}

.filter-options.show::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filter-options.show::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.filter-options.show::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.filter-options {
    list-style: none;
    padding: 0;
}

/* Hide checkboxes but keep them functional */
.filter-options input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-options label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.filter-options label:hover {
    background-color: #f5f5f5;
}

.filter-options input[type="checkbox"]:checked+span {
    color: #E02020;
    font-weight: 500;
}

/* Active Filters Badges */
.active-filters {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 250px;
    /* Asegura que no se expanda más que el sidebar */
}

.filter-badges-row {
    display: none;
}

.filter-badges-row.has-badges {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-type-label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
    padding-left: 0.5rem;
}

.filter-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: #F5F5F5;
    border-radius: 6px;
    box-shadow: 0 0 30.11px 8.6px rgba(0, 0, 0, 0.15);
    color: #222;
    font-size: 0.9rem;
    max-width: calc(100% - 1rem);
    /* Asegura que los badges no se desborden */
    word-break: break-word;
}

.filter-badge .badge-close {
    margin-left: 0.5rem;
    color: #F92E2E;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.filter-badge .badge-close:hover {
    background-color: rgba(224, 32, 32, 0.1);
}

/* Products grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
}

.product-item {
    width: 100%;
}

/* Product card styling */
.product-card {
    background: #F9F9F9 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0;
    border-radius: 7px !important;
    border: none !important;
    box-shadow: 0 0 30.11px 8.6px rgba(0, 0, 0, 0.15);
    padding: 16px 16px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
}

/* Product image container */
.card-img-top {
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    margin-bottom: 6px;
    flex-shrink: 0;
}

.card-img-top img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}



.card-body {
    display: flex;
    flex-direction: column;
    gap: 0px;
    flex-grow: 1;
}

.product-sku {
    display: block;
    font-size: 12px;
    color: #888;
}

.product-name {
    font-size: 1rem;
    color: #333;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.3;
    min-height: 60px;
}

.btn-danger {
    background-color: #F92E2E !important;
    border-color: #F92E2E !important;
    margin-top: auto;
    flex-shrink: 0;
}

.btn-danger:hover,
.btn-danger:focus,
.btn-danger:active {
    background-color: #e01f1f !important;
    border-color: #e01f1f !important;
}

.btn-product:hover {
    background-color: #e01f1f;
}

/* Page header with refresh button */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.refresh-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.last-update {
    font-size: 0.85rem;
    color: #777;
}

.refresh-button {
    display: inline-flex;
    align-items: center;
    background-color: #F92E2E;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
}

.refresh-button i {
    margin-right: 5px;
}

.refresh-button:hover {
    background-color: #e01f1f;
    text-decoration: none;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .refresh-info {
        align-items: flex-start;
        width: 100%;
    }
}

/* Responsive styles */
@media (max-width: 992px) {
    .footer-top {
        flex-direction: column;
    }

    .footer-logo {
        margin-bottom: 30px;
    }

    .footer-nav {
        flex-wrap: wrap;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .products-layout {
        flex-direction: column;
    }

    .filters-section {
        flex: none;
        width: 100%;
    }

    .active-filters {
        max-width: 100%;
    }

    .nav-list {
        display: none;
    }

    .header-container {
        justify-content: space-between;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 576px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .footer-nav {
        flex-direction: column;
    }

    .footer-nav-column {
        margin-bottom: 20px;
    }
}

/* Responsive Design */
@media (min-width: 600px) {
    .active-filters {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }

    .filter-badges-row {
        margin-bottom: 0;
    }

    .filter-badges-row.has-badges {
        flex-direction: column;
    }

    .filter-type-label {
        margin-bottom: 0.5rem;
    }
}

/* Custom styles for products page */

/* Products grid layout */
.row {
    margin-left: 0;
    margin-right: 0;
}

.col-12,
.col-sm-6,
.col-lg-4 {
    padding: 0 12px;
}

/* Filter badges styling */
.filter-badge {
    background: #F5F5F5;
    border-radius: 6px;
}

.badge-close {
    color: #E02020;
    cursor: pointer;
    transition: background-color 0.2s;
}

.badge-close:hover {
    background-color: rgba(224, 32, 32, 0.1);
}

/* Filter options styling */
.filter-option {
    transition: background-color 0.2s;
}

.filter-option:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

.filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.filter-option input[type="checkbox"]:checked+span {
    color: #E02020;
    font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .col-12 {
        padding: 0 8px;
    }
}

/* Custom margin utility */
.mb-40 {
    margin-bottom: 40px !important;
}

/* Products grid layout */
.row {
    margin-left: 0;
    margin-right: 0;
}

.col-12,
.col-sm-6,
.col-lg-4 {
    padding: 0 12px;
}

/* Remove card borders */
.card {
    border: none !important;
    background: transparent !important;
}

.card-body {
    padding: 0 !important;
}