/* Event pricing (תמחור אירוע). Every class is qt-*.
   Colours come from the app's variables in styles/01-base.css, so dark mode
   follows without rules of its own. */

.qt-inputs,
.qt-search,
.qt-summary,
.qt-cat {
    background: var(--bg-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

/* ---- header inputs ---------------------------------------------------- */
.qt-inputs {
    display: grid;
    grid-template-columns: minmax(160px, 1.3fr) minmax(110px, .7fr) minmax(220px, 1.3fr) minmax(200px, 1.4fr);
    gap: 12px 16px;
    align-items: end;
    padding: 16px 18px;
    margin-bottom: 14px;
}
.qt-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.qt-label { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.qt-field input[type="text"],
.qt-field input[type="number"] {
    min-height: 42px;
    width: 100%;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    box-sizing: border-box;
}
.qt-field input:focus { outline: none; border-color: var(--border-focus); }
.qt-charge { display: flex; gap: 8px; align-items: stretch; }
.qt-charge input { flex: 1 1 auto; min-width: 0; }
.qt-mode {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 3px;
    border-radius: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
}
.qt-mode-btn {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    padding: 0 12px;
    border-radius: 8px;
    cursor: pointer;
}
.qt-mode-btn.active { background: var(--bg-solid); color: var(--text-primary); box-shadow: var(--shadow-sm); }

/* ---- notices ---------------------------------------------------------- */
#qt-notice:empty { display: none; }
.qt-note {
    margin-bottom: 14px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13.5px;
    line-height: 1.55;
    background: var(--warning-bg);
    border-inline-start: 4px solid var(--warning);
    color: var(--text-primary);
}
.qt-note-info { background: var(--accent-light); border-inline-start-color: var(--primary-color); }
.qt-note ul { margin: 4px 0 0; padding-inline-start: 18px; }
.qt-note-close {
    float: left;
    border: 0;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
}

/* ---- layout ----------------------------------------------------------- */
.qt-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 18px;
    align-items: start;
}
.qt-summary {
    position: sticky;
    top: 16px;
    padding: 18px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    box-sizing: border-box;
}

/* ---- dish picker ------------------------------------------------------ */
.qt-search { margin-bottom: 12px; }
.qt-drinks {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    cursor: pointer;
}
.qt-cat { padding: 6px 0; margin-bottom: 12px; overflow: hidden; }
.qt-cat-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0;
    padding: 8px 16px 6px;
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}
.qt-cat-title span { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.qt-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 16px;
    border-top: 1px solid var(--divider-color);
}
.qt-row.is-picked { background: var(--success-bg); }
.qt-row-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.qt-row-name { font-size: 14.5px; font-weight: 600; color: var(--text-primary); overflow-wrap: anywhere; }
.qt-row-meta { font-size: 12.5px; color: var(--text-secondary); }
.qt-row-meta b { font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.qt-flag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    margin-inline-start: 6px;
    border-radius: 50%;
    background: var(--warning);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    vertical-align: 1px;
    cursor: help;
}
.qt-empty { padding: 28px 16px; text-align: center; font-size: 14px; color: var(--text-muted); }

.qt-step { display: inline-flex; align-items: center; flex: 0 0 auto; gap: 4px; }
.qt-step button {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}
.qt-step button:hover { border-color: var(--text-muted); }
.qt-step button:disabled { opacity: .35; cursor: default; }
.qt-step input {
    width: 56px;
    height: 34px;
    text-align: center;
    border-radius: 9px;
    border: 1px solid var(--border-color);
    background: var(--bg-solid);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    -moz-appearance: textfield;
    appearance: textfield;
}
.qt-step input::-webkit-outer-spin-button,
.qt-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qt-step input:focus { outline: none; border-color: var(--border-focus); }

/* ---- summary ---------------------------------------------------------- */
.qt-sum-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.qt-sum-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 16px; font-weight: 800; color: var(--text-primary); overflow-wrap: anywhere; }
.qt-sum-sub { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.qt-profit {
    padding: 14px;
    border-radius: 12px;
    background: var(--bg-input);
    margin-bottom: 12px;
}
.qt-profit-label { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.qt-profit-value { display: block; font-size: 28px; font-weight: 800; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.qt-kv { display: flex; flex-direction: column; margin: 0 0 12px; }
.qt-kv > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 0;
    border-bottom: 1px solid var(--divider-color);
    font-size: 14px;
}
.qt-kv dt { flex: 1 1 auto; color: var(--text-secondary); }
.qt-kv dd { margin: 0; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.qt-kv small { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-muted); }
.qt-pct {
    direction: ltr;
    unicode-bidi: isolate;
    display: inline-block;
    min-width: 40px;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
    background: var(--bg-input);
    color: var(--text-secondary);
}
.qt-tone-good { color: var(--success); }
.qt-tone-warn { color: var(--warning); }
.qt-tone-bad { color: var(--danger); }
.qt-pct.qt-tone-good { background: var(--success-bg); }
.qt-pct.qt-tone-warn { background: var(--warning-bg); }
.qt-pct.qt-tone-bad { background: var(--danger-bg); }
.qt-section-title { margin: 14px 0 6px; font-size: 12.5px; font-weight: 800; color: var(--text-secondary); }
.qt-perguest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-bottom: 4px; }
.qt-perguest div { padding: 8px 10px; border-radius: 10px; background: var(--bg-input); font-size: 12px; color: var(--text-secondary); }
.qt-perguest b { display: block; font-size: 14.5px; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.qt-lines { list-style: none; margin: 0; padding: 0; }
.qt-lines li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--divider-color);
    font-size: 13px;
}
.qt-lines .qt-line-name { flex: 1 1 auto; min-width: 0; color: var(--text-primary); overflow-wrap: anywhere; }
.qt-lines .qt-line-calc { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.qt-lines .qt-line-total { font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qt-line-remove {
    border: 0;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 0 2px;
}
.qt-line-remove:hover { color: var(--danger); }
.qt-warn {
    margin-top: 12px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 12.5px;
    line-height: 1.55;
    background: var(--warning-bg);
    border-inline-start: 4px solid var(--warning);
    color: var(--text-primary);
}
.qt-warn b { color: var(--warning); }
.qt-sum-empty { font-size: 14px; line-height: 1.6; color: var(--text-muted); margin: 0; }
.qt-bar { display: none; }

/* ---- narrower screens ------------------------------------------------- */
@media (max-width: 1100px) {
    .qt-inputs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .qt-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* Phone: the summary leaves the flow and becomes a sheet that opens from a
   bar parked above the bottom nav (64px tall in styles.css). */
@keyframes qt-fade-in { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 768px) {
    /* Every view slides in with a transform (fadeInUp in styles.css). A
       transformed ancestor becomes the box that position: fixed is measured
       from, so for those 0.6s the bar and sheet below sat far down the page.
       This view fades in without moving. */
    #view-quote.view { animation-name: qt-fade-in; }

    .qt-inputs { grid-template-columns: 1fr 1fr; padding: 14px; }
    .qt-field-name, .qt-field-charge, .qt-field-source { grid-column: 1 / -1; }
    .qt-layout { grid-template-columns: 1fr; }
    .qt-picker { padding-bottom: 72px; }
    .qt-row { padding: 9px 12px; gap: 8px; }
    .qt-step button { width: 38px; height: 38px; }
    .qt-step input { width: 48px; height: 38px; }

    .qt-summary {
        display: none;
        position: fixed;
        top: auto;
        left: 8px;
        right: 8px;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 62px);
        max-height: 62vh;
        z-index: 290;
        box-shadow: var(--shadow-lg);
    }
    .qt-layout.qt-open .qt-summary { display: block; }

    /* Shares its band with the guide launcher (src/guide/guide.css), which
       sits at the left edge 12px above the nav, so the bar starts after it. */
    .qt-bar {
        display: flex;
        align-items: center;
        gap: 10px;
        position: fixed;
        left: 108px;
        right: 8px;
        bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 10px);
        z-index: 291;
        min-height: 46px;
        padding: 8px 14px;
        border-radius: 12px;
        border: 1px solid var(--border-color);
        background: var(--bg-solid);
        color: var(--text-primary);
        box-shadow: var(--shadow-lg);
        font-size: 14px;
        font-weight: 700;
        cursor: pointer;
        text-align: start;
    }
    .qt-bar-main { flex: 1 1 auto; min-width: 0; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .qt-bar-main b { font-variant-numeric: tabular-nums; }
    .qt-bar-arrow { flex: 0 0 auto; transition: transform .2s ease; }
    .qt-bar[aria-expanded="true"] .qt-bar-arrow { transform: rotate(180deg); }
}

/* The shared dropdown menu paints var(--bg-surface, #fff), and --bg-surface is
   not defined anywhere, so in dark mode its light text sits on white. Fixed
   here for this screen only; the global fix belongs in styles.css. */
#qt-source-dd .ezra-dropdown-menu { background: var(--bg-solid); }
