/* ═══════════════════════════════════════════════════════════════════════════
   DigitiseMyBooks — Shared nav: hamburger + mobile menu
   Loaded alongside each page template's own CSS.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Hamburger button (hidden on desktop) ───────────────────────────────────── */
.p-nav__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px 2px;
    flex-shrink: 0;
}
.p-nav__hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #1a1a18;
    border-radius: 2px;
    transition: transform 0.22s ease, opacity 0.22s ease;
    transform-origin: center;
}

/* Animate three lines → X when open */
.p-nav.nav-is-open .p-nav__hamburger span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.p-nav.nav-is-open .p-nav__hamburger span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.p-nav.nav-is-open .p-nav__hamburger span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile dropdown (inside sticky nav, absolutely positioned below it) ─────── */
.p-nav__mobile {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fdfaf2;
    border-bottom: 1.5px solid #e8e3d8;
    z-index: 1;
}
.p-nav.nav-is-open .p-nav__mobile {
    display: block;
}
.p-nav__mobile ul {
    list-style: none;
    margin: 0;
    padding: 0 48px;
}
.p-nav__mobile ul li a {
    display: block;
    padding: 13px 0;
    font-size: 15px;
    font-family: 'Space Grotesk', sans-serif;
    color: #1a1a18;
    border-bottom: 1px solid #e8e3d8;
    text-decoration: none;
    transition: color 0.15s;
}
.p-nav__mobile ul li:last-child a {
    border-bottom: none;
}
.p-nav__mobile ul li a:hover,
.p-nav__mobile ul li a.active {
    color: #b5451b;
}
.p-nav__mobile-shop {
    font-weight: 500;
    color: #b5451b !important;
}

/* ── Breakpoints ─────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .p-nav__hamburger { display: flex; }
    .p-nav__login     { display: none; }
}
@media (max-width: 600px) {
    .p-nav__mobile ul        { padding: 0 20px; }
    .p-nav__actions          { gap: 6px !important; }
    .p-nav__shop-btn .p-icon { display: none; }
    .p-nav__shop-btn         { padding: 9px 14px !important; }
}
