/* ========================================
   BOUTIQUE CSS
   Design fluide et moderne avec sidebar flexible
   ======================================== */

/* Variables CSS */
:root {
    --primary-color: #007acc;
    --secondary-color: #00d4ff;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --border-color: #e9ecef;
    --shadow-light: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --sidebar-width: 280px;
    --sidebar-width-mobile: 320px;
    --test-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --test-accent: #ff6b6b;
    --test-success: #51cf66;
}

/* Reset et base */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Layout principal */
.boutique-page {
    display: flex;
    min-height: 100vh;
    background: #f5f5f5;
    position: relative;
    padding-top: 0; /* Pas d'espace pour la navigation */
}

/* Sélecteur de catégories mobile */
.mobile-category-selector {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: white;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    color: var(--dark-color);
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    font-weight: 500;
}

.category-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 204, 0.1);
}

.category-select:hover {
    border-color: var(--primary-color);
}

/* Sidebar - Flexible et responsive */
.boutique-sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 2rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: var(--transition);
    flex-shrink: 0;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
}

.sidebar-title i {
    color: var(--secondary-color);
}



/* Section utilisateur */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.user-avatar {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.user-details h6 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.user-details small {
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Barre de recherche */
.search-container {
    margin-bottom: 2rem;
}

.search-container form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.9rem;
    transition: var(--transition);
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px var(--secondary-color);
}

.search-button {
    padding: 0.75rem;
    background: var(--secondary-color);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-button:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

/* Navigation des catégories */
.category-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-item {
    margin-bottom: 0.5rem;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
}

.category-link:hover,
.category-link.active {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: translateX(5px);
}

.category-link i {
    width: 16px;
    text-align: center;
}

/* Container principal */
.boutique-container {
    flex: 1;
    padding: 2rem;
    transition: var(--transition);
    min-height: 100vh;
}

/* Section des produits */
.products-section {
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    margin-bottom: 2rem;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Grille des produits */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    justify-content: center;
    align-items: stretch;
    max-width: 1200px;
    margin: 0 auto;
}

/* Cartes de produits */
.product-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
    transform: translateY(30px);
}

.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:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* Image du produit */
.product-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
    background: var(--light-color);
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

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

/* Contenu du produit */
.product-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
}

.product-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 0.75rem;
    color: var(--dark-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.product-description {
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    color: var(--gray-color);
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Bouton du produit */
.product-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: auto;
}

.product-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    background: linear-gradient(135deg, #194058, var(--primary-color));
}

.product-button:active {
    transform: translateY(0);
}

/* État vide */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.empty-state-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1rem;
}

.empty-state-text {
    color: var(--gray-color);
    font-size: 1rem;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}



/* ========================================
   RESPONSIVE DESIGN - SIDEBAR FLEXIBLE
   ======================================== */

