/* ============================================
   EMBER READ - LAYOUT
   Header, Footer, Sidebar, Ambient Background
   ============================================ */

/* ============ AMBIENT BACKGROUND ============ */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.ambient-orb.gold {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

.ambient-orb.primary {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    bottom: 10%;
    left: -150px;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

/* Noise texture */
.noise {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ============ HEADER ============ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 0 24px;
    background: rgba(10,10,10,0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    height: 70px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logo-ember { color: var(--text); }
.logo-read { color: var(--gold); }

.nav {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--gold);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.social-link {
    color: var(--text-muted);
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.social-link:hover {
    color: var(--gold);
    transform: scale(1.1);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

/* ============ CART SIDEBAR ============ */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    max-width: 100vw;
    height: 100vh;
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.cart-sidebar.active { right: 0; }

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.cart-header h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
}

.cart-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.cart-close:hover { color: var(--gold); }

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.cart-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.cart-item img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info { flex: 1; }
.cart-item-title { font-size: 0.9rem; margin-bottom: 4px; }
.cart-item-price { color: var(--gold); font-weight: 600; }

.cart-item-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-item-remove:hover { color: var(--rose); }

.cart-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.cart-total span:last-child { color: var(--gold); }

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.cart-count {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ FOOTER ============ */
.footer {
    padding: 50px 24px 24px;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 8px;
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--gold);
}

.footer-bottom {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ============ RESPONSIVE LAYOUT ============ */
@media (max-width: 992px) {
    .ambient-orb.gold {
        width: 400px;
        height: 400px;
        top: -100px;
        right: -100px;
    }

    .ambient-orb.primary {
        width: 350px;
        height: 350px;
        bottom: 5%;
        left: -100px;
    }
}

@media (max-width: 768px) {
    .ambient-orb.gold {
        width: 250px;
        height: 250px;
        top: -50px;
        right: -80px;
        opacity: 0.3;
    }

    .ambient-orb.primary {
        width: 200px;
        height: 200px;
        bottom: auto;
        top: 50%;
        left: -80px;
        opacity: 0.25;
    }

    .nav {
        display: none;
    }

    .social-link {
        display: none;
    }

    .header {
        padding: 0 16px;
    }

    .header-actions {
        gap: 8px;
    }

    .logo {
        font-size: 1.3rem;
    }

    .footer {
        padding: 40px 16px 24px;
    }

    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }

    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 480px) {
    .ambient-orb.gold {
        width: 180px;
        height: 180px;
        top: -40px;
        right: -60px;
        opacity: 0.2;
    }

    .ambient-orb.primary {
        width: 150px;
        height: 150px;
        left: -60px;
        opacity: 0.15;
    }
}
