/* ==========================================================================
   Unified Site Header
   Theme-owned layout. Plugin hooks into pm_theme_header_top (ticker)
   and pm_theme_header_nav (mega menu). Uses WP preset color variables
   so style variations (Dark Luxe / Classic Silver) swap automatically.
   ========================================================================== */

/* Outer fixed container */
.pm-site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999999;
    font-family: var(--wp--preset--font-family--system, sans-serif);
}

/* Row 2: Site name | nav | cart/account */
.pm-header-nav-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--wp--preset--color--surface, #1a1a1a);
    border-bottom: 2px solid var(--wp--preset--color--accent, #d4af37);
    padding: 0 24px;
    height: 52px;
    max-width: 100%;
}

/* Site name -- left */
.pm-header-site-name {
    color: var(--wp--preset--color--accent, #d4af37);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
    flex-shrink: 0;
}

.pm-header-site-name:hover {
    color: var(--wp--preset--color--accent-dark, #b8860b);
}

/* Center slot -- grows to fill, plugin mega menu goes here */
.pm-header-nav-center {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
}

/* Right side: account + cart icons */
.pm-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.pm-header-actions a {
    color: var(--wp--preset--color--contrast, #fff);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: color 0.2s ease;
}

.pm-header-actions a:hover {
    color: var(--wp--preset--color--accent, #d4af37);
}

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

/* Body offset for fixed header.
   Ticker row ~40px + nav row 52px = ~92px.
   Use a conservative value that works whether the plugin is active or not. */
body {
    padding-top: 65px;
}

/* When the plugin is NOT active, only the nav row shows (52px) */
body:not(.pm-has-ticker) {
    padding-top: 52px;
}

/* Collapse block spacing between fixed header and content */
.wp-site-blocks {
    padding-top: 0 !important;
}
.wp-site-blocks > *:first-child {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
    padding-top: 0 !important;
}
.wp-site-blocks > .wp-block-group > .wp-block-post-content {
    margin-top: 0 !important;
    margin-block-start: 0 !important;
}
body.home .pm-shop-landing {
    padding-top: 0 !important;
}
body.home .pm-landing-logo {
    padding-top: 2px !important;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
    .pm-header-nav-row {
        height: 48px;
        padding: 0 16px;
        gap: 10px;
    }

    .pm-header-site-name {
        font-size: 0.9rem;
        letter-spacing: 0.04em;
    }

    .pm-header-actions {
        gap: 12px;
    }

    .pm-header-actions svg {
        width: 18px;
        height: 18px;
    }

    body {
        padding-top: 65px;
    }

    body:not(.pm-has-ticker) {
        padding-top: 48px;
    }
}

@media (max-width: 480px) {
    .pm-header-site-name {
        font-size: 0.8rem;
    }

    .pm-header-nav-row {
        padding: 0 12px;
    }
}
