/**
 * Phase 1 — Global chrome: mega navigation (desktop), full-height drawer (mobile),
 * quick links row, drawer polish. Uses theme-almart-tokens.css variables.
 */

/* ----- Desktop mega strip ----- */
.almart-header__mega-shell {
    position: relative;
    z-index: var(--almart-z-dropdown);
    background: var(--almart-color-surface);
    border-bottom: 1px solid var(--almart-color-border-subtle);
    box-shadow: var(--almart-shadow-pill);
}

.almart-header__mega-row {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--almart-space-4);
    min-height: 52px;
}

.almart-mega-nav {
    position: relative;
    flex: 1;
    min-width: 0;
}

.almart-mega-nav__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.almart-mega-nav__item {
    position: static;
}

.almart-mega-nav__trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.8rem 0.95rem;
    font-family: var(--almart-font-heading);
    font-size: var(--almart-type-nav-size);
    font-weight: var(--almart-font-weight-semibold);
    color: var(--almart-color-text);
    text-decoration: none;
    border: none;
    background: transparent;
    white-space: nowrap;
    transition: color var(--almart-duration-base) var(--almart-easing-standard),
        background-color var(--almart-duration-base) var(--almart-easing-standard);
}

.almart-mega-nav__item--static .almart-mega-nav__trigger {
    padding-left: 0.35rem;
}

.almart-mega-nav__chev {
    font-size: 0.65rem;
    opacity: 0.55;
    transition: transform var(--almart-duration-base) var(--almart-easing-standard);
}

.almart-mega-nav__item:hover .almart-mega-nav__chev,
.almart-mega-nav__item:focus-within .almart-mega-nav__chev {
    transform: rotate(180deg);
}

.almart-mega-nav__trigger:hover,
.almart-mega-nav__trigger:focus {
    color: var(--bs-primary);
    outline: none;
}

.almart-mega-nav__panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: 3;
    background: var(--almart-color-surface);
    border-top: 1px solid var(--almart-color-border);
    box-shadow: var(--almart-shadow-card-hover);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(6px);
    transition: opacity var(--almart-duration-base) var(--almart-easing-out),
        visibility var(--almart-duration-base),
        transform var(--almart-duration-base) var(--almart-easing-out);
}

.almart-mega-nav__item:hover .almart-mega-nav__panel,
.almart-mega-nav__item:focus-within .almart-mega-nav__panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    z-index: 20;
}

.almart-mega-nav__item--static .almart-mega-nav__panel {
    display: none;
}

.almart-mega-nav__lead {
    font-family: var(--almart-font-heading);
    font-size: var(--almart-type-h3-size);
    font-weight: var(--almart-font-weight-bold);
    color: var(--almart-color-text);
    margin: 0;
}

.almart-mega-nav__link {
    display: inline;
    font-weight: var(--almart-font-weight-medium);
    color: var(--almart-color-text);
    text-decoration: none;
}

.almart-mega-nav__link:hover {
    color: var(--bs-primary);
    text-decoration: underline;
}

.almart-header__quicklinks {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: var(--almart-space-2) var(--almart-space-4);
    padding: 0.35rem 0;
    flex-shrink: 0;
}

.almart-header__quicklinks a {
    font-size: var(--almart-type-small-size);
    font-weight: var(--almart-font-weight-semibold);
    color: var(--almart-color-text-muted);
    text-decoration: none;
    white-space: nowrap;
}

.almart-header__quicklinks a:hover,
.almart-header__quicklinks a:focus {
    color: var(--bs-primary);
}

.almart-header__quicklinks a.is-active {
    color: var(--bs-primary);
}

