:root {
    --accent: #09367b;
    --accent-light: rgba(9, 54, 123, 0.1);
    --accent-dark: #062c65;
    --accent-gradient: linear-gradient(90deg, #062c65, #09367b 50%, #062c65);
    --bg-light: #f8f9fa;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --border: #dfe6e9;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

.view-details:hover {
    color: white !important;
}

.beauty-catalog {
    padding: 2rem 0 4rem;
    background: linear-gradient(to bottom, #ffffff 0%, var(--bg-light) 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
}

/* Header Styles */
.catalog-header {
    margin-bottom: 2rem;
    animation: fadeInUp 0.6s ease-out;
    width: 100%;
    max-width: 100%;
}

.catalog-header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    text-align: center;
    color: #2d3436;
    margin-bottom: 0.5rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.catalog-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2rem;
}

/* Controls */
.catalog-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    width: 100%;
    max-width: 100%;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.filter-toggle:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 44, 101, 0.3);
}

.sort-by {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.sort-by label {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

#sort {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    min-width: 200px;
    width: 100%;
    max-width: 300px;
}

#sort:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(9, 54, 123, 0.1);
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex-shrink: 0;
}

.view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border);
    background: white;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
    flex-shrink: 0;
}


.active-filters {
    display: none;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 60px;
    transition: var(--transition);
    width: 100%;
    margin-top: 1rem;
}

.active-filters.has-filters {
    display: flex;
}

.active-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--accent-light);
    color: var(--accent-dark);
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    animation: slideIn 0.3s ease;
}

.remove-filter {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: var(--transition);
}

.remove-filter:hover {
    background: var(--accent-dark);
    transform: scale(1.1);
}

.catalog-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1rem;
    animation: fadeIn 0.6s ease-out;
    width: 100%;
    max-width: 100%;
}

.filters-sidebar {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 265px);
    overflow-y: auto;
    transition: var(--transition);
    width: 300px;
    flex-shrink: 0;
}

.filters-sidebar::-webkit-scrollbar {
    width: 6px;
}

.filters-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 3px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-light);
    width: 100%;
}

.filters-header h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin: 0;
}

.close-filters {
    display: none;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.close-filters:hover {
    background: var(--accent);
    color: white;
}

.filter-section {
    margin-bottom: 2rem;
    animation: fadeIn 0.4s ease-out;
    animation-fill-mode: both;
    width: 100%;
}

.filter-section:nth-child(2) {
    animation-delay: 0.1s;
}

.filter-section:nth-child(3) {
    animation-delay: 0.2s;
}

.filter-section:nth-child(4) {
    animation-delay: 0.3s;
}

.filter-section:nth-child(5) {
    animation-delay: 0.4s;
}

.filter-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
}

.filter-section h4::before {
    content: '';
    width: 4px;
    height: 16px;
    background: var(--accent);
    border-radius: 2px;
}

/* Filter Options */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    width: 100%;
}

.filter-option:hover {
    background: var(--accent-light);
    transform: translateX(4px);
}

.filter-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.filter-option span {
    color: var(--text-secondary);
    transition: var(--transition);
    word-break: break-word;
    flex: 1;
}

.filter-option:hover span {
    color: var(--text-primary);
}

.filter-option input[type="checkbox"]:checked + span {
    color: var(--accent);
    font-weight: 600;
}

/* Slider Styles */
.rating-slider-container {
    padding: 0.5rem;
    width: 100%;
}

.styled-slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 0.75rem;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(9, 54, 123, 0.4);
    transition: var(--transition);
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.rating-stars {
    display: inline-block;
    position: relative;
    width: 100px;
    height: 20px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23dfe6e9"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
    background-size: 20px;
    flex-shrink: 0;
}

.rating-fill {
    display: block;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23ffd700"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>');
    background-size: 20px;
}

.rating-value {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-direction: column;
    padding-top: 1.5rem;
    border-top: 2px solid var(--accent-light);
    width: 100%;
}


.apply-filters {
    background: var(--accent-gradient);
    color: white;
}

.apply-filters:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(6, 44, 101, 0.3);
}

.reset-filters {
    background: var(--accent-light);
    color: var(--accent);
}

.reset-filters:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

/* Products Container */
.products-container {
    animation: fadeIn 0.6s ease-out;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.products-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
}

.products-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.products-count span {
    color: var(--accent);
    font-size: 1.5rem;
}

