/* =======================================================
   FICHIER : shop-home.css
   PROJET : HelloColis Shopping - Bibliothèque Interactive
   VERSION : 4.0 (Avec bandeau catégories mobile + hover)
   ======================================================= */

/* -------------------------------------
   VARIABLES & CONSTANTES
------------------------------------- */
:root {
    --neon-blue: #3BD0FF;
    --night-blue: #0A1C30;
    --deep-black: #061120;
    --ice-white: #EAF6FF;
    --glow-shadow: 0 0 20px rgba(59, 208, 255, 0.5);
    --muted-blue: #cfe4ef;
    --panel-dark: rgba(10, 28, 48, 0.9);
    --header-height: 70px;
    --header-height-tablet: 60px;
    --header-height-mobile: 55px;
    --gold: #FFD700;
}

/* -------------------------------------
   RESET & BASE
------------------------------------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--deep-black) 0%, var(--night-blue) 100%);
    color: var(--ice-white);
    -webkit-font-smoothing: antialiased;
}

/* -------------------------------------
   LAYOUT BIBLIOTHÈQUE
------------------------------------- */
.library-scene {
    height: 100vh;
    display: flex;
    gap: 5px;
    align-items: center;
    justify-content: center;
    padding: 32px 32px 80px;
    position: relative;
    background: radial-gradient(ellipse at 50% 10%, rgba(59, 208, 255, 0.05) 0%, transparent 70%);
    overflow: visible;
}

.library-scene.has-header {
    padding-top: calc(var(--header-height) + 120px);
    height: calc(100vh - var(--header-height) - 20px);
}

/* -------------------------------------
   RAYONS LATÉRAUX (DESKTOP ONLY)
------------------------------------- */
.library-shelf {
    width: 240px;
    height: 75vh;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px;
    border-radius: 12px;
    background: var(--panel-dark);
    border: 1px solid rgba(59, 208, 255, 0.1);
    box-shadow: 0 6px 30px rgba(2, 7, 12, 0.6);
    backdrop-filter: blur(6px);
    overflow-y: auto;
    margin-top: -50px;
}

.shelf-header {
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(64, 156, 255, 0.2);
}

.shelf-main-title {
    font-family: 'Michroma', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.5px;
    color: #A3D0FF;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.shelf-main-title .glow-dot {
    width: 8px;
    height: 8px;
    background: #4A90E2;
    border-radius: 50%;
    box-shadow: 0 0 10px #4A90E2;
}

.shelf-section {
    margin-bottom: 1.2rem;
}

.shelf-title {
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--neon-blue);
    margin-bottom: 0.5rem;
}

.shelf-emoji {
    font-size: 1rem;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.3));
}

.shelf-icons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.shelf-icon {
    height: 42px;
    border-radius: 12px;
    padding: 0.4rem 0.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    background: rgba(30, 45, 80, 0.6);
    border: 1px solid rgba(64, 156, 255, 0.2);
    color: #D0E4FF;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shelf-icon .icon-label {
    font-size: 0.7rem;
}

.shelf-icon:hover {
    background: linear-gradient(180deg, rgba(59, 208, 255, 0.15) 0%, rgba(40, 60, 110, 0.8) 100%);
    border-color: var(--neon-blue);
    transform: translateY(-2px);
    color: #FFFFFF;
}

