/* Book Wrapper */
.book-wrapper {
    width: 100%;
    max-width: 1400px;
    height: 770px;
    margin: 0 auto;
}

.book-background {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    width: 100%;
    height: 100%;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(31, 28, 19, 0.7);
}

/* Reliure */
.book-spine {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: calc(100% - 60px);
    top: 30px;
    background: linear-gradient(to bottom, rgba(212,175,55,0.2), rgba(212,175,55,0.4), rgba(212,175,55,0.2));
    box-shadow: 0 0 10px rgba(212,175,55,0.3);
    z-index: 10;
}

/* Scene */
.book-pages-scene {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    perspective: 2000px;
}

/* PAGE GAUCHE - Vide */
.page-left-fixed {
    position: relative;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(10,10,10,1) 0%, rgba(15,15,15,1) 90%, rgba(25,25,25,0.98) 98%, rgba(30,30,30,0.95) 100%);
    border-right: 1px solid rgba(212,175,55,0.2);
    box-shadow: inset -15px 0 30px rgba(0,0,0,0.4);
}

.page-left-empty {
    width: 100%;
    height: 100%;
    background: rgba(5,5,5,1);
}

/* HACK: Overlay de contenu positionné en absolu */
.hack-left-content-overlay {
    position: absolute;
    left: 0px;
    top: 0px;
    width: calc(50% - 0px);
    height: calc(100%);
    pointer-events: none;
    z-index: 15;
}

.hack-content-box {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(10,10,10,1) 0%, rgba(15,15,15,1) 90%, rgba(25,25,25,0.98) 98%, rgba(30,30,30,0.95) 100%);
    pointer-events: auto;
}

/* PAGE DROITE - 3D */
.page-right-container {
    position: relative;
    width: 50%;
    height: 100%;
    transform-style: preserve-3d;
}

.turning-page-stack {
    position: relative;
    width: 100%;
    height: 100%;
}

.page-3d {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: left center;
    transform-style: preserve-3d;
    transition: transform 1.2s cubic-bezier(0.645, 0.045, 0.355, 1);
}

.page-3d:nth-child(1) { z-index: 3; }
.page-3d:nth-child(2) { z-index: 2; }
.page-3d:nth-child(3) { z-index: 1; }

.page-3d.page-turned {
    transform: rotateY(-180deg);
}

/* Faces */
.page-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.page-face.front {
    background: linear-gradient(to right, rgba(20,20,20,0.95) 0%, rgba(30,30,30,0.98) 3%, rgba(15,15,15,1) 8%, rgba(10,10,10,1) 100%);
    border-right: 1px solid rgba(212,175,55,0.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.page-face.back {
    transform: rotateY(180deg);
    background: rgba(5,5,5,0.95);
}

/* Content */
.page-inner-content {
    padding: 40px 30px;
    height: 100%;
    overflow-y: auto;
}

.page-inner-content::-webkit-scrollbar {
    width: 6px;
}

.page-inner-content::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

.page-inner-content::-webkit-scrollbar-thumb {
    background: rgba(212,175,55,0.3);
    border-radius: 3px;
}

/* Menu items */
.menu-item-elegant {
    transition: transform 0.3s ease;
}

.menu-item-elegant:hover {
    transform: translateX(3px);
}

/*************************/
/****** Responsive *******/
/*************************/

@media (max-width: 860px) {
    .book-wrapper { height: 700px; }
    .menu-pagination{display:none;}
}

@media (max-width: 768px) {
    .book-wrapper { height: 600px; }
    .page-inner-content { padding: 30px 20px; font-size: 0.9rem; }
}

/* RESPONSIVE */

/* Responsive - Mobile */
@media (max-width: 860px) {
    /* Cache le livre et la pagination desktop */
    .book-wrapper,
    .flex.justify-center.items-center.gap-6,
    .menu-pagination {
        display: none !important;
    }
    
    /* Active le mode mobile */
    .mobile-menu-container {
        display: block !important;
    }
}

@media (min-width: 1024px) {
    .mobile-menu-container {
        display: none !important;
    }
}

/* Style mobile */
.mobile-menu-container {
    max-width: 600px;
    margin: 0 auto;
}

/* Navigation par onglets */
.mobile-tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 40px;
    background: rgba(10, 10, 10, 0.6);
    border-radius: 8px;
    overflow: hidden;
}

.mobile-tab {
    padding: 20px;
    text-align: center;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    background: transparent;
    color: #9ca3af;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.mobile-tab:first-child {
    border-top: none;
}

.mobile-tab:last-child {
    border-bottom: none;
}

.mobile-tab.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.2) 50%, rgba(212, 175, 55, 0.1) 100%);
    color: #d4af37;
    border-top-color: rgba(212, 175, 55, 0.5);
    border-bottom-color: rgba(212, 175, 55, 0.5);
}

