
.agape-header {
    position: relative;
    z-index: 100;
    background: #071a2e;
    color: #fff;
}

.agape-header__inner {
    max-width: 1280px;
    min-height: 80px;
    padding: 0 24px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.agape-header__logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #e8b840;
    text-decoration: none;
    flex-shrink: 0;
}

.agape-header__brand {
    font-family: Georgia, serif;
    font-size: 30px;
    line-height: 1;
}

.agape-header__brand-sub {
    font-size: 8px;
    letter-spacing: 3px;
    margin-top: 6px;
}

.agape-header__nav {
    display: flex;
    align-items: center;
    gap: 22px;
}

.agape-header__nav a {
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.agape-header__nav a:hover,
.agape-header__nav a.is-active {
    color: #e8b840;
}

.agape-header__actions {
    display: flex;
    align-items: center;
    gap: 18px;
}

/* Consistent line icons: no emoji/font-specific symbols. */
.agape-header__actions .agape-header__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    box-sizing: border-box;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: color .18s ease;
}

.agape-header__actions .agape-header__icon:hover {
    color: #e8b840;
}

.agape-header__actions .agape-header__icon:focus-visible {
    outline: 2px solid #e8b840;
    outline-offset: 3px;
}

.agape-header__action-svg {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8px;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.agape-header__cart-count {
    position: absolute;
    top: -3px;
    right: -5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: #e8b840;
    color: #071a2e;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

/* Hide zero on the initial render AND after WooCommerce AJAX fragments replace the badge. */
.agape-header .agape-header__cart-count[hidden],
.agape-header .agape-header__cart-count[data-count="0"] {
    display: none !important;
}

.agape-header__actions .agape-header__menu-toggle {
    display: none;
}

.agape-header__mobile-nav {
    background: #071a2e;
    padding: 18px 24px;
}

.agape-header__mobile-nav a {
    display: block;
    padding: 12px 0;
    color: #fff;
    text-decoration: none;
}

.agape-header__search {
    padding: 16px 24px;
    background: #0c243d;
}

.agape-header__search form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    gap: 8px;
}

.agape-header__search input {
    flex: 1;
    min-width: 0;
}

.agape-header__search button {
    background: #e8b840;
    color: #071a2e;
    border: none;
    padding: 8px 16px;
}

.agape-header [hidden] {
    display: none !important;
}

@media (max-width: 1100px) {
    .agape-header__nav {
        display: none;
    }

    .agape-header__actions .agape-header__menu-toggle {
        display: inline-flex;
    }

    .agape-header__actions .agape-header__account {
        display: none;
    }
}

@media (max-width: 600px) {
    .agape-header__inner {
        min-height: 72px;
        padding: 0 16px;
        gap: 12px;
    }

    .agape-header__actions {
        gap: 14px;
    }
}


/* Main navigation */
.agape-nav-menu,
.agape-nav-menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.agape-nav-menu {
    display: flex;
    align-items: center;
    gap: 22px;
}

.agape-nav-menu > li {
    position: relative;
}

.agape-nav-menu a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-size: 12px;
    white-space: nowrap;
}

.agape-nav-menu > li > a {
    padding: 30px 0;
}

.agape-nav-menu a:hover,
.agape-nav-menu .current-menu-item > a {
    color: #e8b840;
}

/* Dropdown */
.agape-nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 250px;
    padding: 10px 0;
    background: #0c243d;
    border: 1px solid rgba(232, 184, 64, 0.2);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);

    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    z-index: 1000;
}

.agape-nav-menu .sub-menu a {
    padding: 12px 18px;
    white-space: normal;
}

.agape-nav-menu .sub-menu a:hover {
    background: rgba(232, 184, 64, 0.08);
}

/* Reveal dropdown */
.agape-nav-menu li:hover > .sub-menu,
.agape-nav-menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown indicator */
.agape-nav-menu .menu-item-has-children > a::after {
    content: "⌄";
    display: inline-block;
    margin-left: 6px;
    color: #e8b840;
}


