:root {
    color-scheme: light;
    --bg-color: #f5f0ec;
    --header-color: #fcfaf8;
    --footer-color: #e9ded6;
    --text-color: #302924;
    --muted-color: #756b63;
    --highlight-color: #435d46;
    --accent-color: #ddcec3;
    --link-color: #8c634b;
    --card-color: #fcfaf8;
    --soft-color: #e8eee7;
    --shadow: 0 16px 40px rgba(48, 41, 36, 0.08);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 84px;
    background: var(--bg-color);
}

body {
    margin: 0;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.6;
}

button,
a {
    font: inherit;
}

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid #b69a82;
    outline-offset: 3px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(221, 206, 195, 0.8);
    background: rgba(252, 250, 248, 0.94);
    backdrop-filter: blur(12px);
}

.site-nav {
    display: flex;
    width: min(1120px, calc(100% - 48px));
    min-height: 88px;
    margin: 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand,
.footer-brand > a {
    display: inline-flex;
    align-items: center;
}

.brand img {
    display: block;
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.navbar {
    display: flex;
    align-items: center;
    gap: clamp(18px, 3vw, 36px);
    margin: 0;
    padding: 0;
    list-style: none;
}

.navbar a,
.nav-dropdown summary,
.footer-column a,
.footer-faq-link {
    color: var(--muted-color);
    text-decoration: none;
    transition: color 160ms ease;
}

.navbar a,
.nav-dropdown summary {
    font-size: 0.92rem;
    font-weight: 600;
}

.navbar a:hover,
.nav-dropdown summary:hover,
.footer-column a:hover,
.footer-faq-link:hover {
    color: var(--link-color);
}

.nav-dropdown {
    position: relative;
}

.nav-dropdown summary {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown summary span {
    transition: transform 160ms ease;
}

.nav-dropdown[open] summary span {
    transform: rotate(180deg);
}

.faq-dropdown-menu {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 20;
    display: none;
    width: 220px;
    padding: 8px;
    border: 1px solid var(--accent-color);
    border-radius: 14px;
    background: var(--card-color);
    box-shadow: var(--shadow);
}

.nav-dropdown[open] .faq-dropdown-menu {
    display: grid;
}

.faq-dropdown-menu button {
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.88rem;
    text-align: left;
}

.faq-dropdown-menu button:hover,
.faq-dropdown-menu button:focus-visible {
    background: var(--soft-color);
    color: var(--link-color);
}

.hero {
    display: grid;
    width: min(1120px, calc(100% - 48px));
    min-height: 520px;
    margin: 0 auto;
    padding: 64px 0 72px;
    align-items: center;
    grid-template-columns: 1.05fr 0.95fr;
    gap: clamp(36px, 7vw, 100px);
}

.hero-copy {
    max-width: 500px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--highlight-color);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(3rem, 6vw, 5rem);
    font-weight: 500;
    letter-spacing: -0.055em;
    line-height: 1.02;
}

.hero h1 span {
    color: var(--link-color);
    font-style: italic;
}

.hero-description {
    max-width: 440px;
    margin: 22px 0 26px;
    color: var(--muted-color);
    font-size: 1.05rem;
}

.button {
    display: inline-flex;
    min-height: 50px;
    padding: 0 22px;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border: 0;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.button-primary {
    color: #fffdf9;
    background: var(--highlight-color);
    box-shadow: 0 8px 18px rgba(58, 68, 49, 0.16);
}

.button-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    background: #354b38;
    box-shadow: 0 12px 24px rgba(58, 68, 49, 0.2);
}

.hero-note {
    margin: 14px 0 0;
    color: var(--muted-color);
    font-size: 0.82rem;
}

.hero-image {
    position: relative;
    display: grid;
    min-height: 360px;
    padding: 28px;
    place-items: center;
    border: 1px solid var(--accent-color);
    border-radius: 48% 48% 24px 24px;
    background: #e8eee7;
    overflow: hidden;
}

.hero-image::before,
.hero-image::after {
    position: absolute;
    width: 260px;
    height: 260px;
    border: 1px solid rgba(140, 99, 75, 0.14);
    border-radius: 50%;
    content: "";
}

.hero-image::after {
    width: 320px;
    height: 320px;
}

.hero-image img {
    position: relative;
    z-index: 1;
    width: min(82%, 350px);
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 22px 50px rgba(62, 43, 26, 0.18);
}

.image-note {
    position: absolute;
    right: 18px;
    bottom: 20px;
    z-index: 2;
    padding: 9px 14px;
    border: 1px solid rgba(221, 206, 195, 0.8);
    border-radius: 999px;
    background: var(--card-color);
    color: var(--text-color);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 0.9rem;
    font-style: italic;
}

.section {
    padding: 76px 24px;
}

.menu-section {
    background: #eee7e1;
}

.section-heading {
    max-width: 620px;
    margin: 0 auto 34px;
    text-align: center;
}

.section-heading h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 2.8rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.2;
}

.section-heading > p:last-child {
    margin: 12px 0 0;
    color: var(--muted-color);
}

.menu-grid {
    display: grid;
    width: min(1040px, 100%);
    margin: 0 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.cookie-card {
    display: flex;
    min-height: 142px;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid rgba(221, 206, 195, 0.9);
    border-radius: 16px;
    background: var(--card-color);
    box-shadow: 0 5px 16px rgba(48, 41, 36, 0.035);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.cookie-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.cookie-image {
    flex: 0 0 92px;
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: var(--soft-color);
    object-fit: cover;
}

.cookie-card h3 {
    margin: 0 0 5px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.cookie-card p {
    margin: 0;
    color: var(--muted-color);
    font-size: 0.82rem;
    line-height: 1.5;
}

.faq-dialog {
    width: min(560px, calc(100% - 32px));
    max-height: min(80vh, 640px);
    margin: auto;
    padding: clamp(22px, 5vw, 36px);
    overflow-y: auto;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    background: var(--card-color);
    color: var(--text-color);
    box-shadow: 0 24px 70px rgba(34, 24, 17, 0.24);
}

.faq-dialog::backdrop {
    background: rgba(37, 29, 23, 0.56);
    backdrop-filter: blur(3px);
}

.faq-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.faq-dialog-header .eyebrow {
    margin-bottom: 0;
}

.faq-close {
    display: grid;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--accent-color);
    border-radius: 50%;
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.faq-dialog h2 {
    margin: 18px 0 10px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.6rem, 5vw, 2rem);
    font-weight: 500;
    line-height: 1.2;
}

.faq-dialog p {
    color: var(--muted-color);
    font-size: 0.94rem;
}

.faq-dialog a {
    color: var(--link-color);
    font-weight: 600;
}

.faq-done {
    margin-top: 10px;
}

.footer-faq-link {
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.order-section {
    padding-top: 66px;
}

.order-layout {
    display: grid;
    width: min(1040px, 100%);
    margin: 0 auto;
    align-items: start;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
}

.order-builder,
.order-summary {
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    background: var(--card-color);
    box-shadow: 0 8px 28px rgba(62, 43, 26, 0.055);
}

.order-builder {
    padding: clamp(22px, 4vw, 34px);
}

.step-heading {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.step-number {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 50%;
    background: #e8eee7;
    color: var(--highlight-color);
    font-size: 0.75rem;
    font-weight: 800;
}

.step-heading h3 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.step-heading p {
    margin: 3px 0 0;
    color: var(--muted-color);
    font-size: 0.84rem;
}

.box-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.order-size-card {
    display: flex;
    min-width: 0;
    min-height: 155px;
    padding: 12px 8px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 1px solid var(--accent-color);
    border-radius: 14px;
    background: var(--bg-color);
    color: var(--text-color);
    cursor: pointer;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.order-size-card:hover {
    transform: translateY(-2px);
    border-color: #b69a82;
    box-shadow: 0 8px 18px rgba(48, 41, 36, 0.08);
}

.order-size-card[aria-pressed="true"] {
    border: 2px solid var(--highlight-color);
    background: #eef2ed;
    box-shadow: 0 0 0 3px rgba(67, 93, 70, 0.1);
}

.box-image {
    width: 78px;
    height: 78px;
    margin-bottom: 5px;
    object-fit: contain;
}

.size {
    font-size: 0.87rem;
    font-weight: 700;
}

.box-price {
    color: var(--muted-color);
    font-size: 0.82rem;
}

.flavour-heading {
    margin: 32px 0 12px;
}

.flavour-list {
    border-top: 1px solid #eee7dc;
}

.cookie-amount-container {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #eee7dc;
}

.cookie-amount-container label {
    font-size: 0.93rem;
    font-weight: 600;
}

.counter {
    display: flex;
    min-width: 112px;
    align-items: center;
    justify-content: space-between;
    padding: 3px;
    border: 1px solid var(--accent-color);
    border-radius: 999px;
    background: var(--bg-color);
}

.counter button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    transition: background 150ms ease, color 150ms ease;
}

.counter button:hover:not(:disabled) {
    background: var(--highlight-color);
    color: white;
}

.counter button:disabled {
    color: #b8afa4;
    cursor: not-allowed;
}

.number {
    width: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-color);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
}

.order-message {
    min-height: 24px;
    margin: 14px 0 0;
    color: var(--muted-color);
    font-size: 0.84rem;
}

.order-message[data-state="error"] {
    color: #9c3e32;
    font-weight: 600;
}

.order-summary {
    position: sticky;
    top: 98px;
    padding: 26px;
}

.order-summary > .eyebrow {
    margin-bottom: 4px;
}

.order-summary h3 {
    margin: 0 0 18px;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.65rem;
    font-weight: 500;
}

.summary-box {
    display: flex;
    padding: 14px 0;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #eee7dc;
    border-bottom: 1px solid #eee7dc;
    font-weight: 600;
}

.summary-box strong {
    color: var(--link-color);
    font-size: 1.25rem;
}

.summary-count {
    margin: 14px 0;
    color: var(--muted-color);
    font-size: 0.87rem;
}

.summary-count span {
    color: var(--text-color);
    font-weight: 800;
}

#cookie-amount-summary {
    min-height: 72px;
    margin-bottom: 16px;
}

.empty-summary {
    margin: 0;
    color: #8d8176;
    font-size: 0.85rem;
}

.cookie-sum {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 0;
    color: var(--muted-color);
    font-size: 0.86rem;
}

.cookie-sum p {
    margin: 0;
}

.cookie-sum .quantity {
    order: 2;
    color: var(--text-color);
    font-weight: 700;
}

#order-button {
    width: 100%;
}

#order-button:disabled {
    box-shadow: none;
    background: #a5aa9d;
    cursor: not-allowed;
}

.summary-footnote {
    margin: 12px 0 0;
    color: var(--muted-color);
    font-size: 0.75rem;
    text-align: center;
}

.site-footer {
    padding: 42px 24px 0;
    background: var(--footer-color);
}

.footer-main,
.footer-bottom {
    display: flex;
    width: min(1040px, 100%);
    margin: 0 auto;
}

.footer-main {
    padding-bottom: 34px;
    justify-content: space-between;
    gap: 36px;
}

.footer-brand {
    max-width: 310px;
}

.footer-brand img {
    display: block;
    width: 92px;
    height: 92px;
    object-fit: contain;
}

.footer-brand p {
    margin: 12px 0 0;
    color: var(--muted-color);
    font-size: 0.9rem;
}

.footer-column {
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    font-size: 0.87rem;
}

.footer-column h2 {
    margin: 0 0 5px;
    font-size: 0.76rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.footer-column span {
    color: var(--muted-color);
}

.footer-bottom {
    min-height: 54px;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(117, 104, 93, 0.18);
    color: var(--muted-color);
    font-size: 0.77rem;
}

@media (max-width: 860px) {
    .hero {
        min-height: 0;
        grid-template-columns: 1fr 0.85fr;
        gap: 32px;
    }

    .hero-image {
        min-height: 300px;
    }

    .menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .order-layout {
        grid-template-columns: minmax(0, 1fr) 280px;
        gap: 16px;
    }

    .box-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    html {
        scroll-padding-top: 70px;
    }

    .site-nav {
        width: min(100% - 32px, 480px);
        min-height: 74px;
        gap: 12px;
    }

    .brand img {
        width: 58px;
        height: 58px;
    }

    .navbar {
        gap: 14px;
    }

    .navbar a {
        font-size: 0.77rem;
    }

    .hero {
        width: min(100% - 40px, 480px);
        padding: 48px 0 54px;
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .hero h1 {
        font-size: clamp(3.2rem, 14vw, 4.4rem);
    }

    .hero-description {
        font-size: 0.98rem;
    }

    .hero-image {
        min-height: 280px;
        border-radius: 44% 44% 22px 22px;
    }

    .section {
        padding: 56px 20px;
    }

    .menu-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .cookie-card {
        min-height: 120px;
    }

    .cookie-image {
        flex-basis: 78px;
        width: 78px;
        height: 78px;
    }

    .order-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .order-builder {
        padding: 22px 18px;
    }

    .order-summary {
        position: static;
    }

    .box-grid {
        gap: 9px;
    }

    .order-size-card {
        min-height: 142px;
    }

    .box-image {
        width: 68px;
        height: 68px;
    }

    .site-footer {
        padding: 32px 20px 0;
    }

    .footer-main {
        flex-wrap: wrap;
        gap: 28px 36px;
    }

    .footer-brand {
        flex-basis: 100%;
    }
}

@media (max-width: 380px) {
    .site-nav {
        width: calc(100% - 24px);
    }

    .brand img {
        width: 52px;
        height: 52px;
    }

    .navbar {
        gap: 9px;
    }

    .navbar a {
        font-size: 0.71rem;
    }

    .cookie-amount-container label {
        font-size: 0.86rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
