/* compare.css: "Compare stays" (11 Nov 2026). The Compare control on search cards and on
   the stay page, the tray on search results and the floating button on a stay page. Built
   by js/tratok-compare.js. The comparison page keeps its own layout in compare.php. */

/* The chip on a search card's photo. The photo can be anything, so the chip brings its own
   dark glass and never borrows the page's text colours. */
.cmp-toggle--chip { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
    border-radius: 999px; border: 1px solid rgba(255,255,255,.24); background: rgba(8,11,20,.72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    color: #F8FAFC; font-size: .78rem; font-weight: 700; line-height: 1; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
    transition: background .15s ease, border-color .15s ease, transform .15s ease; }
.cmp-toggle--chip::after { content: ""; position: absolute; inset: -5px -4px; }   /* a 44 px target around a 36 px chip */
.cmp-toggle--chip i { font-size: .8rem; }
.cmp-toggle--chip:hover { background: rgba(8,11,20,.88); }
.cmp-toggle--chip:active { transform: scale(.96); }
.cmp-toggle--chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cmp-toggle--chip.is-on { background: #2ECDA7; border-color: #2ECDA7; color: #04231B; }

/* The round button in the stay page's own row of buttons. */
.cmp-toggle--icon.is-on { background: rgba(46,205,167,.16); border-color: rgba(46,205,167,.55); color: #2ECDA7; }
html[data-theme="light"] .cmp-toggle--icon.is-on { background: rgba(4,117,85,.10); border-color: rgba(4,117,85,.45); color: #047555; }

/* The tray. Sits just above the bottom navigation on phones, centred near the bottom on wide screens. */
.cmp-tray { position: fixed; z-index: 78; left: 12px; right: 12px; bottom: calc(var(--bottom-nav-h, 78px) + var(--safe-bottom, 0px) + 8px); display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 18px; border: 1px solid rgba(255,255,255,.14); background: rgba(13,17,30,.95); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
    box-shadow: 0 18px 44px rgba(0,0,0,.5); animation: cmpRise .25s ease-out; }
.cmp-tray[hidden] { display: none; }
@keyframes cmpRise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cmp-tray-items { display: flex; flex: 1 1 auto; gap: 10px; min-width: 0; }
.cmp-chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.cmp-chip img { flex: none; width: 44px; height: 44px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.08); }
.cmp-chip-n { display: none; }
.cmp-chip-x { position: absolute; top: -7px; inset-inline-end: -7px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; padding: 0;
    border-radius: 50%; border: 1px solid rgba(255,255,255,.28); background: #0B0F1C; color: #E2E8F0; font-size: .62rem; cursor: pointer; }
.cmp-chip-x::after { content: ""; position: absolute; inset: -9px; }   /* 40 px to tap */
.cmp-chip-x:focus-visible, .cmp-tray-clear:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.cmp-tray-acts { display: flex; flex: none; align-items: center; gap: 4px; }
.cmp-tray .cmp-tray-go { min-height: 44px; white-space: nowrap; }
.cmp-tray-hint { max-width: 150px; font-size: .76rem; line-height: 1.3; color: #CBD5E1; }
.cmp-tray-clear { min-height: 44px; padding: 0 8px; border: 0; background: none; color: #94A3B8; font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; }
/* The last results stay reachable under the tray. */
body.has-cmp-tray .page { padding-bottom: 190px !important; }
@media (min-width: 1024px) {
    .cmp-tray { left: 0; right: 0; bottom: 22px; width: max-content; max-width: min(760px, calc(100% - 48px)); margin-inline: auto; padding: 12px 14px; gap: 16px; }
    .cmp-tray-items { gap: 16px; }
    /* Names join the pictures here. They give way (to an ellipsis) before the button does. */
    .cmp-chip { flex: 0 1 auto; padding-inline-end: 14px; }
    .cmp-chip-n { display: block; flex: 0 1 auto; min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .82rem; font-weight: 600; color: #F8FAFC; }
    .cmp-tray-hint { max-width: 240px; }
    body.has-cmp-tray .page { padding-bottom: 120px !important; }
}
html[data-theme="light"] .cmp-tray { border-color: rgba(15,23,42,.12); background: rgba(255,255,255,.96); box-shadow: 0 18px 44px rgba(15,23,42,.2); }
html[data-theme="light"] .cmp-chip-n { color: #0F172A; }
html[data-theme="light"] .cmp-tray-hint { color: #475569; }
html[data-theme="light"] .cmp-tray-clear { color: #64748B; }
html[data-theme="light"] .cmp-chip-x { border-color: rgba(15,23,42,.2); background: #fff; color: #334155; }
html[data-theme="light"] .cmp-chip-x:focus-visible, html[data-theme="light"] .cmp-tray-clear:focus-visible { outline-color: #0F172A; }

/* The floating button on a stay page: above that page's booking bar on phones. */
.cmp-fab { position: fixed; z-index: 69; inset-inline-end: 14px; bottom: calc(var(--cmp-fab-lift, 176px) + var(--safe-bottom, 0px)); display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
    padding: 0 16px; border-radius: 999px; background: #2ECDA7; color: #04231B; font-size: .84rem; font-weight: 800; text-decoration: none; box-shadow: 0 12px 30px rgba(0,0,0,.45);
    animation: cmpRise .25s ease-out; }
.cmp-fab[hidden] { display: none; }
.cmp-fab:hover { filter: brightness(1.05); color: #04231B; }
.cmp-fab:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
html[data-theme="light"] .cmp-fab:focus-visible { outline-color: #0F172A; }
@media (min-width: 1024px) { .cmp-fab { bottom: 24px; inset-inline-end: 24px; } }
@media (prefers-reduced-motion: reduce) { .cmp-tray, .cmp-fab { animation: none; } .cmp-toggle--chip { transition: none; } }