.pagination {
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

/* Products Grid */
.products-grid {
    display: grid;
    gap: 20px;
    transition: var(--transition);
    width: 100%;
}

.products-grid.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.list-view .product-card {
    flex-direction: row;
    height: fit-content;
}

.list-view .product-image {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

.list-view .product-info {
    flex: 1;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    transition: var(--transition);
    animation: slideUp 0.4s ease-out;
    animation-fill-mode: both;
    width: 100%;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.product-card:nth-child(1) {
    animation-delay: 0.1s;
}

.product-card:nth-child(2) {
    animation-delay: 0.2s;
}

.product-card:nth-child(3) {
    animation-delay: 0.3s;
}

.product-card:nth-child(4) {
    animation-delay: 0.4s;
}

.product-card:nth-child(5) {
    animation-delay: 0.5s;
}

.product-card:nth-child(6) {
    animation-delay: 0.6s;
}

.product-card:nth-child(7) {
    animation-delay: 0.7s;
}

.product-card:nth-child(8) {
    animation-delay: 0.8s;
}

.product-image {
    height: 220px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    width: 100%;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: var(--transition);
    padding: 1.5rem;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex: 1;
    border-top: 1px solid #eeeeee;
    width: 100%;
}

.product-category {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--accent-light);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    align-self: flex-start;
}

.product-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
    width: 100%;
}

.product-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    width: 100%;
}

.product-brand {
    color: var(--accent);
    font-weight: 500;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #ffd700;
    font-weight: 600;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}

.feature {
    font-size: 0.75rem;
    background: var(--accent-light);
    color: var(--accent-dark);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    border: 1px solid rgba(9, 54, 123, 0.2);
    transition: var(--transition);
}

.feature:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-2px);
}

.product-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.5rem;
    width: 100%;
}

.product-footer {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    width: 100%;
}

.view-details {
    padding: 0.625rem 1.25rem;
    background: var(--accent-gradient);
    color: white;
    border: none;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

/* View More */
.view-more {
    margin-top: 3rem;
    text-align: center;
    width: 100%;
}


/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-light);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--accent);
    color: white;
    transform: rotate(90deg);
}

.modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.modal-body img {
    width: 100%;
    height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
    background: var(--bg-light);
}

.filter-toggle {
    display: none;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .catalog-layout {
        grid-template-columns: 280px 1fr;
        gap: 1.5rem;
    }

    .filters-sidebar {
        width: 280px;
    }

    .products-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .catalog-layout {
        grid-template-columns: 1fr;
        position: relative;
        width: 100%;
    }

    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 90%;
        max-width: 400px;
        height: 100vh;
        max-height: 100vh;
        z-index: 1001;
        transition: left 0.4s ease;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
        width: 90%;
    }

    .filters-sidebar.active {
        left: 0;
    }

    .close-filters {
        display: flex;
    }

    .filter-toggle {
        margin-right: auto;
    }

    .view-toggle {
        margin-left: 0;
    }

    .products-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .filter-toggle {
        display: flex;
    }

    .catalog-header h1 {
        font-size: 2rem;
    }

    .catalog-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .sort-by {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
    }

    #sort {
        width: 100%;
        min-width: auto;
        max-width: 100%;
    }

    .view-toggle {
        align-self: flex-start;
    }

    .products-grid.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .list-view .product-card {
        flex-direction: column;
        height: auto;
    }

    .list-view .product-image {
        width: 100%;
        height: 200px;
    }

    .modal-body {
        grid-template-columns: 1fr;
    }

    .modal-body img {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .products-grid.grid-view {
        grid-template-columns: 1fr;
    }

    .filter-toggle {
        display: flex;
    }

    .products-info {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .view-toggle {
        display: none;
    }

    .filter-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}
.list-view .product-footer {
    display: flex;
    justify-content: end;
    gap: 0.75rem;
    align-items: center;
}

.list-view .product-footer .view-details {
    display: inline-block;
    width: auto;
    min-width: 105px;
    max-width: 108px;
    padding: 0.5rem 0.95rem;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    box-sizing: border-box;
}

.list-view .product-footer .view-details.btn-sm {
    min-width: 92px;
    padding: 0.35rem 0.6rem;
    font-size: 0.95rem;
}

/* ===== Option B: hug content exactly (use when adding class "fit") ===== */
.list-view .product-footer .view-details.fit {
    width: -moz-fit-content;
    width: fit-content;
    min-width: 0;
    padding: 0.35rem 0.6rem;
}

/* ===== Ensure image/info don't force footer full width ===== */
.list-view .product-card {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.list-view .product-info {
    flex: 1 1 auto;
    min-width: 0; /* IMPORTANT: allows child ellipsis & prevents overflow */
}

/* Mobile tweaks */
@media (max-width: 768px) {
    .list-view .product-card { flex-direction: column; }
    .list-view .product-footer .view-details { min-width: 100px; }
}