﻿/* =====================================================
   LAYOUT.CSS – BookStore Navbar + Footer
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Playfair+Display:wght@700;800&display=swap');

:root {
    --primary: #ff6b35;
    --primary-d: #e8521c;
    --accent: #ffd166;
    --text: #1e1a14;
    --muted: #7a6f62;
    --surface: #ffffff;
    --bg: #f7f4ef;
    --border: #e8e2d9;
    --nav-bg: #1a1510;
    --nav-h: 68px;
}

/* ── Reset ───────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg);
    color: var(--text);
    margin: 0;
}

/* ── Navbar ─────────────────────── */
.main-navbar {
    background: var(--nav-bg);
    height: var(--nav-h);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0,0,0,.25);
    border-bottom: 2px solid rgba(255,107,53,.25);
}

/* ── Logo ───────────────────────── */
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--primary), var(--primary-d));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 3px 10px rgba(255,107,53,.4);
}

.nav-brand-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
}

    .nav-brand-text em {
        display: block;
        font-size: .6rem;
        color: var(--accent);
        letter-spacing: 1.5px;
        text-transform: uppercase;
    }

/* ── Nav links ──────────────────── */
.main-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .main-nav-links a {
        padding: 8px 14px;
        color: rgba(255,255,255,.7);
        font-size: .88rem;
        font-weight: 700;
        text-decoration: none;
        border-radius: 8px;
        transition: .2s;
    }

        .main-nav-links a:hover,
        .main-nav-links a.active {
            background: rgba(255,255,255,.08);
            color: #fff;
        }

/* ── Search bar ─────────────────── */
.nav-search {
    display: flex;
    align-items: center;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    padding: 0 6px 0 16px;
    transition: .2s;
    width: 220px;
}

    .nav-search:focus-within {
        background: rgba(255,255,255,.13);
        border-color: rgba(255,107,53,.5);
        box-shadow: 0 0 0 3px rgba(255,107,53,.12);
        width: 260px;
    }

    .nav-search input {
        background: transparent;
        border: none;
        outline: none;
        color: #fff;
        font-size: .85rem;
        width: 100%;
        padding: 8px 0;
    }

        .nav-search input::placeholder {
            color: rgba(255,255,255,.35);
        }

    .nav-search button {
        background: var(--primary);
        border: none;
        border-radius: 999px;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        cursor: pointer;
        flex-shrink: 0;
        transition: .2s;
    }

        .nav-search button:hover {
            background: var(--primary-d);
        }

/* ── Nav icons ───────────────────── */
.nav-icons {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.7);
    text-decoration: none;
    transition: .2s;
    position: relative;
}

    .nav-icon-btn:hover {
        background: rgba(255,255,255,.08);
        color: #fff;
    }

/* ── Cart badge ─────────────────── */
.cart-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: var(--primary);
    color: #fff;
    font-size: .6rem;
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

/* ── Footer ──────────────────────── */
.main-footer {
    background: #1a1510;
    color: rgba(255,255,255,.75);
    padding: 56px 0 0;
    margin-top: 80px;
    border-top: 3px solid rgba(255,107,53,.3);
}

.footer-heading {
    font-size: .8rem;
    font-weight: 800;
    color: rgba(255,255,255,.35);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 10px;
    }

    .footer-links a {
        color: rgba(255,255,255,.55);
        text-decoration: none;
        font-size: .875rem;
        font-weight: 600;
        transition: color .2s;
    }

        .footer-links a:hover {
            color: var(--accent);
        }

/* ── Footer bottom bar ──────────── */
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.07);
    padding: 18px 0;
    margin-top: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-copy {
    font-size: .8rem;
    color: rgba(255,255,255,.3);
}

/* ── Toast ───────────────────────── */
.toast-custom {
    border-radius: 12px;
    border: none;
    box-shadow: 0 8px 28px rgba(0,0,0,.18);
    font-weight: 700;
}

/* ── Responsive ──────────────────── */
@media (max-width: 991px) {
    .nav-search,
    .nav-search:focus-within {
        width: 100%;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
/* ── Mobile Toggler ─────────────── */
.nav-toggler {
    display: none;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    cursor: pointer;
    transition: .2s;
    flex-shrink: 0;
}

    .nav-toggler:hover {
        background: rgba(255,255,255,0.14);
        color: #fff;
    }

/* ── Nav collapse (mobile) ──────── */
.nav-collapse {
    display: none;
}

    .nav-collapse.open {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        padding: 16px 0 12px;
        width: 100%;
    }

/* ── Responsive ──────────────────── */
@media (max-width: 991px) {
    /* hiện nút hamburger */
    .nav-toggler {
        display: flex;
    }

    /* navbar cho phép wrap xuống dòng */
    .main-navbar {
        height: auto;
        padding: 0 0 0;
    }

        .main-navbar .container {
            flex-wrap: wrap;
            padding-top: 14px;
            padding-bottom: 14px;
            align-items: center;
        }

    /* nav links xếp dọc */
    .nav-collapse .main-nav-links {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
        width: 100%;
    }

        .nav-collapse .main-nav-links a {
            width: 100%;
            padding: 10px 14px;
            border-radius: 8px;
        }

    /* search full width */
    .nav-search,
    .nav-search:focus-within {
        width: 100%;
    }

    /* icons căn giữa */
    .nav-icons {
        width: 100%;
        justify-content: flex-end;
        padding-bottom: 4px;
    }

    #searchResult {
        width: calc(100vw - 32px) !important;
        left: 16px !important;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* desktop: luôn hiện nav-collapse */
@media (min-width: 992px) {
    .nav-collapse {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        flex: 1;
    }
}

/* ========== USER DROPDOWN ========== */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 240px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.02);
    padding: 8px 0;
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown.open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
}

.nav-dropdown-header {
    padding: 8px 16px;
    border-bottom: 1px solid #eef2f6;
    margin-bottom: 4px;
}

    .nav-dropdown-header strong {
        display: block;
        font-size: 0.9rem;
        color: #1e293b;
    }

    .nav-dropdown-header span {
        font-size: 0.7rem;
        color: #6c86a3;
        background: #f1f5f9;
        padding: 2px 8px;
        border-radius: 30px;
        display: inline-block;
        margin-top: 4px;
    }

.nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: #334155;
    font-size: 0.9rem;
    transition: background 0.2s;
    text-decoration: none;
}

    .nav-dropdown-item i {
        width: 20px;
        font-size: 1rem;
        color: #5b6e8c;
    }

    .nav-dropdown-item:hover {
        background: #f8fafc;
        color: #0f172a;
    }

    .nav-dropdown-item.danger {
        color: #e53e3e;
    }

        .nav-dropdown-item.danger i {
            color: #e53e3e;
        }

.nav-dropdown-divider {
    margin: 6px 0;
    border-color: #eef2f6;
}