/* ==========================================================================
   Apéry & Euler Navigation & Footer Styling
   ========================================================================== */

:root {
    --nav-height: 120px;
    --font-jost: 'Jost', sans-serif;
    --color-slate: #2c2c2c;
    --color-bone: #d3cdc8;
    --color-cream: #f5f2ed;
    --color-sage: #4a5144;
    --color-white: #ffffff;
    --border-light: rgba(44, 44, 44, 0.08);
}

/* Header & Nav Base */
#ae-site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8%;
    font-family: var(--font-jost);
    transition: background-color 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
    border-bottom: 1px solid transparent;
    box-sizing: border-box;
}

/* Scroll Active State (Frosted Glass) */
#ae-site-header.scrolled {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-color: var(--border-light);
}

/* Header Logo */
.ae-nav-logo {
    display: flex;
    align-items: center;
    height: 100%;
}
.ae-nav-logo img {
    height: 57px;
    width: auto;
    object-fit: contain;
    transition: filter 0.4s ease;
}

/* Desktop Menu Links */
.ae-nav-links {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 60px;
    height: 100%;
}

.ae-nav-item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.ae-nav-link {
    color: var(--color-slate);
    text-decoration: none;
    text-transform: uppercase;
    font-size: 1.14rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    padding: 15px 0;
    cursor: pointer;
    transition: color 0.3s ease;
}

.ae-nav-link:hover,
.scrolled .ae-nav-link:hover {
    color: var(--color-sage);
}

/* Products Dropdown Styling */
.ae-dropdown-menu {
    position: absolute;
    top: 80%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background:
        linear-gradient(160deg, rgba(255, 252, 246, 0.76), rgba(232, 224, 214, 0.52)),
        radial-gradient(circle at 14% 16%, rgba(255, 255, 255, 0.42), transparent 30%),
        radial-gradient(circle at 88% 14%, rgba(255, 247, 229, 0.24), transparent 24%);
    border: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow:
        0 24px 60px rgba(61, 52, 43, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.42);
    backdrop-filter: blur(20px) saturate(132%);
    -webkit-backdrop-filter: blur(20px) saturate(132%);
    border-radius: 22px;
    padding: 30px 32px;
    width: min(820px, calc(100vw - 88px));
    min-width: 700px;
    max-width: calc(100vw - 88px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
    z-index: 1010;
}

.ae-nav-item.dropdown:hover .ae-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.ae-dropdown-item {
    text-decoration: none;
    color: var(--color-slate);
    font-size: 1.23rem;
    letter-spacing: 0.02em;
    font-weight: 400;
    transition: color 0.3s ease, padding-left 0.3s ease;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    column-gap: 28px;
    white-space: nowrap;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
    width: 100%;
}

.ae-dropdown-item span.product-meta {
    font-size: 0.98rem;
    color: #8a8a8a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0;
    flex-shrink: 0;
    text-align: right;
    justify-self: end;
}

.ae-dropdown-item:hover {
    color: var(--color-sage);
    padding-left: 5px;
}

.ae-dropdown-divider {
    height: 1px;
    background-color: rgba(44, 44, 44, 0.12);
    margin: 2px 0 4px;
}

.ae-dropdown-footer {
    text-decoration: none;
    color: var(--color-sage);
    font-size: 1.08rem;
    text-transform: uppercase;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-align: center;
    transition: color 0.3s ease;
}

.ae-dropdown-footer:hover {
    color: #000000;
}

/* Mobile Header Toggles */
.ae-mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1002;
}

.ae-mobile-toggle span {
    display: block;
    width: 22px;
    height: 1.5px;
    background-color: var(--color-slate);
    margin: 5px 0;
    transition: all 0.3s ease;
}

/* Mobile Menu Slide Out Overlay */
.ae-mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100vh;
    background:
        linear-gradient(160deg, rgba(255, 252, 246, 0.7), rgba(230, 223, 212, 0.48)),
        radial-gradient(circle at 18% 14%, rgba(255, 255, 255, 0.48), transparent 34%),
        radial-gradient(circle at 82% 16%, rgba(255, 248, 232, 0.24), transparent 24%),
        radial-gradient(circle at 58% 78%, rgba(202, 196, 184, 0.18), transparent 28%);
    backdrop-filter: blur(24px) saturate(135%);
    -webkit-backdrop-filter: blur(24px) saturate(135%);
    border-left: 1px solid rgba(255, 255, 255, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px 10%;
    transition: right 0.5s cubic-bezier(0.77, 0.2, 0.05, 1);
    box-sizing: border-box;
    overflow: hidden;
}

.ae-mobile-menu::before,
.ae-mobile-menu::after {
    content: "";
    position: absolute;
    inset: auto;
    pointer-events: none;
}

.ae-mobile-menu::before {
    top: 10%;
    left: 8%;
    width: 48vw;
    height: 48vw;
    max-width: 280px;
    max-height: 280px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0));
    filter: blur(8px);
    opacity: 0.9;
}

