/* ===================================================================
   Favorites + Reorder (Prompt 5)
   Hearts, compact reorder card, favorites row, review sheet, login sheet.
   =================================================================== */

/* ---------------- hearts ---------------- */
.menu-item__fav,
.menu-carousel__fav {
    position: absolute;
    top: var(--space-xs);
    right: var(--space-xs);
    z-index: 4;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text-muted);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform var(--transition-base), color var(--transition-base), background var(--transition-base);
}

.menu-item__fav:hover,
.menu-carousel__fav:hover {
    transform: scale(1.06);
    color: var(--color-brand-orange);
}

.menu-item__fav:focus-visible,
.menu-carousel__fav:focus-visible,
.menu-sheet__fav:focus-visible,
.menu-fav__hit:focus-visible,
.menu-fav__remove:focus-visible,
.menu-reorder-sheet button:focus-visible,
.menu-login-sheet button:focus-visible,
.menu-login-sheet input:focus-visible {
    outline: var(--focus-ring-width) solid var(--color-brand-orange);
    outline-offset: 2px;
}

.menu-item__fav.is-fav,
.menu-carousel__fav.is-fav {
    color: var(--color-brand-orange);
}

.menu-item__fav.is-fav svg,
.menu-carousel__fav.is-fav svg,
.menu-sheet__fav.is-fav svg {
    fill: currentColor;
}

/* Sheet heart (product modal) — anchored top-left so it never collides with
   the top-right close button. */
.menu-sheet__fav {
    position: absolute;
    top: var(--space-xs);
    left: var(--space-xs);
    z-index: 4;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text-muted);
    box-shadow: var(--shadow-card);
    cursor: pointer;
    transition: transform var(--transition-base), color var(--transition-base);
}

.menu-sheet__fav:hover { transform: scale(1.06); color: var(--color-brand-orange); }
.menu-sheet__fav.is-fav { color: var(--color-brand-orange); }
.menu-sheet__fav.is-fav svg { fill: currentColor; }

/* ---------------- reorder + favorites zone ---------------- */
.menu-reorder-fav {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-md) var(--space-md) 0;
    max-width: 1080px;
    margin: 0 auto;
}

/* ---------------- reorder card ---------------- */
.menu-reorder {
    border: 1px solid var(--color-border-light);
    border-left: 4px solid var(--color-brand-orange);
    border-radius: var(--radius-lg);
    background: var(--color-bg-white);
    box-shadow: var(--shadow-card);
    padding: var(--space-md);
}

.menu-reorder__state {
    min-height: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-sm);
    color: var(--color-text-secondary);
}

.menu-reorder__lead {
    margin: 0;
    font-size: 0.95rem;
}

.menu-reorder__card {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.menu-reorder__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
}

.menu-reorder__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: clamp(17px, 2.4vw, 21px);
    font-weight: 700;
    letter-spacing: normal;
}

.menu-reorder__date {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.menu-reorder__lines {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2xs) var(--space-md);
}

.menu-reorder__line {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2xs);
    font-size: 0.9rem;
    color: var(--color-text-primary);
}

.menu-reorder__line-name { font-weight: 600; }
.menu-reorder__line-qty { color: var(--color-text-muted); }
.menu-reorder__line.is-more { color: var(--color-text-muted); }

.menu-reorder__foot {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm) var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-border-light);
}

.menu-reorder__meta {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.menu-reorder__estimate {
    margin-left: auto;
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2xs);
}

.menu-reorder__estimate-label {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.menu-reorder__estimate-value {
    font-weight: 700;
    font-size: 1.05rem;
}

/* ---------------- favorites row ---------------- */
.menu-fav__head { margin-bottom: var(--space-sm); }

.menu-fav__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: clamp(17px, 2.4vw, 21px);
    font-weight: 700;
    letter-spacing: normal;
}

.menu-fav__state { color: var(--color-text-secondary); font-size: 0.95rem; }

.menu-fav__row {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: var(--space-xs);
    -webkit-overflow-scrolling: touch;
}

.menu-fav__chip {
    position: relative;
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: clamp(150px, 34vw, 190px);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-md);
    background: var(--color-bg-white);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.menu-fav__chip.is-unavailable { opacity: 0.72; }

