/* Shared client styles: brand tokens, buttons, header, footer.
   All classes use the as- prefix so Bootstrap and style.css cannot clash with them. */
:root {
    --as-ink: #1A1A1A;
    --as-ink-2: #232221;
    --as-sand: #DDD1C2;
    --as-white: #FFFFFF;
    --as-on-dark: rgba(255, 255, 255, .74);
    --as-on-light: #5B544C;
    --as-line-dark: rgba(221, 209, 194, .22);
    --as-line-light: rgba(26, 26, 26, .18);
    /* Hairlines vanish when small: use --as-display at 38px and above only */
    --as-display: 'Italiana', 'Didot', 'Bodoni MT', serif;
    --as-text: 'Montserrat', 'Segoe UI', sans-serif;
    --as-header-h: 76px;
}

.as-page { margin: 0; background: var(--as-ink); color: var(--as-white); font: 400 1rem/1.65 var(--as-text); -webkit-font-smoothing: antialiased; }
.as-page *, .as-page *::before, .as-page *::after { box-sizing: border-box; }
:is(.as-header, .as-drawer, .as-footer, .as-float, .as-toasts, .as-page) [hidden], .as-drawer[hidden] { display: none !important; }
/* Same look on every page, including those that load Bootstrap */
:is(.as-header, .as-drawer, .as-footer, .as-tabs, .as-float, .as-toasts, .as-skip) { font-family: var(--as-text); line-height: 1.65; }
:is(.as-header, .as-drawer, .as-footer, .as-tabs), :is(.as-header, .as-drawer, .as-footer, .as-tabs) *, .as-float { box-sizing: border-box; }
:is(.as-header, .as-drawer, .as-footer, .as-tabs) :is(a, a:hover), a.as-float, a.as-float:hover { text-decoration: none; }
:is(.as-header, .as-drawer, .as-footer) :is(button, input) { margin: 0; letter-spacing: normal; text-transform: none; }
:is(.as-header, .as-drawer, .as-footer, .as-tabs, .as-float):focus-visible, :is(.as-header, .as-drawer, .as-footer, .as-tabs) :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.as-page img { max-width: 100%; }
.as-page :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.as-page a { text-decoration: none; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }

.as-wrap { width: 100%; max-width: 1360px; margin-inline: auto; padding-inline: clamp(20px, 4vw, 48px); }
.as-skip { position: absolute; left: 16px; top: -60px; z-index: 300; padding: 12px 18px; background: var(--as-sand); color: var(--as-ink); }
.as-skip:focus { top: 12px; }

/* Buttons and links */
.as-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 30px; border: 1px solid var(--as-sand); background: var(--as-sand); color: var(--as-ink) !important; font: 600 .9375rem/1.2 var(--as-text); text-align: center; cursor: pointer; transition: background-color .2s, border-color .2s, color .2s; }
.as-btn:hover { background: var(--as-white); border-color: var(--as-white); }
.as-btn--sm { min-height: 44px; padding: 0 20px; font-size: .875rem; white-space: nowrap; }
.as-btn--block { width: 100%; }
.as-btn--line { background: transparent; border-color: rgba(221, 209, 194, .5); color: var(--as-white) !important; }
.as-btn--line:hover { background: var(--as-white); color: var(--as-ink) !important; }
.as-btn--ink { background: var(--as-ink); border-color: var(--as-ink); color: var(--as-white) !important; }
.as-btn--ink:hover { background: #3a3632; border-color: #3a3632; }
.as-link { padding-block: 6px; color: inherit; font-weight: 600; font-size: .9375rem; border-bottom: 1px solid currentColor; white-space: nowrap; }
.as-link:hover { color: inherit; opacity: .7; }

/* Header */
.as-header { position: sticky; top: 0; z-index: 110; width: 100%; background: var(--as-ink); border-bottom: 1px solid var(--as-line-dark); }
.as-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--as-header-h); }
.as-logo { flex: none; line-height: 0; }
.as-logo img { width: 156px; height: auto; }
.as-nav ul, .as-drawer ul { list-style: none; margin: 0; padding: 0; }
.as-nav > ul { display: flex; gap: clamp(2px, .8vw, 14px); }
.as-nav > ul > li { position: relative; margin: 0; }
.as-nav > ul > li > a, .as-nav > ul > li > button { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px; border: 0; background: none; color: var(--as-white); font: 500 .9375rem/1 var(--as-text); cursor: pointer; }
.as-nav > ul > li > a:hover, .as-nav button:hover, .as-nav .is-active { color: var(--as-sand) !important; }
.as-nav .is-active { box-shadow: inset 0 -1px 0 var(--as-sand); }
.as-nav button i { font-size: .625rem; transition: transform .2s; }
.as-nav button[aria-expanded="true"] i { transform: rotate(180deg); }

