/* Announcement bar, header, mega menu, mobile menu */

/* ------------------------------------------------------------ header --- */
.announce { background: var(--ink); color: #f3ebe0; text-align: center; font-size: .8rem; padding: 9px 16px; letter-spacing: .03em; }
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(250, 247, 242, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.hdr { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { font-family: var(--serif); font-size: 2rem; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.logo img { max-height: 44px; width: auto; }
.logo { display: inline-flex; align-items: center; gap: .32em; }
.logo-mark { width: .92em; height: 1.15em; flex: none; color: var(--ink); }
.logo-mark.logo-book { width: 1.45em; height: 1.1em; }
.foot-logo .logo-mark { color: #f3e6d6; }
.nav { display: flex; align-items: center; gap: 4px; flex: 1; justify-content: center; height: 100%; }
.nav-link { display: flex; align-items: center; height: 100%; padding: 0 14px; font-weight: 500; font-size: .93rem; position: relative; }
.nav-link::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 18px; height: 1.5px; background: currentColor; transform: scaleX(0); transition: transform .25s; }
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }
.nav-link.sale { color: var(--sale); }
.nav-item { height: 100%; }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: .2s; }
.has-mega:hover .mega, .has-mega:focus-within .mega { opacity: 1; visibility: visible; transform: none; }
/* after a menu click: stay closed until the mouse leaves (desktop only; the mobile menu lists links inline) */
@media (min-width: 961px) { .has-mega.closed .mega { opacity: 0; visibility: hidden; transform: translateY(-6px); pointer-events: none; } }
.mega-in { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; gap: 32px; padding-top: 32px; padding-bottom: 36px; }
.mega-col a { display: block; padding: 5px 0; font-size: .93rem; }
.mega-col a:hover { color: var(--accent); }
.mega-feature { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16/10; }
.mega-feature img { width: 100%; height: 100%; object-fit: cover; }
.mega-feature span { position: absolute; left: 16px; bottom: 14px; color: #fff; font-family: var(--serif); font-size: 1.5rem; font-weight: 600; text-shadow: 0 2px 12px rgba(0, 0, 0, .4); }
.hdr-actions { display: flex; gap: 4px; margin-left: auto; }
.count { position: absolute; top: 4px; right: 2px; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 600; min-width: 18px; height: 18px; border-radius: 9px; display: grid; place-items: center; padding: 0 4px; }
.count[hidden] { display: none; }
.search-bar { border-top: 1px solid var(--line); padding: 14px 0; background: var(--bg); }
.search-bar .wrap { display: flex; gap: 10px; }
.search-bar input { flex: 1; padding: 12px 16px; border: 1px solid var(--line); border-radius: 999px; background: #fff; min-width: 0; }
.nav-m-head { display: none; }

@media (max-width: 960px) {
  /* backdrop-filter would trap the fixed menu inside the header; raise the header above the overlay while the menu is open */
  .site-header { backdrop-filter: none; background: var(--bg); }
  body.menu-open .site-header { z-index: 75; }
  .hdr { gap: 8px; height: 62px; }
  .logo { font-size: 1.7rem; }
  .hdr > .logo { min-width: 0; }
  .nav { position: fixed; inset: 0 auto 0 0; width: min(86vw, 360px); background: var(--bg); flex-direction: column; align-items: stretch; justify-content: flex-start; padding: 0 0 24px; gap: 0; transform: translateX(-100%); transition: transform .3s; z-index: 70; overflow-y: auto; height: 100dvh; }
  .nav.open { transform: none; }
  .nav-m-head { display: flex !important; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
  .nav-link { height: auto; padding: 14px 20px; border-bottom: 1px solid var(--line); gap: 10px; }
  .nav-link .ic { width: 18px; height: 18px; color: var(--accent); }
  .nav-link::after { display: none; }
  .nav-item { height: auto; }
  .mega { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; }
  .mega-in { grid-template-columns: 1fr; gap: 18px; padding: 14px 20px 18px; }
  .mega-feature { display: none; }
}
/* small phones: keep the brand name on one line */
@media (max-width: 480px) {
  .hdr > .logo { font-size: clamp(.9rem, 3.9vw, 1.4rem); white-space: nowrap; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }
  .hdr { gap: 2px; }
  .hdr-actions { gap: 0; }
  .hdr-actions .icon-btn, .hdr > .icon-btn { width: 34px; height: 38px; }
  .hdr-actions .ic, .hdr > .icon-btn .ic { width: 19px; height: 19px; }
  .count { right: -2px; }
}