.menu-fav__hit {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    width: 100%;
    min-height: 72px;
    padding: var(--space-sm) var(--space-md) var(--space-md);
    text-align: left;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.menu-fav__icon {
    position: absolute;
    top: var(--space-2xs);
    left: var(--space-sm);
    color: var(--color-brand-orange);
    font-size: 1rem;
    line-height: 1;
}

.menu-fav__name {
    padding-top: var(--space-xs);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.15;
}

.menu-fav__price {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}

.menu-fav__badge {
    align-self: flex-start;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.menu-fav__remove {
    position: absolute;
    top: var(--space-2xs);
    right: var(--space-2xs);
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.05rem;
    line-height: 1;
}

.menu-fav__remove:hover { color: var(--color-danger, #c0392b); }

/* ---------------- reorder review sheet ---------------- */
.menu-reorder-overlay {
    position: fixed;
    inset: 0;
    z-index: 230;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--color-overlay-backdrop);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.menu-reorder-overlay[hidden] { display: none; }
.menu-reorder-overlay.is-open { opacity: 1; }

.menu-reorder-sheet {
    width: 100%;
    max-width: 640px;
    max-height: 92dvh;
    background: var(--color-bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-modal);
    transform: translateY(100%);
    transition: transform var(--transition-base);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.menu-reorder-overlay.is-open .menu-reorder-sheet { transform: translateY(0); }

.menu-reorder-sheet__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    z-index: 2;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
}

.menu-reorder-sheet__head {
    position: relative;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    border-bottom: 1px solid var(--color-border-light);
}

.menu-reorder-sheet__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: clamp(18px, 2.6vw, 22px);
    font-weight: 700;
    letter-spacing: normal;
}

.menu-reorder-sheet__date {
    margin: var(--space-2xs) 0 0;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.menu-reorder-sheet__lines {
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

.menu-reorder-sheet__line {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--color-border-light);
}

.menu-reorder-sheet__line-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-sm);
}

.menu-reorder-sheet__line-title { font-weight: 700; line-height: 1.2; }

.menu-reorder-sheet__badge {
    flex: 0 0 auto;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: var(--color-bg-cream);
    color: var(--color-text-secondary);
}

.menu-reorder-sheet__badge.is-added_exact,
.menu-reorder-sheet__badge.is-added_current_price_changed,
.menu-reorder-sheet__badge.is-added_partial_config {
    background: #E7F4EA;
    color: #1E7B3C;
}

.menu-reorder-sheet__badge.is-requires_reselection { background: #FFF1E0; color: #A85D00; }
.menu-reorder-sheet__badge.is-skipped_out_of_stock,
.menu-reorder-sheet__badge.is-skipped_inactive_or_missing,
.menu-reorder-sheet__badge.is-skipped_reward_gift { background: #F4F0EC; color: var(--color-text-muted); }

.menu-reorder-sheet__line-sub {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-2xs);
}

.menu-reorder-sheet__qty { color: var(--color-text-muted); font-size: 0.9rem; }
.menu-reorder-sheet__price { font-size: 0.9rem; font-weight: 600; }
.menu-reorder-sheet__price del { color: var(--color-text-muted); font-weight: 400; margin-right: 0.15rem; }

.menu-reorder-sheet__notes {
    list-style: none;
    margin: var(--space-sm) 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
}

.menu-reorder-sheet__notes li {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.menu-reorder-sheet__reselect {
    margin-left: auto;
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--color-brand-orange);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-brand-orange);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.menu-reorder-sheet__summary {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: var(--color-bg-cream);
    font-size: 0.95rem;
}

.menu-reorder-sheet__estimate { font-weight: 700; font-size: 1.1rem; }

.menu-reorder-sheet__actions {
    padding: var(--space-md) var(--space-lg) calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.menu-reorder-sheet__actions .btn-outline { width: 100%; }

.menu-reorder-sheet__busy {
    margin: 0;
    text-align: center;
    color: var(--color-text-secondary);
}

.menu-reorder-sheet__confirm {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.menu-reorder-sheet__confirm p { margin: 0; font-size: 0.95rem; }

.menu-reorder-sheet__confirm-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* ---------------- login sheet ---------------- */
.menu-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 240;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--color-overlay-backdrop);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.menu-login-overlay[hidden] { display: none; }
.menu-login-overlay.is-open { opacity: 1; }

.menu-login-sheet {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: var(--color-bg-white);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-modal);
    transform: translateY(100%);
    transition: transform var(--transition-base);
    padding: var(--space-xl) var(--space-lg) calc(var(--space-lg) + env(safe-area-inset-bottom, 0px));
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.menu-login-overlay.is-open .menu-login-sheet { transform: translateY(0); }

.menu-login-sheet__close {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--color-text-secondary);
    font-size: 1.4rem;
    cursor: pointer;
}

.menu-login-sheet__title {
    margin: 0;
    font-family: var(--font-body);
    font-size: clamp(18px, 2.6vw, 22px);
    font-weight: 700;
    letter-spacing: normal;
}

.menu-login-sheet__form {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.menu-login-sheet__field {
    display: flex;
    flex-direction: column;
    gap: var(--space-2xs);
    font-size: 0.9rem;
    font-weight: 600;
}

.menu-login-sheet__field input {
    font: inherit;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--color-border-medium);
    border-radius: var(--radius-sm);
    background: var(--color-bg-white);
}

.menu-login-sheet__error {
    margin: 0;
    color: var(--color-danger, #c0392b);
    font-size: 0.88rem;
}

/* ---------------- responsive ---------------- */
@media (max-width: 560px) {
    .menu-reorder-fav { padding: var(--space-sm) var(--space-sm) 0; }
    .menu-reorder__foot { flex-direction: column; align-items: stretch; }
    .menu-reorder__estimate { margin-left: 0; justify-content: space-between; }
    .menu-reorder__estimate-label { flex: 1; }
}