.as-nav .as-menu, .as-menu { position: absolute; top: 100%; left: 0; min-width: 220px; margin: 0; padding: 10px 0; background: var(--as-ink-2); border: 1px solid var(--as-line-dark); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s, transform .18s, visibility .18s; }
.as-header .is-open > .as-menu { opacity: 1; visibility: visible; transform: none; }
.as-menu.as-menu--right { left: auto; right: 0; min-width: 250px; }
.as-menu a { display: flex; justify-content: space-between; gap: 16px; padding: 11px 20px; color: var(--as-white); font-size: .9375rem; line-height: 1.4; }
.as-menu a:hover, .as-menu a:focus-visible { background: rgba(221, 209, 194, .1); color: var(--as-sand); }
.as-menu em, .as-drawer em { font-style: normal; color: var(--as-sand); }
.as-menu__who { padding: 8px 20px 14px; margin-bottom: 8px; border-bottom: 1px solid var(--as-line-dark); }
.as-menu__who strong, .as-menu__who span { display: block; overflow-wrap: anywhere; }
.as-menu__who span { font-size: .8125rem; color: var(--as-on-dark); }

.as-tools { display: flex; align-items: center; gap: 4px; }
.as-tools .as-btn { margin-left: 12px; }
.as-account { position: relative; }
.as-iconbtn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--as-white); font-size: 1.0625rem; cursor: pointer; }
.as-iconbtn:hover { color: var(--as-sand); }
.as-badge { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--as-sand); color: var(--as-ink); font: 700 .6875rem/18px var(--as-text); text-align: center; }
.as-iconbtn.as-burger { display: none; flex-direction: column; gap: 8px; margin-left: -10px; }
.as-burger span { width: 24px; height: 2px; background: currentColor; }

/* Search */
.as-search { position: absolute; top: 100%; left: 0; right: 0; background: var(--as-ink-2); border-bottom: 1px solid var(--as-line-dark); max-height: calc(100vh - var(--as-header-h)); overflow-y: auto; }
.as-search__form { display: flex; align-items: center; gap: 14px; height: 76px; margin: 0; border-bottom: 1px solid var(--as-line-dark); }
.as-search__form:focus-within { border-color: var(--as-sand); }
.as-search__form input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0 !important; background: none; color: var(--as-white); font: 400 1.125rem/1 var(--as-text); }
.as-search__form input::placeholder { color: rgba(255, 255, 255, .6); }
.as-search__form input::-webkit-search-cancel-button { display: none; }
.as-search__results:not(:empty) { padding-block: 20px 32px; }
.as-search__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px 32px; margin: 0 0 18px; padding: 0; list-style: none; }
.as-search__list a { display: flex; gap: 16px; align-items: center; color: var(--as-white); }
.as-search__list a:hover { color: var(--as-sand); }
.as-search__list img { flex: none; width: 72px; height: 72px; object-fit: cover; background: #fff; }
.as-search__list span { display: block; min-width: 0; font-size: .9375rem; line-height: 1.4; }
.as-search__list small { display: block; font-size: .8125rem; color: var(--as-on-dark); }
.as-search__results p { margin: 0; color: var(--as-on-dark); }

/* Mobile drawer */
.as-drawer { position: fixed; inset: 0; z-index: 1200; background: rgba(0, 0, 0, .6); }
.as-drawer__panel { position: relative; width: min(400px, 88vw); height: 100%; padding: 20px 24px 28px; overflow-y: auto; background: var(--as-ink); border-right: 1px solid var(--as-line-dark); animation: as-slide .25s ease-out; }
@keyframes as-slide { from { transform: translateX(-24px); opacity: 0; } }
.as-drawer__close { position: absolute; top: 14px; right: 14px; }
.as-drawer nav { margin-top: 40px; }
.as-drawer nav > ul > li { border-bottom: 1px solid var(--as-line-dark); }
.as-drawer nav > ul > li > a, .as-drawer summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; color: var(--as-white); font: 500 1.1875rem/1.3 var(--as-text); list-style: none; cursor: pointer; }
.as-drawer summary::-webkit-details-marker { display: none; }
.as-drawer summary i { font-size: .75rem; transition: transform .2s; }
.as-drawer details[open] summary i { transform: rotate(180deg); }
.as-drawer .is-active { color: var(--as-sand) !important; }
.as-drawer details ul { padding-bottom: 12px; }
.as-drawer details a, .as-drawer__account a { display: flex; justify-content: space-between; padding: 11px 0; color: var(--as-on-dark); }
.as-drawer__account { padding: 18px 0 22px; }

