/* 
 * CSS SHOP - LE CHEMIN DU PRINCE
 * Styles pour la page shop (index.php)
 * Compatible avec header.php existant
 */

:root {
    /* Variables pour cohérence avec le header */
    --shop-margin-top: 120px;
    --category-tube-height: 45px;
    --products-container-radius: 25px;
    --frosted-bg: rgba(249, 249, 249, 0.55);
    --frosted-blur: blur(6px);
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.2);
    --shadow-inset: inset 0 2px 5px rgba(0, 0, 0, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.15);
    --transition-smooth: 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #777;
}


/* Reset de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'EuropaGroteskNo2SH-roman', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f2ea;
    color: #333;
    line-height: 1.6;
}

/* === LAYOUT PRINCIPAL === */
main {
    margin-top: var(--shop-margin-top);
    padding: 20px;
    min-height: calc(100vh - var(--shop-margin-top));
}

/* === MESSAGES D'ÉTAT === */
.status-message {
    max-width: 95%;
    margin: 0 auto 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
}

.status-message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #dc2626;
}

.status-message.info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #2563eb;
    font-size: 12px;
}



/* === SÉLECTEUR DE CATÉGORIES === */
.category-selector-container {
    display: flex;
    justify-content: center;
    margin: 40px 20px;
    position: relative;
    z-index: 10;
}



