/**
 * E-Commerce Modern Theme - Style Amazon
 * Design moderne inspiré des meilleurs sites e-commerce
 */

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* ===== Container ===== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 24px;
    }
}

/* ===== Header ===== */
.main-header {
    background: white;
}

.brand-logo:hover {
    opacity: 0.9;
}

/* ===== Search ===== */
.search-wrapper {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.search-wrapper:focus-within {
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.1);
}

.search-category-select {
    padding: 12px 16px;
    border: none;
    background: #F3F4F6;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    border-right: 1px solid #E5E7EB;
}

.search-category-select:hover {
    background: #E5E7EB;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 15px;
    outline: none;
    background: white;
}

.search-input::placeholder {
    color: #9CA3AF;
}

.search-btn {
    padding: 12px 20px;
    border: none;
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: white;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover {
    background: linear-gradient(135deg, #EA580C, #DC2626);
}

/* ===== Category Navigation ===== */
.category-nav {
    scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
    display: none;
}

.category-nav a {
    color: #374151;
    font-size: 14px;
}

/* ===== Category Dropdown ===== */
.category-dropdown {
    animation: slideDown 0.2s ease;
}

.category-dropdown a {
    color: #6B7280;
    font-size: 14px;
    transition: color 0.2s;
}

.category-dropdown a:hover {
    color: #F97316;
}

/* ===== Mobile Menu ===== */
.mobile-menu {
    animation: fadeIn 0.2s ease;
}

.mobile-menu nav ul a {
    color: #374151;
    transition: background 0.2s;
}

/* ===== Cart Button ===== */
.cart-btn {
    position: relative;
}

.cart-count {
    animation: scaleIn 0.3s ease;
}

/* ===== Dropdown Menu ===== */
.dropdown-menu {
    animation: slideDown 0.2s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.dropdown-menu a {
    color: #374151;
    font-size: 14px;
    transition: background 0.2s;
}

/* ===== Back to Top ===== */
.back-to-top {
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
    font-size: 14px;
}

.breadcrumb a {
    color: #6B7280;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #F97316;
}

/* ===== Main Content ===== */
.main-content {
    background: #F9FAFB;
}

/* ===== Product Cards (Amazon Style) ===== */
.product-card {
    position: relative;
}

.product-card .card {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.product-card:hover .card {
    border-color: #F97316;
    box-shadow: 0 8px 30px rgba(249, 115, 22, 0.15);
    transform: translateY(-4px);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    padding: 16px;
    transition: transform 0.3s;
}

.product-card:hover .product-image {
    transform: scale(1.05);
    padding: 12px;
}

.card-body {
    padding: 16px;
}

.product-category {
    font-size: 12px;
    color: #6B7280;
    margin-bottom: 4px;
}

.product-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin-bottom: 8px;
}

.product-title a {
    color: #111827;
    transition: color 0.2s;
}

.product-title a:hover {
    color: #F97316;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
    font-size: 12px;
}

.product-rating i {
    color: #FBBF24;
}

.product-rating .rating-count {
    color: #6B7280;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.product-price .current {
    font-size: 20px;
    font-weight: 700;
    color: #B91C1C;
}

.product-price .old {
    font-size: 14px;
    color: #9CA3AF;
    text-decoration: line-through;
}

.product-card .btn {
    width: 100%;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

/* ===== Prime-style Badge ===== */
.prime-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: linear-gradient(135deg, #00A8E1, #00D4FF);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

/* ===== Deal Banner ===== */
.deal-banner {
    background: linear-gradient(135deg, #B91C1C, #DC2626);
    color: white;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.deal-banner h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.deal-countdown {
    display: flex;
    gap: 16px;
}

.countdown-item {
    text-align: center;
}

.countdown-value {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
}

.countdown-label {
    font-size: 12px;
    opacity: 0.9;
}

/* ===== Filters Sidebar ===== */
.filters-sidebar {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 16px;
    height: fit-content;
    position: sticky;
    top: 80px;
}

.filter-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #E5E7EB;
}

.filter-section:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

.filter-item input {
    width: 16px;
    height: 16px;
    accent-color: #F97316;
}

/* ===== Cart Table ===== */
.cart-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.cart-table thead {
    background: #F3F4F6;
}

.cart-table thead th {
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: #6B7280;
    border-bottom: 2px solid #E5E7EB;
}

.cart-table tbody tr {
    border-bottom: 1px solid #E5E7EB;
    transition: background 0.2s;
}

.cart-table tbody tr:hover {
    background: #F9FAFB;
}

.cart-table tbody td {
    padding: 16px;
    vertical-align: middle;
}

.cart-image {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 4px;
    border: 1px solid #E5E7EB;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    overflow: hidden;
}

.quantity-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: #F3F4F6;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background: #E5E7EB;
}

.quantity-input {
    width: 50px;
    height: 32px;
    border: none;
    text-align: center;
    font-weight: 500;
    background: white;
}

.cart-summary {
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #E5E7EB;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-total {
    font-size: 20px;
    font-weight: 700;
    color: #B91C1C;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    gap: 4px;
    margin-top: 24px;
}

.page-link {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    background: white;
    color: #374151;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
}

.page-link:hover {
    border-color: #F97316;
    color: #F97316;
}

.page-link.active {
    background: linear-gradient(135deg, #F97316, #EA580C);
    border-color: #F97316;
    color: white;
}

.page-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
}

.empty-icon {
    font-size: 80px;
    color: #E5E7EB;
    margin-bottom: 24px;
}

.empty-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
}

.empty-desc {
    color: #6B7280;
    margin-bottom: 24px;
}

.empty-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #EA580C, #DC2626);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-secondary {
    background: white;
    border: 1px solid #E5E7EB;
    color: #374151;
}

.btn-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.btn-outline {
    background: transparent;
    border: 1px solid #E5E7EB;
    color: #374151;
}

.btn-outline:hover {
    border-color: #F97316;
    color: #F97316;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== Alerts ===== */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-danger {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-warning {
    background: #FEF3C7;
    color: #92400E;
    border: 1px solid #FDE68A;
}

.alert-info {
    background: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .filters-sidebar {
        position: static;
    }

    .search-wrapper {
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    .category-nav {
        display: none;
    }

    .category-dropdown {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 100;
    }

    .search-wrapper {
        order: 3;
        width: 100%;
        max-width: none;
        margin-top: 12px;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody tr {
        display: flex;
        flex-direction: column;
        border-bottom: 2px solid #E5E7EB;
    }

    .cart-table tbody td {
        padding: 12px;
        width: 100%;
    }

    .empty-actions {
        flex-direction: column;
    }

    .empty-actions .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .product-image {
        height: 160px;
    }

    .product-title {
        height: 36px;
    }

    .product-price .current {
        font-size: 18px;
    }
}

/* ===== Utility Classes ===== */
.grid {
    display: grid;
}

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-6 { gap: 24px; }
.gap-8 { gap: 32px; }

.p-2 { padding: 8px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-4 { padding-top: 16px; padding-bottom: 16px; }

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }

.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.text-center { text-align: center; }
.text-right { text-align: right; }

.rounded-lg { border-radius: 8px; }
.rounded-full { border-radius: 9999px; }

.shadow-sm { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1); }

.hover\:bg-gray-100:hover { background: #F3F4F6; }

.transition { transition: all 0.2s; }

.hidden { display: none; }

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .md\:flex { display: flex; }
    .md\:inline { display: inline; }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:flex { display: flex; }
}
