/* Overlays: drawers, modals, palette, compare and consult dialogs. */
/* ============ overlays ============ */
.overlay { position: fixed; inset: 0; z-index: 80; background: rgba(6, 4, 8, .55); backdrop-filter: blur(4px); opacity: 0; transition: opacity .26s; }
.overlay.open { opacity: 1; }
.drawer { position: absolute; top: 0; bottom: 0; width: min(440px, 100%); background: var(--bg); display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .32s var(--ease); }
.drawer-right .drawer { right: 0; transform: translateX(100%); border-left: 1px solid var(--line); }
.drawer-left .drawer { left: 0; transform: translateX(-100%); border-right: 1px solid var(--line); width: min(340px, 88%); }
.overlay.open .drawer { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 28px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.drawer-foot { padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: grid; gap: 12px; }
.ship-progress { padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 13px; margin-bottom: 14px; }
.ship-progress .meter { margin: 8px 0 0; }
.ship-progress .meter i { animation: none; transition: width .5s var(--ease); }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: start; }
.line-media { width: 72px; height: 72px; border-radius: 14px; background: var(--surface); display: grid; place-items: center; }
.line-media .gem-svg { width: 56px; height: 56px; }
.line-name { font-weight: 600; font-size: 14px; line-height: 1.35; }
.line-opts { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.line .qty { height: 34px; margin-top: 8px; }
.line .qty button { width: 30px; }
.line-right { text-align: right; display: grid; gap: 8px; justify-items: end; }
.line-right b { font-size: 15px; }
.link-btn { font-size: 12.5px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--vermilion); }
.coupon-row { display: flex; gap: 8px; }
.coupon-row .input { height: 42px; text-transform: uppercase; }
.coupon-msg { font-size: 12.5px; }
.coupon-msg.ok { color: var(--ok); } .coupon-msg.bad { color: var(--vermilion); }
.totals { display: grid; gap: 6px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 700; padding-top: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.totals .save { color: var(--ok); }
.cart-empty { text-align: center; padding: 60px 10px; display: grid; gap: 14px; justify-items: center; }
.cart-empty h3 { font-size: 28px; }

/* minmax(0, 1fr): the dialog is sized by the screen, never by its widest row. */
.overlay.center { display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 8vh 16px 16px; overflow-y: auto; }
.modal { position: relative; width: min(560px, 100%); background: var(--bg); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; transform: translateY(12px) scale(.98); transition: transform .3s var(--ease); }
.modal-wide { width: min(980px, 100%); }
.overlay.open .modal, .overlay.open .palette { transform: none; }
.modal-x { position: absolute; top: 12px; right: 12px; z-index: 2; }
.modal h2 { font-size: 32px; margin-bottom: 6px; }

.palette { width: min(680px, 100%); background: var(--bg); border: 1px solid var(--line-2); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; transform: translateY(-8px); transition: transform .25s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; height: 60px; border: 0; background: none; font-size: 17px; outline: none; }
.palette-results { max-height: 60vh; overflow-y: auto; padding: 8px; }
.pal-group { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 6px; }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.pal-item[aria-selected="true"], .pal-item:hover { background: var(--surface); }
.pal-item .gem-svg { width: 40px; height: 40px; }
.pal-item .pal-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--gold); font-size: 18px; }
.pal-item b { display: block; font-size: 14.5px; font-weight: 600; }
.pal-item small { color: var(--muted); font-size: 12.5px; }
.pal-item .price { margin-left: auto; font-weight: 700; font-size: 14px; }
.pal-empty { padding: 30px; text-align: center; color: var(--muted); }

.qv { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.qv .stage { cursor: default; }

/* compare */
.compare-tray { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; display: flex; gap: 12px; align-items: center; padding: 10px 10px 10px 18px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); animation: rise .35s var(--ease); }
.compare-tray .slots { display: flex; gap: 6px; }
.compare-tray .slot { width: 42px; height: 42px; border-radius: 50%; border: 1px dashed var(--line-2); display: grid; place-items: center; background: var(--bg-2); }
.compare-tray .slot .gem-svg { width: 34px; height: 34px; }
.compare-tray span { font-size: 13.5px; font-weight: 600; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmp-table th, .cmp-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table th { color: var(--muted); font-weight: 500; font-size: 12.5px; text-transform: uppercase; letter-spacing: .08em; width: 140px; }
.cmp-table .gem-svg { width: 110px; height: 110px; }
.cmp-table .best { color: var(--ok); font-weight: 700; }
.cmp-scroll { overflow-x: auto; margin-top: 16px; }

/* consult */
.expert-list { display: grid; gap: 8px; margin: 18px 0; }
.expert { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 12px; border-radius: 14px; border: 1px solid var(--line-2); text-align: left; transition: all .2s; position: relative; }
.expert input { position: absolute; opacity: 0; }
.expert:has(input:checked) { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 9%, transparent); }
.expert .avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--gold-ink); background: linear-gradient(135deg, var(--gold-2), var(--gold)); }
.expert > span { min-width: 0; }
.expert b { font-size: 14.5px; display: block; }
.expert small { color: var(--muted); font-size: 12.5px; }
.date-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.date-chip { flex: none; width: 62px; padding: 10px 0; border-radius: 14px; border: 1px solid var(--line-2); text-align: center; display: grid; transition: all .2s; }
.date-chip small { font-size: 11px; color: var(--muted); text-transform: uppercase; }
.date-chip b { font-size: 18px; }
.date-chip[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.date-chip[aria-pressed="true"] small { color: inherit; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; margin-top: 12px; }
.slot-btn { height: 38px; border-radius: 10px; border: 1px solid var(--line-2); font-size: 13.5px; font-weight: 600; transition: all .15s; }
.slot-btn:hover:not([disabled]) { border-color: var(--gold); }
.slot-btn[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }
.slot-btn[disabled] { opacity: .3; text-decoration: line-through; cursor: not-allowed; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.success { text-align: center; padding: 10px 0; display: grid; gap: 12px; justify-items: center; }
.success .tick { width: 72px; height: 72px; border-radius: 50%; background: color-mix(in srgb, var(--ok) 18%, transparent); display: grid; place-items: center; }
.success .tick svg { width: 34px; height: 34px; fill: none; stroke: var(--ok); stroke-width: 2.4; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .6s var(--ease) forwards .15s; }
@keyframes draw { to { stroke-dashoffset: 0; } }

