/* ===========================
   DIVIDER/FILTER SECTION STYLES
   =========================== */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #f59e0b;
    --success-color: #10b981;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --bg-light: #f9fafb;
    --bg-white: #ffffff;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ===========================
   MODERN DIVIDER CONTAINER
   =========================== */

.modern-divider {
    background: var(--bg-white);
    border-bottom: 2px solid var(--border-color);
    padding: 20px 0;
    position: sticky;
    top: 70px;
    z-index: 98;
    box-shadow: var(--shadow-sm);
    margin-top: 0;
}

.divider-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 30px;
}

/* ===========================
   FILTER SECTION
   =========================== */

.filter-section {
    position: relative;
    flex-shrink: 0;
}

.filter-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.filter-toggle:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--bg-white);
}

.filter-toggle.active {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: var(--bg-white);
}

.filter-toggle i:last-child {
    transition: transform 0.3s ease;
}

.filter-toggle.active i:last-child {
    transform: rotate(180deg);
}

/* Filter Dropdown */
.filter-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    left: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 300px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
    z-index: 1000;
}

.filter-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.filter-group {
    border-bottom: 1px solid var(--border-color);
}

.filter-group:last-of-type {
    border-bottom: none;
}

.filter-group-title {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    color: var(--text-dark);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    text-align: left;
}

.filter-group-title:hover {
    background: var(--bg-light);
}

.filter-group-title i:first-child {
    color: var(--primary-color);
    font-size: 16px;
}

.filter-group-title i:last-child {
    margin-left: auto;
    transition: transform 0.3s ease;
    color: var(--text-light);
}

/* Filter Options */
.filter-options {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-options.active {
    max-height: 500px;
}

.filter-options {
    padding: 0;
    background: var(--bg-light);
}

/* Category List */
.category-list {
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.category-list li {
    margin: 0;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    color: var(--text-dark);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 14px;
}

.category-item:hover {
    background: var(--bg-white);
    padding-left: 20px;
    color: var(--primary-color);
}

.category-item.all-items {
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

.category-item.all-items:hover {
    background: rgba(37, 99, 235, 0.15);
    color: var(--primary-dark);
}

.category-item i {
    font-size: 12px;
    color: var(--text-light);
}

/* Price Filter */
.price-filter-wrapper {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.price-option:hover {
    background: var(--bg-white);
}

.price-option input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

/* Rating Filter */
.rating-filter-wrapper {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rating-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.rating-option:hover {
    background: var(--bg-white);
}

.rating-option input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.rating-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.stars {
    color: #fbbf24;
    font-size: 13px;
    letter-spacing: 1px;
}

.rating-text {
    font-size: 12px;
    color: var(--text-light);
}

/* Reset Button */
.btn-reset-filters {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    border-radius: 0 0 12px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-reset-filters:hover {
    background: var(--primary-light);
    color: var(--bg-white);
    border-color: var(--primary-color);
}

/* ===========================
   SEARCH SECTION
   =========================== */

.search-section {
    flex: 1;
    min-width: 200px;
}

.search-form {
    margin: 0;
}

.search-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.search-wrapper:focus-within {
    border-color: var(--primary-color);
    background: var(--bg-white);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-wrapper i {
    color: var(--text-light);
    margin-right: 10px;
    font-size: 16px;
}

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    color: var(--text-dark);
    font-size: 14px;
}

.search-input::placeholder {
    color: var(--text-light);
}

.search-submit {
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    padding: 0 8px;
    margin-left: 8px;
    font-size: 16px;
    transition: color 0.2s ease;
}

.search-submit:hover {
    color: var(--primary-dark);
}

/* ===========================
   SORT SECTION
   =========================== */

.sort-section {
    flex-shrink: 0;
}

.sort-dropdown {
    position: relative;
}

.sort-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    color: var(--text-dark);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.sort-toggle:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: var(--bg-white);
}

.sort-toggle i:first-child {
    font-size: 14px;
}

.sort-toggle i:last-child {
    transition: transform 0.3s ease;
    font-size: 12px;
}

.sort-menu.active .sort-toggle i:last-child {
    transform: rotate(180deg);
}

/* Sort Menu */
.sort-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    overflow: hidden;
}

.sort-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.sort-option {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-dark);
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
}

.sort-option:last-child {
    border-bottom: none;
}

.sort-option:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    padding-left: 20px;
}

.sort-option i {
    color: var(--primary-color);
    font-size: 14px;
    width: 16px;
    text-align: center;
}

/* ===========================
   FILTER OVERLAY (MOBILE)
   =========================== */

.filter-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.filter-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

@media (max-width: 1024px) {
    .divider-container {
        gap: 20px;
    }

    .search-wrapper {
        padding: 8px 12px;
    }

    .search-input {
        font-size: 13px;
    }

    .filter-dropdown {
        width: 250px;
    }
}

@media (max-width: 768px) {
    .modern-divider {
        top: 70px;
        padding: 15px 0;
    }

    .divider-container {
        gap: 15px;
        flex-wrap: wrap;
    }

    .filter-toggle {
        padding: 8px 12px;
        font-size: 13px;
    }

    .search-section {
        flex: 1 1 100%;
        order: 3;
    }

    .sort-section {
        order: 2;
    }

    .filter-section {
        order: 1;
    }

    .filter-dropdown {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        width: 100%;
        border-radius: 16px 16px 0 0;
        max-height: 70vh;
        overflow-y: auto;
        transform: translateY(100%);
    }

    .filter-dropdown.active {
        transform: translateY(0);
    }

    .filter-overlay {
        display: block;
    }

    .search-wrapper {
        padding: 6px 12px;
    }

    .search-input {
        font-size: 12px;
    }

    .sort-toggle {
        padding: 8px 12px;
        font-size: 13px;
        gap: 6px;
    }

    .sort-toggle i {
        font-size: 12px;
    }

    .sort-menu {
        min-width: 180px;
    }
}

@media (max-width: 480px) {
    .modern-divider {
        padding: 12px 0;
    }

    .divider-container {
        padding: 0 10px;
        gap: 10px;
    }

    .filter-toggle {
        padding: 6px 10px;
        font-size: 12px;
        gap: 6px;
    }

    .filter-toggle i {
        font-size: 14px;
    }

    .search-wrapper {
        padding: 5px 10px;
    }

    .search-wrapper i {
        margin-right: 8px;
        font-size: 14px;
    }

    .search-input {
        font-size: 11px;
    }

    .search-submit {
        font-size: 14px;
        padding: 0 5px;
    }

    .sort-toggle {
        padding: 6px 10px;
        font-size: 12px;
        gap: 5px;
    }

    .sort-toggle i {
        font-size: 12px;
    }

    .sort-menu {
        min-width: 160px;
        right: -10px;
    }

    .sort-option {
        padding: 10px 12px;
        font-size: 12px;
        gap: 8px;
    }

    .sort-option:hover {
        padding-left: 16px;
    }

    .filter-dropdown {
        width: 100%;
    }

    .category-item {
        padding: 8px 12px;
        font-size: 13px;
    }

    .category-item:hover {
        padding-left: 16px;
    }

    .price-filter-wrapper,
    .rating-filter-wrapper {
        padding: 10px 12px;
        gap: 8px;
    }

    .price-option,
    .rating-option {
        padding: 6px 8px;
        font-size: 12px;
    }
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filter-dropdown.active {
    animation: slideDown 0.3s ease-out;
}