.ae-mobile-menu::after {
    right: -12%;
    bottom: 8%;
    width: 58vw;
    height: 58vw;
    max-width: 340px;
    max-height: 340px;
    background: radial-gradient(circle, rgba(246, 240, 229, 0.38), rgba(246, 240, 229, 0));
    filter: blur(10px);
    opacity: 0.75;
}

.ae-mobile-menu.open {
    right: 0;
}

#ae-site-header.mobile-menu-open .ae-mobile-menu {
    right: 0;
}

.ae-mobile-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.ae-mobile-link {
    font-size: 1.8rem;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 0.04em;
    color: var(--color-slate);
    text-decoration: none;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ae-mobile-dropdown-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-slate);
    text-align: left;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 1;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.18);
}

.ae-mobile-dropdown-btn::after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.ae-mobile-dropdown-btn.open::after {
    transform: rotate(45deg);
}

.ae-mobile-submenu {
    display: none;
    list-style: none;
    padding-left: 20px;
    margin-top: 16px;
    flex-direction: column;
    gap: 16px;
}

.ae-mobile-submenu.open {
    display: flex;
}

.ae-mobile-sublink {
    font-size: 1.1rem;
    text-transform: uppercase;
    font-weight: 300;
    letter-spacing: 0.05em;
    color: var(--color-slate);
    text-decoration: none;
    position: relative;
    z-index: 1;
}

/* Ham menu morphing */
.ae-mobile-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 4px);
}

.ae-mobile-toggle.open span:nth-child(2) {
    opacity: 0;
}

.ae-mobile-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -4px);
}

/* ==========================================================================
   Footer Component Styling
   ========================================================================== */
#ae-site-footer {
    background-color: #3b3c37;
    color: #e5e3dc;
    padding: 90px 8% 60px 8%;
    font-family: var(--font-jost);
    font-size: 0.78rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-sizing: border-box;
}

.ae-footer-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr 0.8fr 1.2fr;
    gap: 60px;
    margin-bottom: 60px;
}

.ae-footer-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ae-footer-logo-img {
    height: 48px;
    width: auto;
    object-fit: contain;
    align-self: flex-start;
    filter: invert(0.9) brightness(0.9);
}

.ae-footer-col h4 {
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.ae-footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ae-footer-link {
    color: #c4c3be;
    text-decoration: none;
    transition: color 0.3s ease;
}

.ae-footer-link:hover {
    color: #ffffff;
}

.ae-footer-col p {
    color: #c4c3be;
    line-height: 1.6;
    text-transform: none;
    font-size: 0.86rem;
}

.ae-newsletter-form {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 8px;
    margin-top: 10px;
    transition: border-color 0.3s;
}

.ae-newsletter-form:focus-within {
    border-color: #ffffff;
}

.ae-newsletter-form input {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 0.84rem;
    flex-grow: 1;
    outline: none;
    padding: 4px 0;
}

.ae-newsletter-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.ae-newsletter-form button {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0 4px;
}

.ae-newsletter-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.ae-newsletter-botcheck {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.ae-newsletter-status {
    min-height: 1.2em;
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.ae-newsletter-status.is-success {
    color: rgba(231, 244, 232, 0.92);
}

.ae-newsletter-status.is-error {
    color: rgba(255, 214, 214, 0.92);
}

.ae-footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

/* ==========================================================================
   Responsive Media Queries
   ========================================================================== */
@media (max-width: 1024px) {
    .ae-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    .ae-footer-col:last-child {
        grid-column: span 2;
        max-width: 500px;
    }
}

@media (min-width: 1181px) and (max-width: 1500px) {
    .ae-nav-logo img {
        height: 52px;
    }

    .ae-nav-links {
        gap: 48px;
    }

    .ae-nav-link {
        font-size: 1rem;
    }
}

@media (max-width: 1180px) {
    :root {
        --nav-height: 80px;
    }
    #ae-site-header {
        padding: 0 6%;
    }
    #ae-site-header.scrolled,
    #ae-site-header.mobile-menu-open,
    #ae-site-header:has(.ae-mobile-menu.open) {
        background: linear-gradient(180deg, rgba(255, 252, 247, 0.72), rgba(236, 230, 221, 0.38));
        backdrop-filter: blur(18px) saturate(130%);
        -webkit-backdrop-filter: blur(18px) saturate(130%);
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
    }
    .ae-nav-links {
        display: none;
    }
    .ae-mobile-toggle {
        display: block;
    }
    .ae-mobile-menu {
        padding: calc(var(--nav-height) + 34px) 9% 34px;
        justify-content: flex-start;
    }
    #ae-site-footer {
        padding: 60px 6% 40px 6%;
    }
    .ae-footer-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    .ae-footer-col:last-child {
        grid-column: span 1;
    }
    .ae-footer-bottom {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}
