/* ============================================
   Header Styles
   ============================================ */

/* Default: dark solid header in normal document flow, used on every page
   except the home (which has a dark hero to float over). This is what
   keeps page content from rendering underneath the header. Reuses the
   same dark bg/text theme_mods as the home's scrolled state, so both
   are driven by one customizer setting. */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1.25rem 0;
    background-color: var(--minao-header-scrolled-bg, #1A1A1A);
    color: var(--minao-header-scrolled-text, #FFFFFF);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s ease;
}

/* Home only: float transparent over the hero image, light text until
   scrolled (JS toggles .header--scrolled, see header--scrolled below). */
.site-header--transparent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    color: var(--color-bg-primary);
    border-bottom-color: transparent;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

/* Site Branding / Logo */
.site-branding {
    flex-shrink: 0;
}

.site-branding a {
    font-family: var(--font-primary);
    font-size: 2rem;
    font-weight: 600;
    color: inherit;
    text-decoration: none;
    line-height: 1;
    display: inline-block;
}

.site-branding img {
    display: block;
    max-height: 40px;
    width: auto;
}

/* Main Navigation */
.main-navigation .nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.main-navigation .nav-menu a {
    font-family: var(--font-primary);
    font-size: 1rem;
    letter-spacing: 0.3px;
    color: inherit;
    text-decoration: none;
    position: relative;
    padding: 0.25rem 0;
    display: inline-block;
}

.main-navigation .nav-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width 0.3s ease;
}

.main-navigation .nav-menu a:hover::after,
.main-navigation .nav-menu a:focus::after {
    width: 100%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: inherit;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.3s ease;
}

.header-action:hover,
.header-action:focus {
    opacity: 0.7;
}

.header-action svg {
    width: 20px;
    height: 20px;
}

/* Cart & Wishlist Count Badges */
.cart-count,
.wishlist-count {
    position: absolute;
    top: -6px;
    right: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background-color: var(--color-accent-mauve);
    color: var(--color-text-primary);
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 50%;
    line-height: 1;
}

/* Mini Cart */
.header-cart {
    position: relative;
}

.mini-cart-panel {
    position: absolute;
    top: calc(100% + 1.25rem);
    right: 0;
    width: 340px;
    max-width: 90vw;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 200;
}

.header-cart.is-open .mini-cart-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mini-cart-panel__empty {
    text-align: center;
    padding: 1rem 0;
}

.mini-cart-panel__empty p {
    color: var(--color-text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.mini-cart-panel__items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 1.25rem;
}

.mini-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    position: relative;
}

.mini-cart-item__image {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 4px;
    overflow: hidden;
    display: block;
}

.mini-cart-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cart-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.mini-cart-item__name {
    font-family: var(--font-primary);
    font-size: 0.9rem;
    color: var(--color-text-primary);
    text-decoration: none;
    line-height: 1.3;
}

.mini-cart-item__name:hover {
    text-decoration: underline;
}

.mini-cart-item__qty-price {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.mini-cart-item__remove {
    flex-shrink: 0;
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 1.25rem;
    line-height: 1;
    padding: 0 0.25rem;
}

.mini-cart-item__remove:hover {
    color: var(--color-text-primary);
}

.mini-cart-panel__subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
    margin-bottom: 1.25rem;
}

.mini-cart-panel__actions {
    display: flex;
    gap: 0.75rem;
}

.mini-cart-panel__actions .btn {
    flex: 1;
    text-align: center;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
}

/* .btn-ghost is designed for use over a dark hero (white border/text);
   the mini-cart panel is light, so invert it here to stay visible. */
.mini-cart-panel__actions .btn-ghost {
    border-color: var(--color-text-primary);
    color: var(--color-text-primary);
}

.mini-cart-panel__actions .btn-ghost:hover,
.mini-cart-panel__actions .btn-ghost:focus {
    background: var(--color-text-primary);
    color: var(--color-bg-primary);
}

/* Scrolled State - only repositions the transparent (home) header; the
   solid header on every other page is already sticky, so scrolling just
   adds a subtle shadow instead of re-triggering position/layout. */
.header--scrolled {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
}

.site-header--transparent.header--scrolled {
    position: fixed;
    top: 0;
    background-color: var(--minao-header-scrolled-bg, var(--color-bg-primary));
    color: var(--minao-header-scrolled-text, var(--color-text-primary));
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 24px;
    height: 24px;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: inherit;
    position: relative;
    z-index: 101; /* above .mobile-menu (99) so the close icon stays visible/clickable while the panel is open */
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: currentColor;
    transition: all 0.3s ease;
}

/* Morph hamburger into an X while the mobile menu is open. Forced to a
   dark color here because the header itself stays transparent, and a
   white icon (the default at the top of the page) would be invisible
   against the mobile-menu panel's white background sitting behind it. */
.mobile-menu-toggle[aria-expanded="true"] {
    color: var(--color-text-primary);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background-color: var(--color-bg-primary);
    z-index: 99;
    transform: translateX(-100%);
    transition: transform 0.4s ease;
    padding: 6rem 5% 2rem;
    overflow-y: auto;
}

.mobile-menu.is-open {
    transform: translateX(0);
}

.mobile-menu__inner {
    position: relative;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu a {
    display: block;
    padding: 1rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.2rem;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.mobile-nav-menu a:hover,
.mobile-nav-menu a:focus {
    color: var(--color-accent-mauve);
}

/* Responsive */
@media (max-width: 1024px) {
    .main-navigation {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }
}

@media (max-width: 768px) {
    .site-branding img {
        height: 35px;
        width: auto;
    }
}
