/* cart.css: cart lines (a pencil opens the details), the choice fields (also used on the shade page) and the compact fabric picker. */


/* ---------- Lines: one or two rows each, a pencil on the right ---------- */
.line { padding: 12px 0; border-bottom: 1px solid var(--line); }
.line:first-child { padding-top: 0; }
.line-compact { display: grid; grid-template-columns: 56px minmax(0, 1fr) 40px; gap: 12px; align-items: center; }
.line-img img { display: block; width: 56px; height: 56px; object-fit: contain; background: #faf9f7; border-radius: 6px; }
.line-body { min-width: 0; }
.line-r1 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.line-title { font-weight: 650; color: var(--head); text-decoration: none; min-width: 0; }
.line-title:hover { text-decoration: underline; }
.line-total { font-weight: 700; white-space: nowrap; }
.line-r2 { margin-top: 2px; font-size: .86rem; color: var(--muted); }
.line-sum { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-need { color: var(--danger); font-weight: 600; }
.line-edit-btn { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--head); cursor: pointer; }
.line-edit-btn:hover, .line-edit-btn[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.line-edit-btn.is-prompt { border-color: var(--accent); background: #fff7e8; }

/* ---------- Details panel: opens only when asked ---------- */
.line-edit { margin: 12px 0 0; }
.js .line-edit.is-collapsed { display: none; }
.edit-qty { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 12px 0; }
.edit-qty label { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: .92rem; color: var(--head); }
.edit-qty .qty-input { width: 72px; }
.edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.clear-form { margin-top: 12px; }

/* ---------- Order summary and how to continue ---------- */
.checkout .sum-rows { margin: 8px 0 6px; }
.checkout .sum-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 0; }
.checkout .sum-total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 650; color: var(--head); }
.checkout .sum-total strong { font-size: 1.5rem; }
.pay-choice { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.pay-choice legend { padding: 0; margin-bottom: 8px; font-weight: 600; font-size: .9rem; }
.field > .pay-opt, .pay-opt { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; padding: 11px 12px; background: #fff; border: 1px solid #cfccc5; border-radius: 10px; cursor: pointer; }
.pay-opt input { flex: none; position: static; width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent-dark); }
.pay-opt span { display: flex; flex-direction: column; gap: 1px; font-weight: 400; }
.pay-opt strong { color: var(--head); font-size: .95rem; }
.pay-opt small { color: var(--muted); font-size: .84rem; }
.pay-opt:has(input:checked) { border-color: var(--accent-dark); background: #fff7e8; }

.size-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 10px; margin-bottom: 8px; }
.size-row > label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.size-row input[type="text"] { width: 92px; text-align: center; }
.size-row input:disabled { background: #efeeea; color: #9a968e; }
.times { padding-bottom: 10px; color: var(--muted); }
.unit { display: inline-flex; border: 1px solid #cfccc5; border-radius: 8px; overflow: hidden; margin-left: 4px; }
.unit label { margin: 0; }
.unit input { position: absolute; opacity: 0; pointer-events: none; }
.unit span { display: block; padding: 10px 14px; font-weight: 600; font-size: .9rem; background: #fff; cursor: pointer; }
.unit input:checked + span { background: var(--ink); color: #fff; }
.unit input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }

.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: inline-block; padding: 9px 14px; border: 1px solid #cfccc5; border-radius: 999px; background: #fff; font-size: .9rem; font-weight: 600; cursor: pointer; }
.choice input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.fabric-chosen { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.fabric-chosen img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); }
.fabric-name { font-weight: 600; font-size: .94rem; flex: 1 1 140px; min-width: 0; }

/* ---------- Compact fabric picker ---------- */
.fp-box { width: min(720px, 100%); max-height: min(640px, calc(100vh - 32px)); display: flex; flex-direction: column; margin: auto; padding: 18px; }
.fp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fp .modal-close { position: static; }
.fp-filters { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 8px; }
.fp-filters input, .fp-filters select { padding: 8px 10px; font-size: .9rem; }
@media (max-width: 620px) { .fp-filters { grid-template-columns: 1fr 1fr; } .fp-filters input { grid-column: 1 / -1; } }
.fp-note { margin: 10px 0 8px; font-size: .84rem; }
.fp-grid { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; padding: 2px; min-height: 120px; }
.fp-tile { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 4px; text-align: left; font: inherit; background: #fff; border: 2px solid transparent; border-radius: 8px; cursor: pointer; }
.fp-tile:hover { border-color: #cfccc5; }
.fp-tile.is-chosen { border-color: var(--accent-dark); background: #fff7e8; }
.fp-tile img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); }
.fp-tile span { font-size: .78rem; font-weight: 600; line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.fp-tile small { font-size: .7rem; color: var(--muted); }

/* ---------- Shared with the shade page: enlarge a swatch, extra price on a swatch ---------- */
.fp-item { position: relative; }
.fp-item .fp-tile { width: 100%; }
.fp-zoom { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(29, 28, 26, .72); color: #fff; cursor: pointer; opacity: 0; transition: opacity .12s; }
.fp-item:hover .fp-zoom, .fp-zoom:focus-visible { opacity: 1; }
@media (hover: none) { .fp-zoom { opacity: 1; } }
.fp-add { color: var(--ok); font-weight: 700; }
