/* ECOLIVRE - Couleurs écologiques et modernes */

:root {
    /* Couleurs principales */
    --primary-color: #2E7D32;      /* Vert forêt */
    --secondary-color: #81C784;    /* Vert clair */
    --accent-color: #FFA726;       /* Orange chaud pour CTAs */
    --text-color: #212121;         /* Gris foncé pour lisibilité */
    --bg-color: #FAFAFA;          /* Blanc cassé */
    
    /* Couleurs livres occasion */
    --used-book-badge: #795548;    /* Marron vintage */
    --eco-badge: #4CAF50;          /* Vert eco */
}

/* Logo texte stylisé */
.site-logo-text {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    position: relative;
}

.site-logo-text::after {
    content: '📚';
    font-size: 24px;
    position: absolute;
    right: -30px;
    top: 50%;
    transform: translateY(-50%);
}

/* Badges livres occasion */
.product-badge.used-book {
    background: var(--used-book-badge);
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    position: absolute;
    top: 10px;
    left: 10px;
}

/* Badge écologique */
.eco-friendly-badge {
    background: var(--eco-badge);
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 11px;
    margin-left: 5px;
}

/* Boutons CTA */
.button, .btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.button:hover {
    background: #FF6F00;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 167, 38, 0.3);
}

/* Wishlist coeur */
.wishlist-button {
    color: #E91E63;
    font-size: 20px;
    transition: all 0.3s ease;
}

.wishlist-button:hover {
    transform: scale(1.2);
}

/* Précommande */
.preorder-badge {
    background: #3F51B5;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* État livre occasion */
.book-condition {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.condition-excellent { color: #4CAF50; }
.condition-good { color: #8BC34A; }
.condition-fair { color: #FFC107; }
.condition-poor { color: #FF5722; }

/* Header moderne */
.site-header {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

/* Menu de navigation */
.main-navigation {
    font-weight: 500;
}

.main-navigation a {
    color: var(--text-color);
    padding: 10px 20px;
    transition: color 0.3s ease;
}

.main-navigation a:hover {
    color: var(--primary-color);
}

/* Menu déroulant catégories - Compatible tous navigateurs */
.menu-item-has-children {
    position: relative;
}

.menu-item-has-children > a::after {
    content: '\25BC'; /* Unicode pour flèche bas */
    font-size: 10px;
    margin-left: 5px;
    display: inline-block;
}

/* Support tactile pour mobiles/tablettes */
@media (hover: none) and (pointer: coarse) {
    .menu-item-has-children > a::after {
        content: ' \25BC';
        padding: 10px;
    }
}

.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    background-color: #ffffff;
    -webkit-box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    -moz-box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    display: none;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    padding: 10px 0;
    z-index: 1000;
}

/* Hover pour desktop */
@media (hover: hover) and (pointer: fine) {
    .menu-item-has-children:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        display: block;
    }
}

/* Touch/Click pour mobile */
.menu-item-has-children.active > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    display: block;
}

.sub-menu li {
    list-style: none;
    list-style-type: none;
    position: relative;
    margin: 0;
    padding: 0;
}

.sub-menu a {
    display: block;
    padding: 10px 20px;
    color: #212121;
    text-decoration: none;
    font-size: 14px;
    -webkit-transition: all 0.2s ease;
    -moz-transition: all 0.2s ease;
    -o-transition: all 0.2s ease;
    transition: all 0.2s ease;
}

.sub-menu a:hover,
.sub-menu a:focus {
    background: #FAFAFA;
    background-color: #FAFAFA;
    color: #2E7D32;
}

/* Lien "Tout voir" dans les sous-menus */
.sub-menu .view-all {
    border-bottom: 1px solid #eeeeee;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.sub-menu .view-all a {
    font-weight: 600;
    font-weight: bold;
    color: #2E7D32;
}

/* Sous-sous-menu (3ème niveau) */
.sub-sub-menu {
    position: absolute;
    left: 100%;
    top: 0;
    background: white;
    background-color: #ffffff;
    -webkit-box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    -moz-box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    display: none;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    padding: 10px 0;
}

@media (hover: hover) and (pointer: fine) {
    .sub-menu li:hover > .sub-sub-menu {
        opacity: 1;
        visibility: visible;
        display: block;
    }
}

/* Indicateur pour sous-sous-menu - Compatible IE */
.sub-menu li.has-submenu > a::after {
    content: '\25B6'; /* Unicode pour flèche droite */
    float: right;
    font-size: 10px;
}

/* Fallback pour navigateurs ne supportant pas :has() */
.sub-menu li.menu-item-has-children > a::after {
    content: '\25B6';
    float: right;
    font-size: 10px;
}

/* Reset des styles de liste pour compatibilité */
.main-navigation ul,
.main-navigation ol {
    list-style: none;
    list-style-type: none;
    margin: 0;
    padding: 0;
}

/* Support IE11 et Edge legacy */
@supports (-ms-ime-align: auto) {
    .sub-menu {
        display: block;
        height: 0;
        overflow: hidden;
    }
    
    .menu-item-has-children:hover > .sub-menu {
        height: auto;
        overflow: visible;
    }
}

/* Compte client */
.my-account-menu {
    background: var(--bg-color);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Panier flottant */
.cart-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(46, 125, 50, 0.3);
    cursor: pointer;
    z-index: 999;
}

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--accent-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}