/* ══════════════════════════════════════════════════════════════════
   Waffle Tone — menu-modal.css
   Item detail modal overlay styles
══════════════════════════════════════════════════════════════════ */

/* Overlay backdrop */
.wt-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(15, 2, 6, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: 80px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.wt-modal-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

/* Modal panel */
.wt-modal {
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 80px);
    background: var(--bg-modal);
    border: 1px solid var(--gold-border);
    border-radius: var(--radius-modal) var(--radius-modal) 0 0;
    box-shadow: var(--shadow-modal);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
    overflow: hidden;
}

.wt-modal-overlay.is-open .wt-modal {
    transform: translateY(0);
}

/* Drag handle */
.wt-modal__handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--outline-variant);
    margin: 1rem auto 0;
    flex-shrink: 0;
}

/* Modal header */
.wt-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem 1rem;
    flex-shrink: 0;
}

.wt-modal__item-name {
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--text-ivory);
    letter-spacing: 0.03em;
    line-height: 1.25;
}

.wt-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-hover);
    border: 1px solid var(--gold-border);
    color: var(--text-on-surface-var);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    margin-top: 2px;
    margin-inline-start: 1rem;
}

.wt-modal__close:hover {
    background: var(--bg-container-highest);
    color: var(--text-ivory);
}

/* Scrollable body */
.wt-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 0 1.5rem;
}

/* Item image in modal */
.wt-modal__img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-card);
    margin-bottom: 1rem;
    border: 1px solid var(--gold-border);
    display: block;
}

.wt-modal__img-placeholder {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-card);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--bg-hover) 0%, var(--bg-container-highest) 50%, var(--bg-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--gold-border);
    position: relative;
    overflow: hidden;
}

.wt-modal__img-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 40%, rgba(212,175,122,0.1) 0%, transparent 65%);
}

.wt-modal__img-placeholder .material-symbols-outlined {
    font-size: 3.5rem;
    color: var(--gold-deep);
    opacity: 0.4;
    position: relative;
    z-index: 1;
}

/* Description */
.wt-modal__desc {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 1.5rem;
}

/* Section headers within modal */
.wt-modal__section-title {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gold-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

[dir="rtl"] .wt-modal__section-title {
    flex-direction: row-reverse;
    text-transform: none;
    letter-spacing: 0;
}

/* Edition selector (Classic / Premium) */
.wt-edition-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.wt-edition-btn {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-card);
    background: var(--bg-base);
    border: 2px solid var(--gold-border);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.wt-edition-btn:hover {
    border-color: var(--gold-border-hover);
    background: var(--bg-container);
}

.wt-edition-btn.is-selected {
    border-color: var(--gold-primary);
    background: rgba(212,175,122,0.08);
    box-shadow: 0 0 0 1px rgba(212,175,122,0.2) inset;
}

.wt-edition-btn__name {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-ivory);
    letter-spacing: 0.04em;
}

.wt-edition-btn__price {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gold-primary);
}

.wt-edition-btn__currency {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Toppings list */
.wt-toppings-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    max-height: 260px;
    overflow-y: auto;
}

.wt-topping-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    background: var(--bg-base);
    border: 1px solid var(--gold-border);
    transition: var(--transition);
    cursor: pointer;
    gap: 0.75rem;
}

.wt-topping-row:hover {
    background: var(--bg-container);
    border-color: var(--gold-border-hover);
}

.wt-topping-row.is-checked {
    background: rgba(212,175,122,0.06);
    border-color: var(--gold-primary);
}

.wt-topping-row__left {
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.wt-topping-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 2px solid var(--outline);
    background: var(--bg-card);
    flex-shrink: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.wt-topping-row.is-checked .wt-topping-checkbox {
    background: var(--gold-primary);
    border-color: var(--gold-primary);
}

.wt-topping-checkbox .material-symbols-outlined {
    font-size: 0.8125rem;
    color: var(--text-on-gold);
    display: none;
}

.wt-topping-row.is-checked .wt-topping-checkbox .material-symbols-outlined {
    display: block;
}

.wt-topping-name {
    font-size: 0.875rem;
    color: var(--text-champagne);
}

.wt-topping-price {
    font-size: 0.8125rem;
    color: var(--gold-primary);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

[dir="rtl"] .wt-topping-row {
    flex-direction: row-reverse;
}

[dir="rtl"] .wt-topping-row__left {
    flex-direction: row-reverse;
}

/* Notes field */
.wt-modal__notes {
    margin-bottom: 1.5rem;
}

/* Modal footer / CTA */
.wt-modal__footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--gold-border);
    background: var(--bg-hover);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.wt-modal__price-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wt-modal__price-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-on-surface-var);
}

.wt-modal__price-total {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gold-primary);
}

[dir="rtl"] .wt-modal__price-display {
    flex-direction: row-reverse;
}

[dir="rtl"] .wt-modal__footer {
    direction: rtl;
}

/* Desktop center modal */
@media (min-width: 640px) {
    .wt-modal-overlay {
        align-items: center;
        padding: 2rem;
    }

    .wt-modal {
        border-radius: var(--radius-modal);
        max-height: calc(100vh - 100px);
        transform: translateY(20px) scale(0.98);
    }

    .wt-modal-overlay.is-open .wt-modal {
        transform: translateY(0) scale(1);
    }
}