.support-btn {
    background: linear-gradient(135deg, #4A90E2 0%, #2A60B0 100%);
    border: none;
    border-radius: 20px;
    padding: 0.8rem 1rem;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.support-btn:hover {
    background: linear-gradient(135deg, #5AA0F2 0%, #3A70C0 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(74, 144, 226, 0.4);
}

/* -------------------------------------
   LIVRE CENTRAL
------------------------------------- */
.book-stage {
    width: 850px;
    max-width: 90vw;
    height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    perspective: 1600px;
    position: relative;
}

.interactive-book {
    width: 720px;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.2, 1);
    z-index: 2;
    animation: bookAppear 0.8s ease;
}

.book-page {
    width: 360px;
    height: 100%;
    background: linear-gradient(180deg, #0A1C30 0%, #0D2B4A 50%, #1B3A5B 100%);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 60px rgba(2, 7, 12, 0.6);
    display: flex;
    flex-direction: column;
    padding: 15px;
    transform-origin: center left;
    backface-visibility: hidden;
    position: relative;
    overflow: hidden;
}

.page-left {
    margin-right: 6px;
    border-right: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px 4px 4px 12px;
}

.page-right {
    margin-left: 6px;
    border-left: 2px solid rgba(0, 0, 0, 0.05);
    border-radius: 4px 12px 12px 4px;
}

.book-header {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--neon-blue);
    font-family: 'Michroma', sans-serif;
    font-weight: 700;
    letter-spacing: 8px;
    text-transform: uppercase;
    text-shadow: 0 6px 30px rgba(59, 208, 255, 0.5);
    font-size: 24px;
    white-space: nowrap;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--neon-blue);
}

.page-title {
    color: var(--ice-white);
    font-size: 16px;
    font-weight: 700;
}

.page-category {
    background: var(--neon-blue);
    color: var(--deep-black);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

/* Produits */
.page-products {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

.page-product {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(59, 208, 255, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
}

/* ✅ EFFET HOVER DESKTOP - TRÈS IMPORTANT */
@media (min-width: 901px) {
    .page-product:hover {
        border-color: var(--neon-blue);
        background: rgba(59, 208, 255, 0.15);
        /*transform: translateY(-2px) scale(1.02);*/
        box-shadow: 0 10px 25px rgba(59, 208, 255, 0.15);
        z-index: 10;
    }
}

.product-thumb {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(59, 208, 255, 0.1), rgba(59, 208, 255, 0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid rgba(59, 208, 255, 0.2);
}

.product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.product-name {
    font-weight: 600;
    color: var(--ice-white);
    font-size: 14px;
}

.product-desc {
    font-size: 12px;
    color: var(--muted-blue);
    line-height: 1.4;
}

.product-price {
    color: var(--neon-blue);
    font-weight: 700;
    font-size: 15px;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.btn-buy, .btn-details {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 9px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-buy {
    background: linear-gradient(90deg, var(--neon-blue), #2ab8e0);
    color: var(--deep-black);
    border: none;
}

.btn-details {
    background: transparent;
    color: var(--muted-blue);
    border: 1px solid rgba(59, 208, 255, 0.3);
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 208, 255, 0.4);
}

.btn-details:hover {
    background: rgba(59, 208, 255, 0.1);
    color: var(--neon-blue);
    border-color: var(--neon-blue);
}

/* Contrôles de navigation */
.book-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    background: var(--panel-dark);
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid rgba(59, 208, 255, 0.2);
    backdrop-filter: blur(10px);
    margin-top: 20px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--neon-blue);
    color: var(--neon-blue);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--neon-blue);
    color: var(--deep-black);
    transform: scale(1.1);
}

.page-dots {
    display: flex;
    gap: 8px;
}

.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-dot.active {
    background: var(--neon-blue);
    box-shadow: 0 0 10px var(--neon-blue);
    transform: scale(1.2);
}

/* -------------------------------------
   BANDEAU CATÉGORIES MOBILE (Navigation)
------------------------------------- */
.mobile-categories-bar {
    display: none;
    width: 100%;
    margin: 1rem 0;
    padding: 0.5rem 0;
    background: rgba(10, 20, 40, 0.9);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(74, 144, 226, 0.3);
    border-bottom: 1px solid rgba(74, 144, 226, 0.3);
    z-index: 5;
}

.categories-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 0.5rem;
    padding: 0.2rem 1rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.category-chip {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    padding: 0.3rem 0.6rem;
    background: rgba(30, 45, 80, 0.9);
    border: 1px solid rgba(74, 144, 226, 0.3);
    border-radius: 20px;
    color: #D0E4FF;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 50px;
}

.category-chip .chip-icon {
    font-size: 0.9rem;
}

.category-chip .chip-label {
    font-size: 0.6rem;
    white-space: nowrap;
}

.category-chip:hover,
.category-chip.active {
    background: rgba(74, 144, 226, 0.3);
    border-color: var(--neon-blue);
    color: white;
    transform: translateY(-1px);
}

/* ✅ Navigation par chips - interaction */
.category-chip[data-category="sacs"]:active,
.category-chip[data-category="chaussures"]:active,
.category-chip[data-category="audio"]:active,
.category-chip[data-category="smart"]:active,
.category-chip[data-category="epicerie"]:active,
.category-chip[data-category="snacks"]:active {
    transform: scale(0.95);
}

/* -------------------------------------
   SCROLLBAR PERSONNALISÉE
------------------------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--neon-blue);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5AA0F2;
}

/* -------------------------------------
   ANIMATIONS
------------------------------------- */
@keyframes bookAppear {
    from {
        opacity: 0;
        transform: scale(0.9) rotateX(10deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotateX(0);
    }
}

/* -------------------------------------
   MEDIA QUERIES - TABLETTE
------------------------------------- */
@media (max-width: 900px) {
    .library-shelf {
        display: none;
    }

    .mobile-categories-bar {
        display: block;
    }

    .book-stage {
        width: 100%;
        height: auto;
        padding-bottom: 80px;
    }

    .interactive-book {
        width: 85%;
        height: 80%;
    }

    .book-page {
        width: 50%;
        padding: 15px;
    }

    .page-product {
        padding: 12px;
        gap: 12px;
    }

    .product-thumb {
        width: 70px;
        height: 70px;
    }

    .library-scene.has-header {
        padding-top: calc(var(--header-height-tablet) + 100px);
    }
}

/* -------------------------------------
   MEDIA QUERIES - MOBILE (AVEC NAVIGATION)
------------------------------------- */
/* Mobile */
@media (max-width: 600px) {
    /* ✅ 1. RÉDUIRE L'ESPACE AVEC LE TOP MENU */
    .library-scene {
        padding-left: 0;
        padding-right: 0;
        padding-bottom: 40px;
        padding-top: 0; /* ← Supprime l'espace en haut */
    }

    .library-scene.has-header {
        padding-top: calc(var(--header-height-mobile) + 100px); /* ← Réduit de 100px à 20px */
        height: calc(100vh - var(--header-height-mobile));
    }

    /* ✅ 2. LIVRE OCCUPE TOUTE LA LARGEUR */
    .book-stage {
        width: 100vw; /* ← Pleine largeur */
        height: auto;
        min-height: 75vh;
        margin: 0; /* ← Supprime les marges */
        padding: 0 2px 40px; /* ← Padding latéral minimal */
        left: 0;
        right: 0;
    }

    .interactive-book {
        width: 100%;
        height: auto;
        display: flex;
        flex-direction: row;
        gap: 4px;
        padding: 5px 2px; /* ← Padding latéral réduit */
    }

    /* ✅ 3. PAGES PLUS GRANDES */
    .book-page {
        width: 50%;
        padding: 12px; /* ← Augmenté de 8px à 12px */
        margin: 0;
    }

    .page-left {
        margin-right: 2px;
        border-radius: 8px 2px 2px 8px;
    }

    .page-right {
        margin-left: 2px;
        border-radius: 2px 8px 8px 2px;
    }

    .book-header {
        display: none !important;
    }

    /* ✅ 4. EN-TÊTES DE PAGE PLUS GRANDS */
    .page-header {
        flex-direction: column;
        gap: 4px;
        align-items: flex-start;
        margin-bottom: 10px;
        padding-bottom: 6px;
    }

    .page-title {
        font-size: 14px; /* ← Augmenté de 11px à 14px */
        font-weight: 700;
    }

    .page-category {
        font-size: 10px; /* ← Augmenté de 7px à 10px */
        padding: 3px 10px;
        border-radius: 20px;
    }

    /* ✅ 5. PRODUITS PLUS GRANDS */
    .page-products {
        display: flex;
        flex-direction: column;
        gap: 10px; /* ← Augmenté de 6px à 10px */
    }

    .page-product {
        display: flex;
        flex-direction: column;
        text-align: center;
        padding: 10px 8px; /* ← Augmenté */
        gap: 8px;
        margin-bottom: 4px;
    }

    .product-thumb {
        width: 80px; /* ← Augmenté de 50px à 70px */
        height: 80px;
        margin: 0 auto;
    }

    .product-info {
        align-items: center;
        gap: 4px;
    }

    .product-name {
        font-size: 12px; /* ← Augmenté de 10px à 13px */
        font-weight: 500;
    }

    /* 🗑️ SUPPRIMER LA DESCRIPTION EN MOBILE */
    .product-desc {
        display: none; /* ← Caché en mobile */
        /*
        font-size: 12px; /* ← Augmenté de 8px à 11px */
        /*line-height: 1.3;*/
    }



    .product-price {
        font-size: 14px; /* ← Augmenté de 11px à 14px */
        font-weight: 700;
        margin: 4px 0;
    }

    .product-actions {
        justify-content: center;
        margin-top: 6px;
        gap: 8px;
    }

    .btn-buy, .btn-details {
        padding: 5px 10px; /* ← Augmenté */
        font-size: 9px; /* ← Augmenté de 7px à 9px */
        border-radius: 6px;
    }

    /* ✅ 6. BANDEAU CATÉGORIES AJUSTÉ */
    .mobile-categories-bar {
        display: block;
        width: 100%;
        margin: 12px 0 15px 0;
        padding: 0.4rem 0;
        background: rgba(10, 20, 40, 0.9);
        backdrop-filter: blur(8px);
        border-top: 1px solid rgba(74, 144, 226, 0.3);
        border-bottom: 1px solid rgba(74, 144, 226, 0.3);
    }

    .categories-scroll-container {
        display: flex;
        overflow-x: auto;
        gap: 0.6rem;
        padding: 0.3rem 1rem;
    }

    .category-chip {
        flex: 0 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.2rem;
        padding: 0.3rem 0.6rem;
        background: rgba(30, 45, 80, 0.9);
        border: 1px solid rgba(74, 144, 226, 0.3);
        border-radius: 20px;
        color: #D0E4FF;
        font-size: 0.7rem;
        cursor: pointer;
        min-width: 55px; /* ← Augmenté de 45px à 55px */
    }

    .category-chip .chip-icon {
        font-size: 1rem; /* ← Augmenté */
    }

    .category-chip .chip-label {
        font-size: 0.65rem; /* ← Augmenté */
        white-space: nowrap;
    }

    /* ✅ 7. CONTRÔLES DE NAVIGATION */
    .book-controls {
        margin: 8px 0 15px;
        padding: 10px 20px;
        gap: 12px;
    }

    .nav-btn {
        width: 36px; /* ← Augmenté de 32px à 36px */
        height: 36px;
    }

    .nav-btn svg {
        width: 16px;
        height: 16px;
    }

    .page-dots {
        gap: 8px;
    }

    .page-dot {
        width: 8px; /* ← Augmenté de 6px à 8px */
        height: 8px;
    }
}

/* -------------------------------------
   TRÈS PETITS MOBILES
------------------------------------- */


/* Très petits mobiles (moins d'ajustement) */
@media (max-width: 400px) {
    .book-page {
        padding: 8px;
    }

    .product-thumb {
        width: 60px;
        height: 60px;
    }

    .product-name {
        font-size: 12px;
    }

    /* 🗑️ SUPPRIMER LA DESCRIPTION EN MOBILE */
    .product-desc {
        display: none; /* ← Caché en mobile */
        /*font-size: 10px;*/
    }

    .product-price {
        font-size: 13px;
    }

    .btn-buy, .btn-details {
        padding: 4px 8px;
        font-size: 8px;
    }

    .category-chip {
        min-width: 50px;
        padding: 0.25rem 0.5rem;
    }

    .chip-icon {
        font-size: 0.9rem;
    }

    .chip-label {
        font-size: 0.6rem;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
    }

    .page-dot {
        width: 7px;
        height: 7px;
    }
}