.mobile-tab:active {
    transform: scale(0.98);
}

/* Section de contenu */
.mobile-content-section {
    animation: fadeIn 0.4s ease-out;
}

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

.mobile-section-title {
    text-align: center;
    margin-bottom: 30px;
}

/* Menu items */
.mobile-menu-item {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
}

.mobile-menu-item:active {
    transform: scale(0.98);
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(20, 20, 20, 0.9);
}

.mobile-menu-item:last-child {
    margin-bottom: 0;
}

/* Menu spécial (plus grand) */
.mobile-menu-card {
    background: rgba(15, 15, 15, 0.9);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}

.mobile-menu-card:last-child {
    margin-bottom: 0;
}

/* Theme carte vins */
/*************************/
/***** THÈME VINS ********/
/*************************/

/* Thème rouge bordeaux pour la carte des vins */
.theme-wine .book-background {
    background: rgba(25, 15, 10, 0.4); /* Marron foncé */
    box-shadow: 0 10px 40px rgba(40, 20, 10, 0.8);
}

.theme-wine .book-spine {
    background: linear-gradient(to bottom, rgba(139, 69, 19, 0.3), rgba(139, 69, 19, 0.6), rgba(139, 69, 19, 0.3));
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.5);
}

.theme-wine .page-left-fixed {
    background: linear-gradient(to right, rgba(20,10,10,1) 0%, rgba(25,12,10,1) 90%, rgba(30,15,12,0.98) 98%, rgba(35,18,15,0.95) 100%);
    border-right: 1px solid rgba(139, 69, 19, 0.3);
}

.theme-wine .page-left-empty {
    background: rgba(15,8,8,1);
}

.theme-wine .hack-content-box {
    background: linear-gradient(to right, rgba(20,10,10,1) 0%, rgba(25,12,10,1) 90%, rgba(30,15,12,0.98) 98%, rgba(35,18,15,0.95) 100%);
}

.theme-wine .page-face.front {
    background: linear-gradient(to right, rgba(30,15,12,0.95) 0%, rgba(35,18,15,0.98) 3%, rgba(25,12,10,1) 8%, rgba(20,10,10,1) 100%);
    border-right: 1px solid rgba(139, 69, 19, 0.3);
}

.theme-wine .page-face.back {
    background: rgba(15,8,8,0.95);
}

.theme-wine .page-inner-content::-webkit-scrollbar-track {
    background: rgba(20,10,10,0.3);
}

.theme-wine .page-inner-content::-webkit-scrollbar-thumb {
    background: rgba(139, 69, 19, 0.5);
}

.theme-wine .mobile-tabs {
    background: rgba(20, 10, 10, 0.6);
}

.theme-wine .mobile-tab {
    border-top: 1px solid rgba(139, 69, 19, 0.2);
    border-bottom: 1px solid rgba(139, 69, 19, 0.2);
}

.theme-wine .mobile-tab.active {
    background: linear-gradient(90deg, rgba(139, 69, 19, 0.15) 0%, rgba(139, 69, 19, 0.25) 50%, rgba(139, 69, 19, 0.15) 100%);
    color: #d4a574;
    border-top-color: rgba(139, 69, 19, 0.5);
    border-bottom-color: rgba(139, 69, 19, 0.5);
}

.theme-wine .mobile-menu-item {
    background: rgba(25, 12, 10, 0.8);
    border: 1px solid rgba(139, 69, 19, 0.3);
}

.theme-wine .mobile-menu-item:active {
    border-color: rgba(139, 69, 19, 0.6);
    background: rgba(30, 15, 12, 0.9);
}

.theme-wine .mobile-menu-card {
    background: rgba(25, 12, 10, 0.9);
    border: 1px solid rgba(139, 69, 19, 0.4);
}