/* ---- Add-to-compare button (cards + modal) ---- */
.cmp-add-btn { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--line, #e6dccd);
    background:#fff; color:#3d2b1f; border-radius:999px; padding:6px 12px; font-size:13px; cursor:pointer; }
.cmp-add-btn.is-in { background:#3d2b1f; color:#f3e9db; border-color:#3d2b1f; }
.cmp-add-btn .cmp-add-btn-ic { font-size:12px; }

/* ---- Persistent tray bar ---- */
#compare-tray { position:fixed; left:0; right:0; bottom:0; z-index:60; display:flex; align-items:center;
    gap:14px; padding:10px 16px; background:#3d2b1f; color:#f3e9db;
    box-shadow:0 -4px 16px rgba(0,0,0,.18); padding-bottom:calc(10px + env(safe-area-inset-bottom)); }
#compare-tray.hidden { display:none; }
/* The tray is position:fixed and overlays page content. Reserve matching space at the bottom of the
   scroll area ONLY while the tray is shown (compare.js toggles body.compare-open), so it never covers
   forms or primary action buttons on any page. Empty tray = no reserved space. */
body.compare-open .content { padding-bottom:calc(84px + env(safe-area-inset-bottom)); }
.cmp-tray-slots { display:flex; gap:10px; }
.cmp-tray-slot { position:relative; width:52px; height:52px; border-radius:8px; overflow:hidden; background:#efe6d6; }
.cmp-tray-slot img { width:100%; height:100%; object-fit:cover; }
.cmp-tray-x { position:absolute; top:-6px; right:-6px; width:20px; height:20px; border-radius:50%;
    border:none; background:#c9a227; color:#3d2b1f; font-weight:700; cursor:pointer; line-height:20px; }
.cmp-tray-actions { margin-left:auto; display:flex; gap:10px; align-items:center; }
.cmp-tray-clear { background:transparent; border:1px solid #7a6450; color:#e9dcc9; border-radius:8px; padding:8px 14px; cursor:pointer; }
.cmp-tray-go { background:#c9a227; border:none; color:#3d2b1f; font-weight:700; border-radius:8px; padding:10px 18px; cursor:pointer; }

/* ---- Toast ---- */
.compare-toast { position:fixed; left:50%; bottom:90px; transform:translateX(-50%) translateY(10px);
    background:#3d2b1f; color:#f7f2ea; padding:10px 16px; border-radius:8px; opacity:0; pointer-events:none;
    transition:opacity .2s, transform .2s; z-index:70; }
.compare-toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* ---- Compare page ---- */
.cmp { padding:16px; padding-bottom:120px; }
.cmp-head { display:flex; align-items:center; gap:16px; margin-bottom:16px; flex-wrap:wrap; }
.cmp-title { font-family:'Cormorant Garamond', serif; font-size:28px; color:#3d2b1f; margin:0; }
.cmp-back { color:#5a4130; text-decoration:none; }
.cmp-actions { margin-left:auto; display:flex; gap:16px; align-items:center; }
.cmp-toggle { font-size:14px; color:#5a4130; display:inline-flex; gap:6px; align-items:center; }
.cmp-print { background:#3d2b1f; color:#f3e9db; border:none; border-radius:8px; padding:9px 16px; cursor:pointer; }

.cmp-table-wrap { overflow-x:auto; }
/* table-layout:fixed keeps every piece column the SAME width regardless of content — otherwise a long
   Diamonds list blows one column out to 4x the others and floats its image off-center. min-width lets the
   wrapper scroll on narrow screens instead of crushing the columns. */
.cmp-table { width:100%; min-width:720px; table-layout:fixed; border-collapse:separate; border-spacing:0;
    background:#fff; border:1px solid var(--line,#e6dccd); border-radius:12px; overflow:hidden; }
.cmp-table td, .cmp-table th { padding:12px 14px; text-align:left; vertical-align:top;
    border-bottom:1px solid var(--line,#e6dccd); font-size:14px; overflow-wrap:break-word; word-break:break-word; }
.cmp-rowlabel { width:150px; background:#f7f2ea; font-weight:600; color:#5a4130;
    font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
/* No per-column width: table-layout:fixed divides the remaining width equally across the piece columns. */
.cmp-col { position:relative; }
.cmp-col-remove { position:absolute; top:6px; right:6px; border:none; background:transparent;
    color:#a8927b; font-size:18px; cursor:pointer; }
/* Left-align the image with the source/name/badges stacked under it (was centered, which read as detached). */
.cmp-col-img { height:130px; display:flex; align-items:center; justify-content:flex-start; margin-bottom:8px; }
.cmp-col-img img { max-height:130px; max-width:100%; border-radius:8px; }
.cmp-col-src { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:#b8860b; font-weight:700; }
.cmp-col-name { font-weight:700; color:#3d2b1f; font-size:14px; }
.cmp-col--error { color:#a8927b; }
.cmp-col-errmsg { text-align:center; padding:24px 8px; }
.cmp-badges { display:flex; flex-wrap:wrap; gap:5px; margin-top:8px; }
.cmp-badge { background:#fff8e6; color:#8a6d12; border:1px solid #ecd9a0; border-radius:999px;
    padding:2px 8px; font-size:11px; font-weight:600; }
.cmp-col-actions { display:flex; flex-direction:column; gap:4px; margin-top:10px; }
.cmp-col-link { color:#b8860b; text-decoration:none; font-size:12px; font-weight:600; }
/* Price cell parity with the product card + modal (.vault-card-price-* / .modal-price-*). */
.cmp-price-was { color:#b23b3b; font-weight:500; text-decoration:line-through; }
.cmp-price-now { font-weight:600; }
.cmp-row--diff td, .cmp-row--diff th { background:#fff8e6; }
.cmp-row--diff .cmp-rowlabel { box-shadow:inset 3px 0 0 #c9a227; }
.cmp-only-diff .cmp-row--same { display:none; }

.cmp-col--add { min-width:130px; }
.cmp-add-open { border:1px dashed #b7a488; background:transparent; color:#5a4130; border-radius:8px;
    padding:10px 12px; cursor:pointer; width:100%; }
.cmp-add-slot { position:fixed; left:50%; bottom:100px; transform:translateX(-50%); width:min(520px,92vw);
    background:#fff; border:1px solid var(--line,#e6dccd); border-radius:12px; box-shadow:0 8px 30px rgba(0,0,0,.2);
    z-index:65; padding:12px; }
.cmp-add-slot.hidden { display:none; }
.cmp-add-head { display:flex; gap:8px; }
.cmp-add-input { flex:1; border:1px solid var(--line,#e6dccd); border-radius:8px; padding:10px 12px; }
.cmp-add-close { border:none; background:transparent; font-size:22px; color:#a8927b; cursor:pointer; }
.cmp-add-results { max-height:320px; overflow-y:auto; margin-top:8px; }
.cmp-empty { text-align:center; padding:60px 20px; color:#5a4130; }
.cmp-empty-cta { display:inline-block; margin-top:10px; color:#b8860b; text-decoration:none; font-weight:600; }

/* ---- Print / Share (E/F): clean table only ---- */
@media print {
    #compare-tray, .cmp-actions, .cmp-back, .cmp-col-remove, .cmp-col--add, #cmp-add-slot,
    .cmp-col-actions,
    #academy-reader, #academy-reader-backdrop,
    .rail, .session-bar, .svc-back { display:none !important; }
    .cmp { padding:0; }
    .cmp-table { border:1px solid #ccc; }
    .cmp-row--diff td, .cmp-row--diff th { background:#f4f4f4 !important; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
}

.cmp-add-list { list-style:none; margin:0; padding:0; }
.cmp-add-list li { border-bottom:1px solid var(--line,#e6dccd); }
.cmp-add-result { display:flex; gap:10px; align-items:center; width:100%; background:transparent;
    border:none; padding:8px; cursor:pointer; text-align:left; }
.cmp-add-result img { width:44px; height:44px; object-fit:cover; border-radius:6px; }
.cmp-add-result-info { display:flex; flex-direction:column; }
.cmp-add-result-name { color:#3d2b1f; font-weight:600; font-size:14px; }
.cmp-add-result-meta { color:#8a7a66; font-size:12px; }
.cmp-add-empty { color:#8a7a66; font-size:13px; padding:10px; }
.cmp-empty-add { display:inline-block; background:#3d2b1f; color:#f3e9db; border:none; border-radius:8px;
    padding:10px 18px; cursor:pointer; margin:0 10px 0 0; font:inherit; }

/* Product modal action row: uniform icon+label buttons (replaces the old underlined text links).
   Defined after .cmp-add-btn so the shared Compare button (which carries both classes) picks up this
   look, and .modal-action.is-in drives its in-compare state. */
.modal-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:16px; }
.modal-action { flex:1 1 0; min-width:120px; display:inline-flex; align-items:center; justify-content:center;
    gap:8px; padding:11px 14px; border:1px solid var(--line,#e6dccd); border-radius:10px; background:#fff;
    color:#3d2b1f; font-size:13px; font-weight:600; text-decoration:none; cursor:pointer; text-align:center; }
.modal-action i { color:#b8860b; font-size:14px; }
.modal-action:hover { border-color:#c9a227; background:#fffbf0; }
.modal-action.is-in { background:#3d2b1f; color:#f3e9db; border-color:#3d2b1f; }
.modal-action.is-in i { color:#c9a227; }
