.site-header {
    width: 100%;
    background: #fff;
}

/* =========================
   TOP HEADER ROW
   ========================= */

.site-header__top {
    min-height: 76px;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.brand {
    grid-column: 2;

    display: flex;
    align-items: center;
    gap: 0.75rem;

    text-decoration: none;
    color: inherit;
    font-weight: 600;
}

.brand img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}


/* =========================
   CART + ACCOUNT
   ========================= */

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.cart-link,
.account-icon-link {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #17251c;
    text-decoration: none;
}
/* Active login icon */
.account-icon-link.active {
    background-color: #c5d8bd !important;
    border-radius: 20px;
    padding: 8px 16px !important;

    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.cart-icon,
.account-icon {
    width: 24px;
    height: 24px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;

    min-width: 18px;
    height: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;
    font-size: 0.7rem;
}


/* =========================
   BOTTOM NAVIGATION ROW
   ========================= */

.site-header__bottom {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.8rem 2rem;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
}

.main-nav {
    grid-column: 2;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
}

.main-nav a {
    color: #174f39;
    text-decoration: none;
    font-weight: 500;
}

.main-nav a:hover {
    text-decoration: underline;
}

.header-actions {
    grid-column: 3;

    display: flex;
    align-items: center;
    justify-self: end;
    gap: 1.5rem;
}






/* Account dropdown wrapper */
.account-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Username in navbar */
.account-menu-toggle {
    display: flex;
    align-items: center;
    gap: 5px;

    margin: 0;
    padding: 0;

    background: transparent;
    border: none;

    color: #174f39;
    font: inherit;
    font-weight: 500;
    line-height: normal;

    cursor: pointer;
}

.account-menu .account-dropdown > a + a {
    border-top: 1px solid #d8c7a9 !important;
}

.account-dropdown {
    display: none;

    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 1000;

    min-width: 190px;
    padding: 0;

    background: #fffaf0;
    border: 1px solid #d8c7a9;
    border-radius: 6px;

    overflow: hidden;

    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

/* Only display when JS adds .open */
.account-dropdown.open {
    display: block;
}

.account-dropdown a {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin: 0;
    box-sizing: border-box;

    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;

    white-space: nowrap;
    text-align: center;
    text-decoration: none;
    color: #1f2d26;
}

.account-dropdown > a + a {
    border-top: 1px solid #d8c7a9;
}

.account-dropdown a:hover {
    background: #f3eadb !important;
}

.account-dropdown .account-logout {
    color: #b33a32;
}

.account-dropdown .account-logout:hover {
    background: #fff4f4 !important;
}

/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 700px) {

    .site-header__top {
        padding: 0 1rem;
    }

    .site-header__bottom-wrapper {
        width: 100%;
        border-top: 1px solid #aaa398;
        border-bottom: 1px solid #aaa398;
    }

    .site-header__bottom {
        max-width: 1200px;
        margin: 0 auto;
        padding: 0.8rem 2rem;

        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
    }

    .main-nav {
        justify-content: center;
        gap: 1.5rem;
    }


}

.account-menu-toggle,
.account-menu-toggle:hover,
.account-menu-toggle:focus,
.account-menu-toggle:active {
    background: transparent !important;
    color: #174f39 !important;
    border: none !important;
    box-shadow: none !important;
}

.account-menu-toggle:focus-visible {
    outline: 2px solid #174f39;
    outline-offset: 2px;
}

/* Shared storefront chrome. Scoped to avoid altering page-body components. */
.stock-availability { align-self: flex-start; width: fit-content; margin: 0 0 18px; padding: 3px 10px; border-radius: 3px; background: #edf0e7; color: #52634e; font: 600 14px/1.5 Arial, Helvetica, sans-serif; }
.stock-availability--low { background: #f4eedf; color: #776035; }
.storefront-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.storefront-page > .main { flex: 1 0 auto; min-height: 0; }
.storefront-page > .site-header, .storefront-page > .site-footer { flex-shrink: 0; }
.storefront-header { padding: 0 32px; border-bottom: 1px solid #dedfd3; background: #fffdf8; }
.storefront-header__inner { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 20px 0; }
.storefront-header .site-header__top { display: flex; flex: 0 0 auto; min-height: 0; margin: 0; padding: 0; }
.storefront-header .brand { flex-direction: row; gap: 14px; font-family: Georgia, 'Times New Roman', serif; font-size: 28px; white-space: nowrap; font-weight: 400; color: #253d31; }
.storefront-header .brand img { width: 48px; height: 48px; flex-shrink: 0; }
.storefront-header .site-header__bottom { flex: 1; min-width: 0; margin: 0; display: flex; justify-content: space-between; gap: 20px; padding: 0; }
.storefront-header .main-nav { flex: 1; justify-content: center; gap: 8px; }
.storefront-header .main-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 3px; color: #294d38; font-size: 16px; font-weight: 600; white-space: nowrap; }
.storefront-header .main-nav a.active { background: #edf0e7; }
.storefront-header .header-actions { min-width: 0; margin-left: auto; justify-content: flex-end; gap: 16px; }
.storefront-header .site-nav { flex-wrap: nowrap; width: auto; gap: 12px; }
.storefront-header .site-nav a { flex: none; }
.storefront-header .account-menu-toggle { min-height: 44px; height: auto; max-width: 180px; white-space: normal; overflow-wrap: anywhere; font-size: 16px; text-transform: none; letter-spacing: 0; text-align: left; }
.storefront-header .account-dropdown { max-width: calc(100vw - 40px); }
.storefront-header .account-dropdown a { font-size: 16px; }
.storefront-header .cart-count { top: 0; right: -4px; min-width: 20px; width: auto; height: 20px; font-size: 11px; }
.storefront-header a:focus-visible, .storefront-header button:focus-visible, .storefront-footer a:focus-visible { outline: 3px solid #996d2c; outline-offset: 3px; }
.storefront-footer { padding: 56px 32px; background: #253d31; color: #f7f3e8; }
.storefront-footer .site-footer__inner { width: 100%; max-width: 1200px; grid-template-columns: 2fr 1fr 1.4fr; gap: 48px; }
.storefront-footer h2 { color: #f7f3e8; font-size: 16px; font-weight: 600; letter-spacing: 0; margin-bottom: 16px; }
.storefront-footer .storefront-footer__brand h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 28px; font-weight: 400; }
.storefront-footer p { color: #cbd5c8; font-size: 16px; line-height: 1.8; margin: 0; }
.storefront-footer a { min-height: 44px; color: #dce3d6; font-size: 16px; overflow-wrap: anywhere; }
.storefront-footer a:hover { color: #fff; text-decoration: underline; }
@media (max-width: 1240px) {
    .storefront-header__inner { flex-direction: column; gap: 12px; padding: 16px 0; }
    .storefront-header .site-header__bottom { width: 100%; }
    .storefront-header .site-header__bottom { flex-direction: row; gap: 16px; }
    .storefront-header .header-actions { justify-content: flex-end; }
    .storefront-footer .site-footer__inner { grid-template-columns: 1.5fr 1fr 1.5fr; gap: 24px; }
}
@media (max-width: 1000px) {
    .storefront-header .site-header__bottom { flex-direction: column; gap: 12px; }
    .storefront-header .header-actions { width: 100%; }
    .storefront-header { padding: 0 20px; }
    .storefront-header .site-header__top { min-height: 0; }
    .storefront-header .site-header__spacer { display: none; }
    .storefront-header .brand { grid-column: 1; justify-content: center; font-size: 25px; gap: 8px; }
    .storefront-header .brand img { width: 38px; height: 38px; }
    .storefront-header .header-actions { flex-wrap: wrap; gap: 12px; }
    .storefront-header .site-nav { margin-left: auto; }
    .storefront-header .main-nav { width: 100%; justify-content: center; }
    .storefront-footer { padding: 40px 20px; }
    .storefront-footer .site-footer__inner { grid-template-columns: 1fr; gap: 28px; }
}

/* Without global search, tablet navigation and account controls share a row. */
@media (min-width: 641px) and (max-width: 1000px) {
    .storefront-header .site-header__bottom { flex-direction: row; align-items: center; }
    .storefront-header .main-nav { width: auto; flex: 0 0 auto; }
    .storefront-header .header-actions { width: auto; flex-wrap: nowrap; }
}

/* Shared CakePHP toast presentation. */
.message.storefront-flash { display: flex; flex-shrink: 0; align-items: center; gap: 16px; width: 100%; margin: 0; box-shadow: 0 6px 24px rgba(37, 61, 49, .14); pointer-events: auto; padding: 12px 16px; border: 1px solid; border-left-width: 4px; border-radius: 4px; font: 16px/1.6 Arial, Helvetica, sans-serif; cursor: default; }
.message.storefront-flash.success, .message.storefront-flash.info { background: #edf0e7; border-color: #9aaf91; color: #294d38; }
.message.storefront-flash.error, .message.storefront-flash.warning { background: #faf0e8; border-color: #bd8f7e; color: #793b2e; }
.message.storefront-flash.hidden { display: none; }
.storefront-flash .storefront-flash__text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.storefront-flash .storefront-flash__dismiss { flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; margin: 0; border: 0; border-radius: 3px; background: transparent; color: inherit; font: 24px/1 Arial, Helvetica, sans-serif; letter-spacing: 0; cursor: pointer; }
.storefront-flash .storefront-flash__dismiss:hover { background: rgba(37, 61, 49, 0.08); color: inherit; }
.storefront-flash .storefront-flash__dismiss:focus-visible { outline: 3px solid #996d2c; outline-offset: 2px; }
@media (max-width: 640px) {
    .message.storefront-flash { padding: 10px 12px; gap: 8px; }
}

/* Shared controlled quantity selector for catalogue and detail purchase forms. */
.quantity-stepper { display: inline-flex; flex: 0 0 auto; align-items: center; border: 1px solid #b7c1ac; border-radius: 3px; background: #fff; color: #253d31; }
.quantity-stepper button { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-height: 48px; height: auto; margin: 0; padding: 0; border: 0; border-radius: 2px; background: transparent; color: #294d38; font: 22px/1 Arial, Helvetica, sans-serif; letter-spacing: 0; cursor: pointer; }
.quantity-stepper button:hover:not(:disabled) { background: #edf0e7; color: #193a27; }
.quantity-stepper button:disabled { background: transparent; color: #8b9588; cursor: default; opacity: 1; }
.quantity-stepper button:focus-visible { outline: 3px solid #996d2c; outline-offset: 2px; }
.quantity-stepper output { min-width: 32px; text-align: center; font: 600 16px/1.5 Arial, Helvetica, sans-serif; }

.storefront-toasts { position: fixed; top: 160px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 12px; width: min(420px, calc(100% - 48px)); max-height: calc(100dvh - 176px); overflow-y: auto; pointer-events: none; }
@media (max-width: 640px) {
    .storefront-toasts { right: 12px; width: calc(100% - 24px); }
}

/* A single square image presentation shared by managed Product images. */
img.managed-product-image { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: contain; margin: 0; }

/* Real POST logout controls retain the shared account dropdown presentation. */
.account-menu .account-logout-form { margin: 0; }
.account-menu .account-dropdown > a + .account-logout-form { border-top: 1px solid #d8c7a9; }
.account-menu .account-logout-form .account-logout { display: block; width: 100%; min-height: 44px; height: auto; margin: 0; padding: 12px 16px; border: 0; border-radius: 0; background: transparent; color: #b33a32; font: inherit; font-weight: 700; line-height: inherit; letter-spacing: normal; text-align: center; text-transform: none; cursor: pointer; }
.account-menu .account-logout-form .account-logout:hover { background: #fff4f4; }
.account-menu .account-logout-form .account-logout:focus-visible { outline: 3px solid #996d2c; outline-offset: -3px; }

/* Keep keyboard focus visible against the dark shared footer. */
.storefront-footer a:focus-visible {
    outline-color: #f4eedf;
}