/* 1. Display the WordPress logo at its original proportions. */
.agape-header__logo-image {
    display: block;
    width: 110px;
    height: auto;
    max-height: 68px;
    object-fit: contain;
}

/* 2. Keep the existing menu hierarchy accessible on mobile. */
.agape-header__mobile-nav .agape-nav-menu {
    display: block;
}

.agape-header__mobile-nav .agape-nav-menu > li > a {
    padding: 12px 0;
}

.agape-header__mobile-nav .agape-nav-menu .sub-menu {
    position: static;
    width: auto;
    margin: 0 0 8px 12px;
    padding: 0 0 0 12px;
    border: 0;
    border-left: 1px solid rgba(232, 184, 64, .3);
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    opacity: 1;
    visibility: visible;
    transform: none;
}

.agape-header__mobile-nav .agape-nav-menu .sub-menu a {
    padding: 9px 0;
    white-space: normal;
}


/* 3. Show the search panel only when expanded by its control. */
.agape-header .agape-header__search:not([hidden]) {
    display: block;
    position: relative;
    z-index: 101;
}

.agape-header .agape-header__search form {
    width: 100%;
}

.agape-header .agape-header__search input[type="search"] {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    background: #fff;
    color: #071a2e;
    border: 1px solid #dce2ec;
    border-radius: 6px;
}

.agape-header .agape-header__search button {
    min-height: 44px;
    flex-shrink: 0;
}

/* 4. Click-to-open mini-cart: match the Agape header, no forced navigation. */
.agape-header__cart-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.agape-header button.agape-header__cart {
    font-family: inherit;
}

.agape-header .agape-header__mini-cart-panel {
    box-sizing: border-box;
    position: absolute;
    top: calc(100% + 16px);
    right: -14px;
    z-index: 1200;
    width: min(380px, calc(100vw - 24px));
    max-height: min(75vh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 20px;
    border: 1px solid #dce2ec;
    border-top: 3px solid #e8b840;
    border-radius: 12px;
    background: #fff;
    color: #0d2342;
    box-shadow: 0 18px 48px rgba(7, 26, 46, .20);
    animation: agape-mini-cart-pop .18s ease-out both;
    text-align: left;
}

.agape-header .agape-header__mini-cart-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e6ebf0;
    color: #0d2342;
    font-size: 17px;
    line-height: 1.35;
}

.agape-header button.agape-header__mini-cart-close {
    width: 34px;
    height: 34px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #334155;
    font: 26px/1 Arial, sans-serif;
    cursor: pointer;
}

.agape-header button.agape-header__mini-cart-close:hover {
    background: #f1f5f9;
}

.agape-header .agape-header__mini-cart-content ul.woocommerce-mini-cart {
    display: block;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 310px;
    overflow-y: auto;
}

.agape-header .agape-header__mini-cart-content li.woocommerce-mini-cart-item {
    position: relative;
    display: block;
    margin: 0;
    padding: 12px 32px 12px 0;
    border-bottom: 1px solid #edf0f4;
    color: #334155;
    font-size: 13px;
    line-height: 1.5;
    min-height: 76px;
}

.agape-header .agape-header__mini-cart-content li.woocommerce-mini-cart-item:first-child {
    padding-top: 0;
}

.agape-header .agape-header__mini-cart-content li.woocommerce-mini-cart-item a:not(.remove) {
    display: block;
    color: #0d2342;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: normal;
}

.agape-header .agape-header__mini-cart-content li.woocommerce-mini-cart-item a:not(.remove):hover {
    color: #a57717;
}

.agape-header .agape-header__mini-cart-content li.woocommerce-mini-cart-item a img {
    float: left;
    width: 56px;
    height: 56px;
    margin: 0 12px 8px 0;
    border-radius: 6px;
    object-fit: cover;
}

/* Remove button appearance is shared with the full cart in woocommerce-ui.css. */
.agape-header .agape-header__mini-cart-content .quantity,
.agape-header .agape-header__mini-cart-content .variation {
    display: block;
    margin-top: 5px;
    color: #64748b;
    font-size: 12px;
    font-weight: 400;
}