/* ----- Mobile top bar (light — matches desktop chrome, no blue band) ----- */
.almart-header__mobile-top {
    background: var(--almart-color-surface);
    border-bottom: 1px solid var(--almart-color-border-subtle);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.almart-header__menu-btn {
    border-width: 1px !important;
    padding: 0.35rem 0.55rem;
    line-height: 1;
    color: var(--almart-color-text);
}

.almart-header__menu-btn:hover {
    background: var(--almart-color-surface-muted);
    color: var(--bs-primary);
    border-color: var(--almart-color-border-strong) !important;
}

.almart-header__mobile-logo .brand-logo-img {
    height: 40px;
}

.almart-icon-btn--on-dark {
    border-color: rgba(255, 255, 255, 0.35) !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
}

.almart-icon-btn--on-dark:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.55) !important;
    color: #fff !important;
}

/* ----- Full-screen mobile drawer ----- */
.almart-drawer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
    transition: opacity var(--almart-duration-base) var(--almart-easing-out),
        visibility var(--almart-duration-base);
}

.almart-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
}

.almart-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(2px);
}

.almart-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(100vw - 48px, 400px);
    max-width: 100%;
    background: var(--almart-color-surface);
    box-shadow: var(--almart-shadow-card-hover);
    transform: translateX(-102%);
    transition: transform var(--almart-duration-slow) var(--almart-easing-out);
    display: flex;
    flex-direction: column;
}

.almart-drawer.is-open .almart-drawer__panel {
    transform: translateX(0);
}

.almart-drawer__head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--almart-space-4) var(--almart-space-4);
    border-bottom: 1px solid var(--almart-color-border);
}

.almart-drawer__title {
    font-family: var(--almart-font-heading);
    font-size: var(--almart-type-h3-size);
    font-weight: var(--almart-font-weight-bold);
    color: var(--almart-color-text);
}

.almart-drawer__body {
    flex: 1;
    overflow-y: auto;
    padding: var(--almart-space-4);
    -webkit-overflow-scrolling: touch;
}

.almart-drawer__section-title {
    font-family: var(--almart-font-heading);
    font-size: var(--almart-type-small-size);
    font-weight: var(--almart-font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--almart-color-text-muted);
    margin: var(--almart-space-6) 0 var(--almart-space-3);
}

.almart-drawer__nav {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.almart-drawer__nav a {
    display: block;
    padding: 0.55rem 0.35rem;
    font-weight: var(--almart-font-weight-semibold);
    color: var(--almart-color-text);
    text-decoration: none;
    border-radius: var(--almart-radius-sm);
}

.almart-drawer__nav a:hover,
.almart-drawer__nav a:focus {
    background: var(--almart-color-surface-tint);
    color: var(--bs-primary);
}

.almart-drawer__nav a.is-active {
    color: var(--bs-primary);
}

.almart-drawer-accordion .accordion-button {
    font-size: var(--almart-type-small-size);
    font-weight: var(--almart-font-weight-semibold);
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.almart-drawer-accordion .accordion-button:not(.collapsed) {
    color: var(--bs-primary);
    background: var(--almart-color-surface-tint);
    box-shadow: none;
}

.almart-drawer-accordion__item {
    border-color: var(--almart-color-border) !important;
}

body.almart-drawer-open {
    overflow: hidden;
}

/* ----- Footer (dense columns; light surface like header) ----- */
.almart-footer-chrome .almart-footer-heading {
    font-family: var(--almart-font-heading);
    font-size: var(--almart-type-small-size);
    font-weight: var(--almart-font-weight-bold);
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--bs-primary);
    margin-bottom: var(--almart-space-4);
}

.almart-footer-chrome a {
    color: var(--almart-color-text-muted);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0;
    font-size: var(--almart-type-small-size);
    transition: color var(--almart-duration-base) var(--almart-easing-standard);
}

.almart-footer-chrome a:hover {
    color: var(--bs-primary);
}

.almart-copyright-bar a {
    color: var(--almart-color-text);
    text-decoration: none;
    border-bottom-color: var(--almart-color-border-strong) !important;
}

.almart-copyright-bar a:hover {
    color: var(--bs-primary);
}