/* Tablettes (768px - 1023px) */
@media (max-width: 1023px) {
    .boutique-sidebar {
        width: 250px;
        padding: 1.5rem;
    }
    
    .boutique-container {
        padding: 1.5rem;
    }
    
    .sidebar-title {
        font-size: 1.3rem;
    }
    
    .user-info {
        padding: 0.75rem;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .search-input {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .category-link {
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Mobile (≤ 767px) */
@media (max-width: 767px) {
    /* Afficher le sidebar en haut sur mobile */
    .boutique-sidebar {
        position: relative !important;
    width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        padding: 1rem !important;
        margin-bottom: 1rem !important;
        border-radius: 0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
        top: 0 !important;
    }
    
    /* Masquer le sélecteur de catégories mobile */
    .mobile-category-selector {
        display: none !important;
    }
    
    .boutique-container {
        padding: 1rem;
        padding-top: 0;
    }
    
    /* Ajuster le layout pour mobile */
    .boutique-page {
        flex-direction: column !important;
    }
    
    /* Optimiser le sidebar pour mobile */
    .sidebar-title {
        font-size: 1.3rem !important;
        margin-bottom: 1rem !important;
        text-align: center !important;
    }
    
    .user-info {
        margin-bottom: 1rem !important;
        padding: 0.75rem !important;
    }
    
    .search-container {
        margin-bottom: 1rem !important;
    }
    
    .category-nav {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        margin-top: 0 !important;
    }
    
    .category-item {
        margin-bottom: 0 !important;
        flex: 1 1 auto !important;
    }
    
    .category-link {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.85rem !important;
        text-align: center !important;
        border-radius: 6px !important;
        white-space: nowrap !important;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 100%;
    }
    
    .product-content {
        padding: 1.25rem;
    }
    
    .product-title {
        font-size: 1.3rem;
    }
    
    .product-price {
        font-size: 1.5rem;
    }
    
    .product-button {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}

/* Très petits écrans (≤ 480px) */
@media (max-width: 480px) {
    .boutique-sidebar {
        padding: 0.75rem !important;
    }
    
    .boutique-container {
        padding: 0.5rem;
        padding-top: 0;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-content {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1.2rem;
    }
    
    .product-description {
        font-size: 0.9rem;
    }
    
    .product-price {
        font-size: 1.4rem;
    }
    
    .product-button {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
    }
    
    .sidebar-title {
        font-size: 1.2rem !important;
    }
    
    .user-info {
        padding: 0.5rem !important;
    }
    
    .user-avatar {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
    
    .category-nav {
        gap: 0.25rem !important;
    }
    
    .category-link {
        padding: 0.4rem 0.6rem !important;
        font-size: 0.8rem !important;
    }
}

/* Grand écran : 3 produits par ligne (≥ 1200px) */
@media (min-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
        max-width: 1400px;
    }
}

/* Écran moyen : 2 produits par ligne (768px - 1199px) */
@media (min-width: 768px) and (max-width: 1199px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
        max-width: 1000px;
    }
}

/* ========================================
   OPTIMISATIONS PERFORMANCE
   ======================================== */

.product-card {
    will-change: transform;
    backface-visibility: hidden;
}

.product-image {
    will-change: transform;
}

.product-button {
    will-change: transform;
}

/* ========================================
   ACCESSIBILITÉ
   ======================================== */

.product-button:focus {
    outline: 2px solid var(--secondary-color);
    outline-offset: 2px;
}

.product-card:focus-within {
    box-shadow: 0 0 0 2px var(--secondary-color);
}

/* ========================================
   MODE SOMBRE (si supporté)
   ======================================== */

@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
    }
    
    .product-card {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .product-title {
        color: #e2e8f0;
    }
    
    .product-description {
        color: #a0aec0;
    }
    
    .product-image-container {
        background: #4a5568;
    }
    
    .empty-state {
        background: #2d3748;
    }
    
    .empty-state-title {
        color: #e2e8f0;
    }
    
    .empty-state-text {
        color: #a0aec0;
    }
}

/* ========================================
   PRODUIT TEST EN VEDETTE
   ======================================== */

.test-product-section {
    margin-bottom: 3rem;
}

.test-product-card {
    background: var(--test-gradient);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-hover);
    position: relative;
    color: white;
    animation: slideInFromTop 0.8s ease-out;
}

.test-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
}

.test-product-header {
    text-align: center;
    padding: 2rem 2rem 1rem;
    position: relative;
    z-index: 2;
}

.test-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    padding: 0.5rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: white;
    animation: pulse 2s infinite;
}

.test-product-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.test-product-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 0;
}

.test-product-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 0 2rem 2rem;
    position: relative;
    z-index: 2;
}

.test-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.test-product-image img {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.test-product-image img:hover {
    transform: scale(1.05);
}

.test-image-placeholder {
    width: 100%;
    max-width: 300px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    border: 2px dashed rgba(255, 255, 255, 0.3);
}

.test-product-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.test-product-description {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
}

.test-product-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.feature-item i {
    font-size: 1.1rem;
    color: var(--test-success);
}

.test-product-price {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin: 1rem 0;
}

.price-free {
    font-size: 2rem;
    font-weight: 700;
    color: var(--test-success);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.price-original {
    font-size: 1rem;
    opacity: 0.7;
    text-decoration: line-through;
}

.test-product-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-test-primary {
    background: var(--test-success);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(81, 207, 102, 0.4);
}

.btn-test-primary:hover {
    background: #45a049;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(81, 207, 102, 0.6);
}

.btn-test-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.btn-test-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.5);
}

.test-product-notice {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

.section-subtitle {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.section-subtitle::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.other-products-section {
    margin-top: 3rem;
}

/* Animations pour le produit test */
@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Responsive pour le produit test */
@media (max-width: 768px) {
    .test-product-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0 1.5rem 1.5rem;
    }
    
    .test-product-title {
        font-size: 2rem;
    }
    
    .test-product-features {
        grid-template-columns: 1fr;
    }
    
    .test-product-actions {
        flex-direction: column;
    }
    
    .btn-test-primary,
    .btn-test-secondary {
        justify-content: center;
        text-align: center;
    }
    
    .test-product-header {
        padding: 1.5rem 1.5rem 1rem;
    }
}

@media (max-width: 480px) {
    .test-product-title {
        font-size: 1.5rem;
    }
    
    .test-product-subtitle {
        font-size: 1rem;
    }
    
    .price-free {
        font-size: 1.5rem;
    }
    
    .test-product-content {
        padding: 0 1rem 1rem;
    }
} 