.agape-header .agape-header__mini-cart-content .variation dt,
.agape-header .agape-header__mini-cart-content .variation dd {
    display: inline;
    float: none;
    margin: 0 4px 0 0;
    padding: 0;
}

.agape-header .agape-header__mini-cart-content .woocommerce-mini-cart__total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 15px 0;
    padding: 0;
    color: #0d2342;
    font-size: 15px;
}

.agape-header .agape-header__mini-cart-content .woocommerce-mini-cart__buttons {
    display: flex;
    gap: 10px;
    margin: 15px 0 0;
    padding: 0;
}

.agape-header .agape-header__mini-cart-content .woocommerce-mini-cart__buttons a {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #d9ae36;
    border-radius: 7px;
    background: #fff;
    color: #0d2342;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    text-decoration: none;
    white-space: normal;
}

.agape-header .agape-header__mini-cart-content .woocommerce-mini-cart__buttons a.checkout {
    background: var(--ag-btn-gold, linear-gradient(180deg, #f6d878, #dfa92c));
}

.agape-header .agape-header__mini-cart-content .woocommerce-mini-cart__buttons a:hover {
    background: #f7e9bb;
    color: #071a2e;
}

.agape-header .agape-header__mini-cart-content .woocommerce-mini-cart__empty-message {
    margin: 0;
    padding: 16px 0;
    color: #64748b;
    font-size: 14px;
    text-align: center;
}

.agape-header :is(.agape-header__cart, .agape-header__mini-cart-close, .agape-header__mini-cart-panel a):focus-visible {
    outline: 3px solid #d9ae36;
    outline-offset: 3px;
}

@keyframes agape-mini-cart-pop {
    from { opacity: 0; transform: translateY(-7px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    .agape-header .agape-header__mini-cart-panel {
        right: -44px;
        padding: 16px;
        max-height: min(72vh, 600px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .agape-header .agape-header__mini-cart-panel { animation: none; }
}


/* 5. Shop by Categories: an accessible, click-to-expand parent menu. */
.agape-header .agape-nav-menu .agape-header__category-toggle {
    display: block;
    appearance: none;
    width: auto;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 30px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #fff;
    font-family: inherit;
    font-size: 12px;
    font-weight: inherit;
    line-height: normal;
    letter-spacing: normal;
    text-align: left;
    text-transform: none;
    white-space: nowrap;
    cursor: pointer;
}

.agape-header .agape-nav-menu .agape-header__category-toggle:hover,
.agape-header .agape-nav-menu .agape-header__category-toggle[aria-expanded="true"] {
    background: transparent;
    color: #e8b840;
}

.agape-header .agape-nav-menu .agape-header__category-toggle::after {
    content: "⌄";
    display: inline-block;
    margin-left: 6px;
    color: #e8b840;
    transition: transform .18s ease;
}

.agape-header .agape-nav-menu .agape-header__category-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* For this specific parent, the submenu opens by click, not mere hover/focus. */
.agape-header .agape-header__nav .agape-nav-menu li.agape-category-menu > .sub-menu {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(8px);
}

.agape-header .agape-header__nav .agape-nav-menu li.agape-category-menu.agape-category-menu--open > .sub-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

.agape-header .agape-nav-menu .agape-header__category-toggle:focus-visible {
    outline: 2px solid #e8b840;
    outline-offset: 4px;
}

@media (max-width: 1100px) {
    .agape-header .agape-header__mobile-nav .agape-nav-menu > li > .agape-header__category-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
        padding: 12px 0;
    }

    .agape-header .agape-header__mobile-nav .agape-nav-menu li.agape-category-menu > .sub-menu {
        display: none;
    }

    .agape-header .agape-header__mobile-nav .agape-nav-menu li.agape-category-menu.agape-category-menu--open > .sub-menu {
        display: block;
    }
}
