/* ============================================
   EMBER READ - COMPONENTS
   Boutons, Modals, Menus, Widgets
   ============================================ */

/* Apple iOS Compliance (Guideline 3.1.1) */
.ios-app .hide-on-ios { display: none !important; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #5a0000 100%);
    color: white;
    box-shadow: 0 4px 20px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--primary-glow);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-hover);
}

.btn-secondary:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.btn-checkout {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary) 0%, #5a0000 100%);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.cart-btn {
    position: relative;
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.cart-btn:hover {
    border-color: var(--gold);
    background: var(--gold-dim);
}

.cart-btn svg {
    width: 20px;
    height: 20px;
    color: var(--text-secondary);
}

/* ============ USER WIDGET ============ */
.user-widget { position: relative; }

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    padding: 8px 16px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.user-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.user-btn svg { color: inherit; }

.user-email {
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px;
    min-width: 160px;
    display: none;
    z-index: 200;
}

.user-menu.active { display: block; }

.user-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.user-menu button:hover {
    background: var(--gold-dim);
    color: var(--gold);
}

.user-widget.logged-in .user-btn {
    border-color: var(--gold);
    color: var(--gold);
}

/* ============ MOBILE MENU ============ */
.menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px;
    transition: all 0.3s;
}

.menu-btn:hover {
    border-color: var(--gold);
}

.menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile nav overlay */
.mobile-nav {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10,10,10,0.98);
    backdrop-filter: blur(20px);
    z-index: 99;
    padding: 24px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.mobile-nav.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s;
}

.mobile-nav-link:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
}

.mobile-nav-link:hover svg {
    color: var(--gold);
}

.mobile-nav-socials {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.mobile-nav-socials a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    transition: all 0.3s;
}

.mobile-nav-socials a:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.mobile-nav-socials svg {
    width: 22px;
    height: 22px;
}

/* ============ ANIMATIONS ============ */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

/* ============ COOKIE BANNER ============ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 20px;
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

.cookie-banner.hidden { display: none; }

.cookie-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.cookie-text {
    flex: 1;
    min-width: 280px;
}

.cookie-text h4 {
    color: var(--gold);
    margin-bottom: 8px;
    font-size: 1rem;
}

.cookie-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.cookie-text a { color: var(--gold); }

.cookie-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.cookie-btn {
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.cookie-btn.accept {
    background: linear-gradient(135deg, var(--primary) 0%, #5a0000 100%);
    color: white;
}

.cookie-btn.refuse {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.cookie-btn.settings {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.cookie-btn:hover {
    transform: translateY(-2px);
}

/* Cookie Modal */
.cookie-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.cookie-modal-overlay.hidden { display: none; }

.cookie-modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 500px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.cookie-modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h3 { color: var(--gold); }

.cookie-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
}

.cookie-modal-body { padding: 20px; }

.cookie-category {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.cookie-category:last-child { border-bottom: none; }

.cookie-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.cookie-category-title { font-weight: 600; }
.cookie-category-desc { color: var(--text-secondary); font-size: 0.85rem; }

.cookie-toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.cookie-toggle input { display: none; }

.cookie-toggle-slider {
    position: absolute;
    inset: 0;
    background: #333;
    border-radius: 26px;
    cursor: pointer;
    transition: 0.3s;
}

.cookie-toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.cookie-toggle input:checked + .cookie-toggle-slider { background: var(--gold); }
.cookie-toggle input:checked + .cookie-toggle-slider::before { transform: translateX(24px); }
.cookie-toggle input:disabled + .cookie-toggle-slider { opacity: 0.6; cursor: not-allowed; }

.cookie-modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============ AUTH MODAL ============ */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.auth-modal {
    background: var(--bg-card);
    padding: 32px;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 400px;
    position: relative;
    border: 1px solid var(--border);
}

.auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    cursor: pointer;
}

.auth-close:hover { color: var(--gold); }

.auth-modal h2 {
    color: var(--gold);
    margin-bottom: 8px;
    font-family: 'Cormorant Garamond', serif;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-field { margin-bottom: 16px; }

.auth-field label {
    display: block;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.auth-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 1rem;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--gold);
}

.auth-error {
    color: var(--rose);
    font-size: 0.85rem;
    min-height: 20px;
    margin-bottom: 8px;
}

.auth-submit {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary), #5a0000);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-glow);
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.auth-toggle a {
    color: var(--gold);
    cursor: pointer;
}

.auth-toggle a:hover { text-decoration: underline; }

/* ============ RESPONSIVE COMPONENTS ============ */
@media (max-width: 768px) {
    .menu-btn {
        display: flex;
    }

    .mobile-nav {
        display: block;
    }

    .user-email {
        display: none;
    }

    .user-btn {
        padding: 8px 10px;
    }

    .cart-btn {
        padding: 8px;
    }

    .btn {
        padding: 14px 24px;
        font-size: 0.9rem;
    }
}

@media (max-width: 600px) {
    .cookie-inner {
        flex-direction: column;
        text-align: center;
    }

    .cookie-buttons {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 14px 24px;
        font-size: 0.9rem;
    }
}
