/* Палитра со скриншота: зелёный, серый, оранжевый */

:root {
    --green: #1a6740;
    --green-muted: #4d8066;
    --line: color-mix(in srgb, var(--green) 32%, #e8eee9);
    --line-strong: color-mix(in srgb, var(--green) 48%, #d5e4db);
    --gray: #f2f2f2;
    --gray-mid: #e6e6e6;
    --orange: #ec732f;
    --orange-hover: color-mix(in srgb, var(--orange) 8%, #ffffff);
    --green-selected: color-mix(in srgb, var(--green) 12%, #f4f7f5);
    --green-selected-line: color-mix(in srgb, var(--green) 28%, #d7e3dc);
    --option-wait: #c43c3c;
    --option-wait-bg: #fff4f4;
    --option-wait-line: #e07070;
    --orange-muted: color-mix(in srgb, var(--orange) 38%, #d8d8d8);
    --ink: #1a1a1a;
    --gray-text: #8a8a8a;
    --gray-border: #cfcfcf;
    --text: #1a6740;
    --text-soft: #4d8066;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

body {
    background-color: var(--gray);
    background-image: url('../../images/food-doodle-bg-tile-pale.png');
    background-repeat: repeat;
    background-size: calc(1024px / 2);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

.app {
    max-width: 880px;
    width: 100%;
    background: var(--white);
    border-radius: 32px;
    box-shadow: 0 16px 40px -12px rgba(26, 103, 64, 0.16);
    padding: 24px 20px 36px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding-bottom: 0;
    border-bottom: 2px solid var(--line);
}

.header-brand {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--orange);
    line-height: 1.1;
    margin: 0;
    padding: 0 0 12px;
}

.header-logo {
    width: 96px;
    height: 96px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    vertical-align: bottom;
}

.date-badge {
    font-size: 0.9rem;
    background: var(--gray);
    color: var(--green-muted);
    padding: 4px 18px;
    border-radius: 40px;
    border: 1px solid var(--line);
    margin-bottom: 12px;
    align-self: flex-end;
}

.section {
    margin-top: 24px;
    border-radius: 24px;
    background: var(--white);
    border: 1.5px solid var(--line);
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    cursor: pointer;
    background: var(--white);
    user-select: none;
    gap: 12px;
    flex-wrap: wrap;
}

.section-header:hover {
    background: var(--orange-hover);
}

.section-header .title {
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--green);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.section-header .title .chosen {
    font-weight: 400;
    color: var(--orange);
    font-size: 0.9rem;
}

.section-header .chevron {
    font-size: 1.2rem;
    color: var(--green-muted);
    transition: transform 0.25s;
}

.section-body {
    padding: 0 8px 18px 8px;
    display: none;
    flex-direction: column;
    gap: 6px;
}

.section.open .section-body {
    display: flex;
}

.section.open .chevron {
    transform: rotate(180deg);
}

.pick-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px;
}

.pick-block .menu-grid {
    padding: 0;
}

.menu-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 0 8px;
}

.menu-item {
    background: var(--white);
    border-radius: 14px;
    padding: 12px 18px;
    border: 1.5px solid var(--line);
    color: var(--ink);
    cursor: pointer;
    transition: all 0.12s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.menu-item:hover {
    background: var(--orange-hover);
    border-color: var(--orange-muted);
}

.menu-item.selected {
    background: var(--green-selected);
    border-color: var(--green-selected-line);
    box-shadow: none;
    color: var(--ink);
}

.menu-item.selected:hover {
    background: var(--green-selected);
    border-color: var(--green-selected-line);
}

.menu-item .label {
    display: block;
    font-weight: 500;
}

.menu-item.item-card {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
}

.menu-item.item-card .item-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6px 10px;
    width: 100%;
}

.menu-item .item-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    flex: 1;
}

.menu-item .item-details {
    font-size: 0.78rem;
    line-height: 1.35;
    font-weight: 400;
    color: var(--gray-text);
}

.menu-item.item-card .badge.garnish-needed,
.menu-item.item-card .option-pills {
    align-self: flex-start;
}

.option-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.option-pill {
    appearance: none;
    font-family: inherit;
    cursor: pointer;
    line-height: 1.3;
}

.option-pills.waiting .option-pill {
    background: var(--option-wait-bg);
    border-color: var(--option-wait-line);
    color: var(--option-wait);
}

.option-pill.picked {
    background: color-mix(in srgb, var(--green) 16%, #ffffff);
    border-color: var(--green);
    color: var(--green);
    font-weight: 600;
}

.menu-item .badge {
    font-size: 0.7rem;
    background: var(--gray);
    padding: 2px 12px;
    border-radius: 30px;
    font-weight: 500;
    color: var(--green-muted);
    border: 1px solid var(--line);
}

.menu-item .badge.garnish-needed,
.menu-item .badge.option-needed {
    background: var(--white);
    color: var(--gray-text);
    border-color: var(--gray-border);
}

.check-mark {
    color: var(--orange-muted);
    font-weight: 600;
    font-size: 1.2rem;
}

.hidden-item {
    display: none !important;
}

.cancel-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    margin-left: 0;
    background: transparent;
    border: 1px solid var(--gray-border);
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    color: var(--gray-text);
    cursor: pointer;
    transition: 0.15s;
    flex-shrink: 0;
    font-family: inherit;
}

.cancel-btn:hover {
    background: var(--gray);
    border-color: #b8b8b8;
    color: #5a5a5a;
}

.selected-with-cancel {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
    margin-left: auto;
    flex-shrink: 0;
}

.garnish-area {
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: none;
}

.garnish-area.visible {
    display: block;
}

.garnish-prompt {
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--green);
}

.garnish-prompt.hidden {
    display: none;
}

.garnish-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.garnish-item.hidden-item {
    display: none !important;
}

.summary {
    margin-top: 32px;
    padding: 18px 22px 22px;
    background: var(--gray);
    border-radius: 24px;
    border-left: 6px solid var(--green);
}

.summary h3 {
    font-weight: 500;
    color: var(--green);
    margin-bottom: 10px;
    font-size: 1.05rem;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--green);
}

.summary-list .empty {
    opacity: 0.6;
    font-style: italic;
}

.summary-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.copy-btn {
    appearance: none;
    border: 1.5px solid var(--orange);
    background: var(--white);
    color: var(--orange);
    border-radius: 40px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: 0.15s;
}

.copy-btn:hover {
    background: var(--orange-hover);
}

.copy-btn.copied {
    border-color: var(--green);
    color: var(--green);
}

.reset-link {
    display: inline-block;
    color: var(--orange);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.reset-link:hover {
    color: var(--green);
}

.footer {
    margin-top: 24px;
    text-align: center;
    color: var(--green-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--line);
    padding-top: 20px;
}

@media (min-width: 600px) {
    .menu-grid {
        grid-template-columns: 1fr 1fr;
    }
    .garnish-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 480px) {
    .app {
        padding: 16px 12px;
    }
    .section-header {
        padding: 12px 16px;
    }
    .menu-item {
        padding: 10px 14px;
    }
    .garnish-item {
        padding: 10px 14px;
    }
}