/* Footer */
.as-footer { background: #121212; color: var(--as-on-dark); font-size: .9375rem; }
.as-footer__grid { display: grid; grid-template-columns: 1.7fr 1fr 1fr 1.3fr; gap: 48px; padding-block: 72px 56px; }
.as-footer__brand p { max-width: 30ch; margin: 22px 0; }
.as-footer h2 { margin: 0 0 14px; font: 600 1rem/1.4 var(--as-text); color: var(--as-white); }
.as-footer ul { list-style: none; margin: 0; padding: 0; }
.as-footer li { padding-block: 5px; overflow-wrap: anywhere; }
.as-footer a { color: inherit; }
.as-footer ul a:hover { color: var(--as-sand); }
.as-social { display: flex; gap: 10px; }
.as-social a { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--as-line-dark); color: var(--as-white); font-size: 1.0625rem; }
.as-social a:hover { background: var(--as-sand); color: var(--as-ink); }
.as-footer__end { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; padding-bottom: 28px; font-size: .8125rem; }
.as-footer__end::before { content: ""; flex: 0 0 100%; height: 1px; margin-bottom: 14px; background: var(--as-line-dark); }
.as-footer__end p { margin: 0; }
.as-footer .as-footer__end a { color: var(--as-sand); text-decoration: underline; text-underline-offset: 3px; }

/* Floating buttons and toasts */
.as-float { position: fixed; bottom: 24px; z-index: 105; display: grid; place-items: center; width: 54px; height: 54px; padding: 0; border: 0; border-radius: 50%; font-size: 1.5rem; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 0, 0, .28); }
.as-float--wa { right: 24px; background: #25D366; color: #fff !important; font-size: 1.75rem; }
.as-float--top { right: 24px; bottom: 90px; background: var(--as-sand); color: var(--as-ink); font-size: 1rem; opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
.as-float--top.is-visible { opacity: 1; visibility: visible; }
.as-toasts { position: fixed; top: 92px; right: 20px; z-index: 1300; display: grid; gap: 10px; }
.as-toast { max-width: min(340px, calc(100vw - 40px)); padding: 14px 20px; background: var(--as-white); color: var(--as-ink); font-size: .9375rem; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.as-toast.is-error { background: #9B2C2C; color: #fff; }

@media (max-width: 1179px) {
    .as-iconbtn.as-burger { display: inline-flex; }
    .as-nav, .as-header .as-desktop { display: none !important; }
    .as-header__bar { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; }
    .as-tools { justify-content: flex-end; margin-right: -10px; }
}
@media (max-width: 860px) {
    .as-footer__grid { grid-template-columns: 1fr 1fr; gap: 40px 24px; }
    .as-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    :root { --as-header-h: 66px; }
    .as-logo img { width: 132px; }
    .as-footer__grid { padding-block: 52px 40px; }
}
/* Phone tab bar */
.as-tabs { display: none; }
@media (max-width: 860px) {
    .as-page--tabs { --as-tabs-h: calc(62px + env(safe-area-inset-bottom, 0px)); }
    .as-tabs { position: fixed; inset: auto 0 0; z-index: 108; display: grid; grid-template-columns: repeat(5, 1fr); height: var(--as-tabs-h); padding-bottom: env(safe-area-inset-bottom, 0px); background: var(--as-ink); border-top: 1px solid var(--as-line-dark); }
    .as-tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-width: 0; color: var(--as-on-dark); font: 500 .75rem/1 var(--as-text); }
    .as-tabs i { font-size: 1.125rem; }
    .as-tabs .is-active { color: var(--as-sand); }
    .as-tabs .as-tabs__book { background: var(--as-sand); color: var(--as-ink); font-weight: 600; }
    .as-page--tabs { padding-bottom: var(--as-tabs-h); }
    .as-footer__end { padding-bottom: 28px; }
    .as-float { width: 48px; height: 48px; right: 14px; bottom: calc(var(--as-tabs-h, 0px) + 14px); }
    .as-page--tabs .as-float--wa { opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }
    .as-page--tabs .as-float--wa.is-visible { opacity: 1; visibility: visible; }
    .as-footer__grid > :last-child { grid-column: 1 / -1; }
    .as-float--top { bottom: calc(var(--as-tabs-h, 0px) + 72px); }
    /* Sideways swipe rows */
    .as-swipe { display: flex !important; gap: 12px !important; margin-inline: calc(clamp(20px, 4vw, 48px) * -1) !important; padding-inline: clamp(20px, 4vw, 48px) !important; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: clamp(20px, 4vw, 48px); scrollbar-width: none; overscroll-behavior-x: contain; }
    .as-swipe::-webkit-scrollbar { display: none; }
    .as-swipe > * { flex: 0 0 auto; scroll-snap-align: start; }
}
@media (hover: none) { .as-btn:active, .as-tabs a:active, .as-iconbtn:active { opacity: .75; } }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .as-page *, .as-page *::before, .as-header *, .as-drawer * { animation: none !important; transition: none !important; }
}