/* CONTAINER */
.category-container {
    position: relative;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* ÉTAT FERMÉ */
.category-container:not(.expanded) {
    width: 200px;
    padding: 0 32px;
}

/* ÉTAT OUVERT */
.category-container.expanded {
    width: 740px;
    padding: 0 10px;
    cursor: default;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    z-index: 1001 !important;
}

/* HOVER ÉTAT FERMÉ */
.category-container:not(.expanded):hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* LABEL */
.category-label {
    color: #333;
    font-size: 13px;
    font-weight: 400;
    white-space: nowrap;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.category-container.expanded .category-label {
    color: #faf9f5;
    opacity: 0;
    transform: scale(0.9);
}

.category-container.closing .category-label {
    opacity: 0;
    transform: scale(0.9);
}

.category-container:not(.expanded):not(.closing) .category-label {
    transition-delay: 0.2s;
}

/* OPTIONS CONTAINER */
.category-options {
    position: absolute;
    inset: 10px;
    display: flex;
    gap: 6px;
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}


.category-container.expanded .category-options {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    transition-delay: 0.15s;
}

.category-container.closing .category-options {
    opacity: 0;
    transform: scale(0.95);
    transition-delay: 0s;
}

/* GLIDER */
.glider {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: calc((100% - 18px) / 5);
    background: #fff;
    border-radius: 50px;
    z-index: 1;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.glider[data-position="0"] {
    transform: translateX(0);
}

.glider[data-position="1"] {
    transform: translateX(calc(100% + 4px));
}

.glider[data-position="2"] {
    transform: translateX(calc(200% + 8px));
}

.glider[data-position="3"] {
    transform: translateX(calc(300% + 13px));
}

.glider[data-position="4"] {
    transform: translateX(calc(400% + 18px));
}

/* OPTIONS */
.category-option {
    flex: 1;
    padding: 0 20px;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    white-space: nowrap;
    z-index: 2;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.category-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.category-option.active {
    background: #fff;
    color: #1c1c1c;
}

/* RESPONSIVE */
@media (max-width: 800px) {
    .category-container.expanded {
        width: 95vw;
        max-width: 700px;
    }
    
    .category-option {
        font-size: 12px;
        padding: 0 16px;
    }
}

@media (max-width: 640px) {
    .category-container:not(.expanded) {
        width: 200px;
        padding: 0 28px;
    }
    
    .category-label {
        font-size: 13px;
    }
    
    .category-container.expanded {
        width: 90vw;
    }
    
    .category-option {
        font-size: 11px;
        padding: 0 12px;
    }
}
/* === SECTION PRODUITS === */
.products-section {
    margin: 40px auto;
    max-width: 95%;
    padding: 0 10px;
}

.products-container {
    background-color: var(--frosted-bg);
    backdrop-filter: var(--frosted-blur);
    -webkit-backdrop-filter: var(--frosted-blur);
    border-radius: var(--products-container-radius);
    box-shadow: var(--shadow-light);
    padding: 30px;
    position: relative;
}

/* === BARRE DE FILTRES === */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* BOUTONS RAFFINER - STYLE ACCESSIBILITY MODAL */
.filter-btn {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 10px 24px;
    color: #faf9f5;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-family: inherit;
}

.filter-btn:hover {
    background: rgba(0, 0, 0, 0.75);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* COMPTEUR RÉSULTATS */
.results-count {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
}

.results-count em {
    font-weight: 500;
    color: var(--text-primary);
}

/* SORT CONTAINER - STYLE ACCESSIBILITY MODAL */
.sort-container {
    position: relative;
    z-index: 10;
}

/* BOUTON TRI - GRIS CLAIR PAR DÉFAUT */
.sort-label {
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    padding: 10px 24px;
    color: #333;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    user-select: none;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-label:hover {
    background: rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* BOUTON DEVIENT DARK QUAND OUVERT */
.sort-container[aria-expanded="true"] .sort-label {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #faf9f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.sort-label svg {
    display: none;
}

/* CARTE DROPDOWN - STYLE ACCESSIBILITY MODAL */
.sort-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    min-width: 240px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-1000px) scale(0.55);
    overflow: hidden;
    padding: 8px;
}

.sort-container[aria-expanded="true"] .sort-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* OPTIONS DU TRI */
.sort-option {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 4px;
    color: #fff;
    font-size: 13px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    z-index: 1001 !important;
}

.sort-option:last-child {
    margin-bottom: 0;
}

.sort-option:hover {
    background: rgba(255, 255, 255, 0.1);
}

.sort-option.active {
    background: #fff;
    color: #1c1c1c;
}

/* RESPONSIVE */
@media (max-width: 640px) {
    .sort-label {
        padding: 10px 20px;
        font-size: 12px;
        min-width: 120px;
    }
    
    .sort-dropdown {
        min-width: 200px;
    }
    
    .sort-option {
        padding: 10px 14px;
        font-size: 12px;
    }
}

/* === OVERLAY GLOBAL === */
.global-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
}

.global-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* === INFORMATIONS DE RECHERCHE === */
.search-results-info {
    background: rgba(59, 130, 246, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 25px;
    font-size: 14px;
    color: #1e40af;
}

/* === GRILLE DES PRODUITS === */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.product-card {
    background: none;
    overflow: hidden;
    cursor: pointer;
    border-radius: 8px;
    transition: transform 0.2s ease, opacity var(--transition-smooth);
    /* Animation d'entrée */
    opacity: 0;
    transform: translateY(20px);
}

.product-card.loaded {
    opacity: 1;
    transform: translateY(0);
}

.product-card:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.product-card:focus {
    outline: 2px solid rgba(59, 130, 246, 0.5);
    outline-offset: 2px;
}

/* Image produit */
.product-image {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 125%; /* Ratio 4:5 */
    background: #f5f5f5;
    overflow: hidden;
    border-radius: 4px;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
    opacity: 0;
}

.product-image img.loaded {
    opacity: 1;
}

/* Tags produit */
.product-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 8px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-tag.new {
    background: rgba(34, 197, 94, 0.9);
    color: white;
}

.product-tag.limited {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.product-tag.featured {
    background: rgba(245, 158, 11, 0.9);
    color: white;
}

/* Informations produit */
.product-info {
    padding: 12px 0;
    text-align: left;
}

.product-info h3 {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0.3px;
    color: var(--text-primary);
    line-height: 1.3;
}

.product-price {
    margin: 0 0 8px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
}

.product-description {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

/* === PAGINATION === */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
}

.pagination a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.pagination .active {
    background: var(--text-primary);
    color: white;
    font-weight: 500;
}

.pagination .ellipsis {
    padding: 8px 4px;
    color: var(--text-muted);
}

/* === ÉTAT VIDE === */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.no-results h3 {
    margin: 0 0 15px;
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 400;
}

.no-results p {
    margin: 0 0 25px;
    font-size: 14px;
    line-height: 1.5;
}

.cta-button {
    display: inline-block;
    padding: 12px 24px;
    background: var(--text-primary);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
}

.cta-button:hover {
    background: #000;
    transform: translateY(-1px);
}

/* === SECTION PRODUITS VUS RÉCEMMENT === */
.section-title {
    margin: 0 0 25px;
    font-size: 18px;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

/* === PANNEAU INFO UTILISATEUR === */
.user-info-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--frosted-bg);
    backdrop-filter: var(--frosted-blur);
    -webkit-backdrop-filter: var(--frosted-blur);
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: var(--shadow-light);
    font-size: 12px;
    color: var(--text-secondary);
    max-width: 280px;
    z-index: 10;
}

.loyalty-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 8px;
}

.loyalty-badge.loyalty-standard {
    background: rgba(107, 114, 128, 0.2);
    color: #374151;
}

.loyalty-badge.loyalty-connaisseur {
    background: rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.loyalty-badge.loyalty-maitre {
    background: rgba(245, 158, 11, 0.2);
    color: #d97706;
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .products-container {
        padding: 25px;
    }
}

@media (max-width: 1024px) {
    :root {
        --shop-margin-top: 110px;
    }
    
    .category-tube {
        max-width: 500px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    :root {
        --shop-margin-top: 100px;
        --category-tube-height: 40px;
    }
    
    main {
        padding: 15px;
    }
    
    .products-section {
        margin: 30px auto;
    }
    
    .products-container {
        padding: 20px;
        border-radius: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    
    .category-tube {
        max-width: 450px;
    }
    
    .category-label {
        font-size: 12px;
        padding: 0 6px;
    }
    
    .user-info-panel {
        position: relative;
        bottom: auto;
        right: auto;
        margin: 20px auto 0;
        max-width: 100%;
    }
}

@media (max-width: 580px) {
    .category-tube {
        height: 38px;
        max-width: 380px;
    }
    
    .selector-ball {
        top: 3px;
        height: 32px;
    }
    
    .category-label {
        font-size: 11px;
        padding: 0 4px;
        letter-spacing: 0.2px;
    }
    
    .filter-bar {
        margin-bottom: 20px;
    }
    
    .products-grid {
        gap: 15px;
    }
}

@media (max-width: 480px) {
    :root {
        --shop-margin-top: 90px;
    }
    
    .products-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .category-tube {
        height: 36px;
        max-width: 320px;
    }
    
    .selector-ball {
        top: 3px;
        height: 30px;
    }
    
    .category-label {
        font-size: 10px;
        letter-spacing: 0;
        padding: 0 2px;
    }
    
    .product-info h3 {
        font-size: 13px;
    }
    
    .product-price {
        font-size: 12px;
    }
    
    .product-description {
        font-size: 11px;
    }
}

/* === ACCESSIBILITÉ === */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .category-tube {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Classes utilitaires pour le JavaScript */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* États de chargement */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

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