/* ========== FEATURES CSS - NOUVELLES FONCTIONNALITÉS ========== */

/* ========== THEME VARIABLES (Light Mode) ========== */
:root[data-theme="light"] {
    --primary: #ffffff;
    --secondary: #f5f5f5;
    --accent: #c5a572;
    --text: #0a0a0a;
    --bg-overlay: rgba(255, 255, 255, 0.95);
}

/* Smooth theme transition */
body, .navbar, .product-card, .modal-content, input, button, select {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ========== THEME TOGGLE BUTTON ========== */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--accent);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.theme-toggle:hover {
    background: rgba(197, 165, 114, 0.15);
    border-color: var(--accent);
    transform: translateY(-2px) rotate(180deg);
}

/* ========== FAVORITES BUTTON ========== */
.favorites-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.favorites-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
    transform: translateY(-2px);
}

.favorites-count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    padding: 0 6px;
}

/* ========== FAVORITE BUTTON ON PRODUCT CARD ========== */
.favorite-btn {
    position: absolute;
    top: 50px;
    right: 12px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s ease;
    z-index: 10;
}

.product-card:hover .favorite-btn {
    opacity: 1;
    transform: scale(1);
}

.favorite-btn:hover {
    background: rgba(239, 68, 68, 0.9);
    transform: scale(1.1);
}

.favorite-btn.active {
    background: #ef4444;
    opacity: 1;
}

.favorite-btn.active svg {
    fill: #ffffff;
}

/* ========== STOCK BADGES ========== */
.stock-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 6px;
    z-index: 5;
}

.stock-badge.stock-low {
    background: rgba(251, 191, 36, 0.9);
    color: #0a0a0a;
}

.stock-badge.stock-critical {
    background: rgba(239, 68, 68, 0.9);
    color: #ffffff;
    animation: pulse 2s ease-in-out infinite;
}

.stock-badge.stock-out {
    background: rgba(107, 114, 128, 0.9);
    color: #ffffff;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== SEARCH PANEL ========== */
.search-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.98);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    padding: 40px;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-panel.active {
    transform: translateY(0);
}

.search-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.search-panel-header h2 {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent);
}

.close-search {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-search:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    transform: rotate(90deg);
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 30px;
}

.search-input-wrapper svg {
    position: absolute;
    left: 24px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--accent);
}

.search-input-wrapper input {
    width: 100%;
    padding: 20px 20px 20px 60px;
    font-size: 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(197, 165, 114, 0.2);
    border-radius: 16px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

.search-result-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-result-item:hover {
    background: rgba(197, 165, 114, 0.1);
    border-color: var(--accent);
    transform: translateX(8px);
}

.search-result-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.search-result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.search-result-info h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.search-result-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.5);
    padding: 60px 20px;
}

/* ========== FILTERS SIDEBAR ========== */
.filters-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(197, 165, 114, 0.2);
    z-index: 9998;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.filters-sidebar.active {
    transform: translateX(0);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    border-bottom: 1px solid rgba(197, 165, 114, 0.2);
    position: sticky;
    top: 0;
    background: rgba(10, 10, 10, 0.98);
    z-index: 10;
}

.filters-header h2 {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent);
}

.close-filters {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 50%;
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-filters:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.filters-content {
    padding: 30px;
}

.filter-section {
    margin-bottom: 40px;
}

.filter-section h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-section select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
}

.filter-section select:focus {
    outline: none;
    border-color: var(--accent);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-checkbox:hover {
    background: rgba(197, 165, 114, 0.1);
}

.filter-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--accent);
}

.filter-checkbox span {
    font-size: 14px;
    color: var(--text);
}

.price-range {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.price-range input {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    text-align: center;
}

.price-range input:focus {
    outline: none;
    border-color: var(--accent);
}

.price-range span {
    color: rgba(255, 255, 255, 0.5);
}

.btn-apply-price {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: var(--primary);
    border: none;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-apply-price:hover {
    background: #d4b680;
    transform: translateY(-2px);
}

.btn-reset-filters {
    width: 100%;
    padding: 14px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 2px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset-filters:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ========== FLOATING FILTERS BUTTON ========== */
.floating-filters-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    color: var(--primary);
    box-shadow: 0 8px 24px rgba(197, 165, 114, 0.4);
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.floating-filters-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(197, 165, 114, 0.6);
}

/* ========== FAVORITES MODAL ========== */
.favorites-content {
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 24px;
    padding: 30px;
}

.favorite-item {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.favorite-item:hover {
    background: rgba(197, 165, 114, 0.1);
    border-color: var(--accent);
}

.favorite-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
}

.favorite-item h4 {
    font-size: 16px;
    color: var(--text);
}

.favorite-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent);
}

.btn-remove-favorite {
    padding: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-remove-favorite:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ========== ORDERS MODAL ========== */
.orders-content {
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.orders-list {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.order-item {
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.order-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

.order-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
}

.order-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
}

.order-status.pending {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.order-status.processing {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.order-status.shipped {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.order-status.delivered {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.order-products {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-product {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text);
}

.order-total {
    text-align: right;
    font-size: 20px;
    color: var(--accent);
    margin-bottom: 12px;
}

.order-tracking {
    padding: 12px;
    background: rgba(197, 165, 114, 0.1);
    border-radius: 8px;
    text-align: center;
    font-size: 13px;
    color: var(--accent);
    font-family: 'Courier New', monospace;
}

.empty-message {
    text-align: center;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.5);
    padding: 60px 20px;
}

/* ========== PRODUCT HIGHLIGHT ANIMATION ========== */
.product-card.highlight {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(197, 165, 114, 0);
    }
    50% {
        box-shadow: 0 0 0 20px rgba(197, 165, 114, 0.3);
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .search-panel {
        padding: 20px;
    }

    .search-panel-header h2 {
        font-size: 24px;
    }

    .search-input-wrapper input {
        font-size: 18px;
        padding: 16px 16px 16px 50px;
    }

    .search-results {
        grid-template-columns: 1fr;
        padding: 10px;
    }

    .filters-sidebar {
        width: 100%;
    }

    .floating-filters-btn {
        bottom: 80px;
        right: 20px;
    }

    .favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        padding: 20px;
    }
}
