/* =====================================================
   MARKET PAGE STYLES - HenschTech3D
   ===================================================== */

/* Header Boutique */
.market-header {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%), 
                url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 400"><defs><pattern id="grid" x="0" y="0" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect fill="url(%23grid)" x="0" y="0" width="100%25" height="100%25"/><circle cx="200" cy="100" r="80" fill="rgba(174, 226, 255, 0.2)"/><circle cx="800" cy="300" r="120" fill="rgba(169, 112, 255, 0.2)"/><circle cx="1000" cy="150" r="60" fill="rgba(0, 255, 194, 0.2)"/></svg>');
    background-size: cover;
    background-position: center;
    padding: 120px 0 60px;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.market-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="rgba(255,255,255,0.1)" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,138.7C960,139,1056,117,1152,106.7C1248,96,1344,96,1392,96L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') bottom center no-repeat;
    background-size: cover;
    opacity: 0.3;
}

.market-header h1 {
    font-size: 3.5em;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.market-header p {
    font-size: 1.3em;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    opacity: 0.95;
}

/* Barre de recherche */
.search-bar {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.search-form {
    display: flex;
    gap: 10px;
    background: white;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    position: relative;
}

.search-form input {
    flex: 1;
    border: none;
    padding: 15px 25px;
    padding-right: 50px; /* Space for clear button */
    font-size: 1.05em;
    border-radius: 50px;
    outline: none;
    background: transparent;
    color: #333;
}

.search-form input::placeholder {
    color: #999;
}

.btn-clear-search {
    position: absolute;
    right: 180px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0,0,0,0.1);
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 18px;
    transition: all 0.3s ease;
    line-height: 1;
}

.btn-clear-search:hover {
    background: rgba(0,0,0,0.2);
    color: #333;
    transform: translateY(-50%) scale(1.1);
}

.btn-search {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
}

.btn-search:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* Layout principal */
.market-content {
    padding: 60px 0;
    min-height: 60vh;
}

.market-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* Sidebar */
.market-sidebar {
    position: sticky;
    top: 100px;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.filter-section {
    margin-bottom: 35px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: var(--text-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

/* Liste catégories */
.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 10px;
    transition: all 0.3s ease;
    font-size: 0.95em;
}

.category-list a:hover {
    background: var(--accent-color);
    color: white;
    transform: translateX(5px);
}

.category-list a.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.cat-icon {
    margin-right: 10px;
    font-size: 1.2em;
}

.count {
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
}

.category-list a.active .count {
    background: rgba(255,255,255,0.3);
}

/* Filtres prix */
.price-ranges {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.checkbox-label:hover {
    background: var(--hover-bg);
}

.checkbox-label input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.checkbox-label span {
    font-size: 0.95em;
    color: var(--text-color);
}

/* Bouton reset filtres */
.btn-reset-filters {
    background: var(--border-color);
    color: var(--text-color);
}

.btn-reset-filters:hover {
    background: #e74c3c;
    color: white;
}

/* Zone principale */
.market-main {
    flex: 1;
}

/* Toolbar */
.market-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 25px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.results-count {
    color: var(--text-color);
    font-weight: 600;
    font-size: 1.05em;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.toolbar-right label {
    color: var(--text-color);
    font-weight: 500;
}

.sort-select {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.95em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sort-select:hover {
    border-color: var(--accent-color);
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Grille produits */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

/* Améliorations product-card pour market */
.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-8px);
}

.product-badge.out-of-stock {
    background: #95a5a6;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: #ddd;
    font-size: 1em;
}

.star.filled {
    color: #ffc107;
}

.star.half {
    background: linear-gradient(90deg, #ffc107 50%, #ddd 50%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.rating-count {
    font-size: 0.85em;
    color: #666;
}

/* Message aucun produit */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.no-products-icon {
    font-size: 5em;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-products h3 {
    font-size: 1.8em;
    color: var(--text-color);
    margin-bottom: 15px;
}

.no-products p {
    color: #666;
    font-size: 1.1em;
    margin-bottom: 30px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 50px;
    flex-wrap: wrap;
}

.pagination-btn,
.pagination-number {
    padding: 12px 20px;
    background: var(--card-bg);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.pagination-btn:hover,
.pagination-number:hover {
    background: var(--accent-color);
    color: white;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.pagination-number.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
}

.pagination-ellipsis {
    padding: 12px 10px;
    color: var(--text-color);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .market-layout {
        grid-template-columns: 240px 1fr;
        gap: 30px;
    }
    
    .market-sidebar {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .market-header {
        padding: 100px 0 40px;
    }
    
    .market-header h1 {
        font-size: 2.2em;
    }
    
    .market-header p {
        font-size: 1.1em;
    }
    
    .search-form {
        flex-direction: column;
        padding: 15px;
        border-radius: 20px;
    }
    
    .search-form input {
        border-radius: 15px;
    }
    
    .btn-search {
        border-radius: 15px;
        width: 100%;
    }
    
    .market-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .market-sidebar {
        position: static;
        max-width: 100%;
    }
    
    .market-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .toolbar-right {
        flex-direction: column;
        align-items: stretch;
    }
    
    .sort-select {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .pagination {
        gap: 5px;
    }
    
    .pagination-btn,
    .pagination-number {
        padding: 10px 15px;
        font-size: 0.9em;
    }
}

@media (max-width: 480px) {
    .market-header h1 {
        font-size: 1.8em;
    }
    
    .market-header p {
        font-size: 1em;
    }
    
    .search-form {
        flex-direction: column;
        gap: 10px;
        padding: 15px;
        border-radius: 20px;
    }
    
    .search-form input {
        padding: 12px 20px;
        width: 100%;
    }
    
    .btn-clear-search {
        right: 20px;
        top: 27px;
    }
    
    .btn-search {
        width: 100%;
        padding: 12px 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination-btn {
        padding: 10px;
        font-size: 0.85em;
    }
    
    .pagination-number {
        padding: 8px 12px;
    }
}

/* Dark theme adjustments */
.dark-theme .market-sidebar,
.dark-theme .market-toolbar,
.dark-theme .no-products {
    background: var(--card-bg-dark, #2d2d2d);
}

.dark-theme .search-form {
    background: #2d2d2d;
}

.dark-theme .search-form input {
    color: #fff;
}

.dark-theme .search-form input::placeholder {
    color: #888;
}

.dark-theme .btn-clear-search {
    background: rgba(255,255,255,0.1);
    color: #ccc;
}

.dark-theme .btn-clear-search:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.dark-theme .category-list a:hover {
    background: rgba(102, 126, 234, 0.2);
    color: #fff;
}

.dark-theme .checkbox-label:hover {
    background: rgba(255, 255, 255, 0.05);
}

.dark-theme .sort-select,
.dark-theme .pagination-btn,
.dark-theme .pagination-number {
    background: #2d2d2d;
    border-color: #444;
    color: #fff;
}

.dark-theme .btn-reset-filters {
    background: #444;
    color: #fff;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.5s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.05s; }
.product-card:nth-child(2) { animation-delay: 0.1s; }
.product-card:nth-child(3) { animation-delay: 0.15s; }
.product-card:nth-child(4) { animation-delay: 0.2s; }
.product-card:nth-child(5) { animation-delay: 0.25s; }
.product-card:nth-child(6) { animation-delay: 0.3s; }

/* Button styles for Market page */
.btn-view-product {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-view-product .view-icon {
    font-size: 1rem;
}
