*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #0d1b2a;
    --navy-mid: #1b2d42;
    --gold: #c9a84c;
    --gold-light: #e8c96e;
    --cream: #f5f0e8;
    --white: #ffffff;
    --text-dark: #1a1a2e;
    --text-muted: #6b7280;
    --border: #e2d9cc;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: #ffffff;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Single white header — scrolls with page (not sticky) */
nav.site-header {
    position: relative;
    z-index: 1000;
    flex-shrink: 0;
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.site-header__inner {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.65rem 2rem;
    min-height: 76px;
}

/* Desktop: two link groups spread like before */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
    flex-shrink: 0;
}

.nav-toggle:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #171717;
    border-radius: 1px;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #171717;
    flex-shrink: 0;
}

.nav-logo {
    width: 110px;
    height: 110px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.nav-brand__text {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.25;
    color: #171717;
    max-width: 11rem;
}

.nav-panel {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 1.5rem;
}

@media (min-width: 901px) {
    .nav-panel {
        justify-content: space-between;
    }

    .nav-links {
        justify-content: center;
    }
}

.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    gap: 0.15rem 1.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links a {
    color: #171717;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    padding: 0.35rem 0.15rem;
    transition: color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: #9a7b2e;
}

.nav-links a.is-active {
    color: #171717;
    box-shadow: inset 0 -3px 0 var(--gold);
}

.nav-links a.is-active:hover {
    color: #9a7b2e;
    box-shadow: inset 0 -3px 0 var(--gold-light);
}

.nav-links__item {
    position: relative;
}

.nav-links__row {
    display: flex;
    align-items: center;
    gap: 0.15rem;
}

.nav-links__parent {
    color: #171717;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 500;
    padding: 0.35rem 0.15rem;
}

.nav-links__parent:hover {
    color: #9a7b2e;
}

.nav-links__parent.is-active {
    box-shadow: inset 0 -3px 0 var(--gold);
}

.nav-submenu-toggle {
    display: none;
    border: none;
    background: transparent;
    color: #171717;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.35rem 0.25rem;
    cursor: pointer;
}

.nav-submenu {
    display: none;
    list-style: none;
    margin: 0;
    padding: 0.35rem 0 0;
    min-width: 10rem;
}

.nav-submenu a {
    display: block;
    padding: 0.35rem 0.15rem;
    font-size: 1rem;
    color: #171717;
    text-decoration: none;
    white-space: nowrap;
}

.nav-submenu a:hover {
    color: #9a7b2e;
}

.nav-submenu a.is-active {
    color: #9a7b2e;
    font-weight: 600;
}

@media (min-width: 901px) {
    .nav-links__item--has-children:hover .nav-submenu,
    .nav-links__item--has-children:focus-within .nav-submenu {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        background: #ffffff;
        border: 1px solid #e5e5e5;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
        padding: 0.5rem 0.85rem;
        z-index: 100;
    }

    .nav-links__item.is-active-group .nav-links__parent {
        color: #9a7b2e;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.nav-logout-form {
    margin: 0;
    display: inline;
}

.nav-action-link {
    color: #171717;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.35rem 0.5rem;
    transition: color 0.2s;
}

.nav-action-link:hover {
    color: #9a7b2e;
}

.nav-action-link--btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.btn-admin {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 1rem;
    border: 1px solid #c9a84c;
    border-radius: 2px;
    background: transparent;
    color: #171717;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.btn-admin:hover {
    border-color: #9a7b2e;
    color: #9a7b2e;
    background: rgba(201, 168, 76, 0.06);
}

.btn-admin__chevron {
    font-size: 1.1em;
    line-height: 1;
    margin-top: -1px;
}

main {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #ffffff;
}

/* Public page shells fill main (not the dashboard — it has its own layout) */
main > *:not(.dash-root) {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Dashboard CMS: fill space below header; scroll only inside .dash-content */
html:has(.dash-root),
body:has(.dash-root) {
    overflow: hidden;
    height: 100%;
    min-height: 100vh;
    max-height: 100vh;
}

main:has(.dash-root) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    background: #f5f2ee;
}

main > .dash-root {
    display: flex;
    flex-direction: row;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* Dashboard uses full viewport below header — hide public footer */
body:has(.dash-root) footer.site-footer {
    display: none;
}

@media (max-width: 900px) {
    .site-header__inner {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
        min-height: 64px;
        gap: 0.5rem;
    }

    .nav-brand__text {
        font-size: 0.85rem;
        max-width: 9rem;
    }

    .nav-toggle {
        display: flex;
        order: 2;
        margin-left: auto;
    }

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

    .nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
        opacity: 0;
    }

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

    .nav-panel {
        display: none;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        flex-basis: 100%;
        width: 100%;
        order: 3;
        margin-top: 0.25rem;
        padding: 0.5rem 0 0.75rem;
        gap: 0.75rem;
        border-top: 1px solid #e8e8e8;
    }

    .nav-panel.is-open {
        display: flex;
    }

    .nav-links {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0;
        flex: none;
    }

    .nav-links li {
        border-bottom: 1px solid #eee;
    }

    .nav-links li:last-child {
        border-bottom: none;
    }

    .nav-links a,
    .nav-links__parent {
        display: block;
        width: 100%;
        padding: 0.75rem 0.25rem;
        text-align: left;
        font-size: 1.1rem;
    }

    .nav-links a.is-active,
    .nav-links__parent.is-active {
        box-shadow: inset 0 -3px 0 var(--gold);
    }

    .nav-links__row {
        justify-content: space-between;
    }

    .nav-submenu-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 0.5rem;
    }

    .nav-links__item--has-children.is-submenu-open .nav-submenu {
        display: block;
        padding: 0 0 0.5rem 1rem;
    }

    .nav-links__item--has-children.is-submenu-open .nav-submenu-toggle span {
        transform: rotate(180deg);
        display: inline-block;
    }

    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding-top: 0.25rem;
        border-top: 1px solid #eee;
    }

    .btn-admin {
        justify-content: center;
        width: 100%;
    }

    .nav-action-link {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.75rem 0.25rem;
    }
}

body.nav-mobile-open {
    overflow: hidden;
    touch-action: none;
}

/* Rich text may include <footer>; don't apply site chrome inside main */
main footer:not(.site-footer) {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.75rem 0 0;
    margin-top: 1rem;
    font-size: 0.88rem;
    text-align: left;
    letter-spacing: normal;
}

main footer:not(.site-footer) strong {
    color: inherit;
    font-weight: 600;
}

/* ── FLASH MESSAGES ── */
.flash {
    max-width: none;
    margin: auto;
    padding: 0 6vw;
    flex-shrink: 0;
}
.alert {
    padding: 0.85rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid #10b981; }
.alert-error   { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }

/* Shared product photo frame (home + products pages) */
.product-showcase__media {
    background: #ededed;
    border: 1px solid #dadada;
    padding: clamp(1.75rem, 4vw, 2.75rem) clamp(1.5rem, 3vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.product-showcase__stage {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 1.25rem;
}

.product-showcase__stage img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
}

.product-showcase__placeholder {
    width: 100%;
    max-width: 340px;
    aspect-ratio: 1;
    background: #ffffff;
    border: 1px dashed #c4c4c4;
}
