/**
 * Side Panel — Saved & Recently Viewed
 *
 * SOURCE file: production loads the generated tools/side-panel.min.css and
 * SCRIPT_DEBUG loads tools/side-panel.debug.css (see scripts/css-manifest.js).
 * Edit this file, then `npm run build`; never hand-edit the artifacts.
 */

/* --- Isolation reset (ckit#258) ---
   MUST stay the first rule: later same-specificity rules win by source
   order. The contract (roots + declarations) lives in scripts/css-manifest.js;
   the build arms these selectors and verify-css-build checks them exactly.
   Blend-in module: the sheet sets sizes and palette but no font stack, so
   typography and text color re-inherit from the host theme after the revert.
   Three disjoint subtrees need their own root: templates/tools/side-panel/
   panel.php prints the tab, the drawer, and the backdrop as top-level
   siblings at wp_footer. The :where() svg exclusion is specificity-neutral
   and keeps the revert off inline SVG internals (fill/stroke would go
   black). */
.hrck-side-panel-tab:not(#\9):not(#\9),
.hrck-side-panel-tab:not(#\9):not(#\9)::before,
.hrck-side-panel-tab:not(#\9):not(#\9)::after,
.hrck-side-panel-tab:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrck-side-panel-tab:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrck-side-panel-tab:not(#\9):not(#\9) *:where(:not(svg, svg *))::after,
.hrck-side-panel:not(#\9):not(#\9),
.hrck-side-panel:not(#\9):not(#\9)::before,
.hrck-side-panel:not(#\9):not(#\9)::after,
.hrck-side-panel:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrck-side-panel:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrck-side-panel:not(#\9):not(#\9) *:where(:not(svg, svg *))::after,
.hrck-side-panel-backdrop:not(#\9):not(#\9),
.hrck-side-panel-backdrop:not(#\9):not(#\9)::before,
.hrck-side-panel-backdrop:not(#\9):not(#\9)::after,
.hrck-side-panel-backdrop:not(#\9):not(#\9) *:where(:not(svg, svg *)),
.hrck-side-panel-backdrop:not(#\9):not(#\9) *:where(:not(svg, svg *))::before,
.hrck-side-panel-backdrop:not(#\9):not(#\9) *:where(:not(svg, svg *))::after {
    all: revert;
    box-sizing: border-box;
    color: inherit;
    font-family: inherit;
}

/* =========================================================================
   Tab (fixed right edge)
   ========================================================================= */

.hrck-side-panel-tab:not(#\9):not(#\9) {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    transition: right 0.3s ease;
    margin: 0;
    padding: 0;
}

.hrck-side-panel-tab.hrck-tab-shifted:not(#\9):not(#\9) {
    right: 380px;
}

.hrck-tab-btn:not(#\9):not(#\9) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    width: 60px;
    padding: 14px 0;
    background: #fff;
    border: none;
    border-radius: 10px 0 0 10px;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    color: #555;
    transition: background 0.2s, color 0.2s;
    margin: 0;
}

.hrck-tab-btn:hover:not(#\9):not(#\9) {
    background: #f7f7f7;
    color: #222;
}

.hrck-tab-icon:not(#\9):not(#\9) {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.hrck-tab-heart-pop:not(#\9):not(#\9) {
    animation: hrck-heart-pop 0.4s ease;
}

@keyframes hrck-heart-pop {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.35); }
    60%  { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Badge on saved tab */
.hrck-tab-badge:not(#\9):not(#\9) {
    position: absolute;
    top: 4px;
    right: 2px;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    border-radius: 9px;
    background: #ff385c;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    padding: 0 4px;
    pointer-events: none;
}

/* =========================================================================
   Panel (slides from right)
   ========================================================================= */

.hrck-side-panel:not(#\9):not(#\9) {
    position: fixed;
    top: 0;
    right: -380px;
    width: 380px;
    height: 100vh;
    height: 100dvh;
    background: #fff;
    z-index: 9997;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    overflow: hidden;
}

.hrck-side-panel.hrck-panel-open:not(#\9):not(#\9) {
    right: 0;
}

/* Header */
.hrck-side-panel-header:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.hrck-side-panel-title:not(#\9):not(#\9) {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.hrck-side-panel-close:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    color: #666;
    padding: 0;
    transition: background 0.2s;
}

.hrck-side-panel-close:hover:not(#\9):not(#\9) {
    background: #f0f0f0;
    color: #222;
}

/* Body (scrollable) */
.hrck-side-panel-body:not(#\9):not(#\9) {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0;
}

/* =========================================================================
   Panel sections
   ========================================================================= */

.hrck-panel-section:not(#\9):not(#\9) {
    padding: 16px 20px;
}

.hrck-panel-section:not(#\9):not(#\9) + .hrck-panel-section {
    border-top: 1px solid #eee;
}

.hrck-panel-section-title:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 600;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrck-panel-section-title:not(#\9):not(#\9) svg {
    flex-shrink: 0;
    color: #888;
}

/* =========================================================================
   Compact property cards
   ========================================================================= */

.hrck-panel-card:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f5f5;
    position: relative;
    transition: background 0.15s;
}

.hrck-panel-card:last-child:not(#\9):not(#\9) {
    border-bottom: none;
}

.hrck-panel-card:hover:not(#\9):not(#\9) {
    background: #fafafa;
    border-radius: 6px;
}

.hrck-panel-card-thumb:not(#\9):not(#\9) {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    -o-object-fit: cover;
       object-fit: cover;
    flex-shrink: 0;
    background: #f0f0f0;
}

.hrck-panel-card-info:not(#\9):not(#\9) {
    flex: 1;
    min-width: 0;
}

.hrck-panel-card-title:not(#\9):not(#\9) {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hrck-panel-card-meta:not(#\9):not(#\9) {
    margin: 2px 0 0;
    font-size: 12px;
    color: #888;
}

.hrck-panel-card-price:not(#\9):not(#\9) {
    margin: 2px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #222;
}

.hrck-panel-card-price:not(#\9):not(#\9) span {
    font-weight: 400;
    color: #888;
    font-size: 12px;
}

/* Heart button on recent cards */
.hrck-panel-heart:not(#\9):not(#\9) {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #ccc;
    transition: color 0.2s;
    z-index: 1;
}

.hrck-panel-heart:hover:not(#\9):not(#\9) {
    color: #ff385c;
    transform: translateY(-50%);
}

.hrck-panel-heart.hrck-heart-active:not(#\9):not(#\9) svg {
    fill: var(--hrck-side-panel-heart-color, #ff385c);
    stroke: var(--hrck-side-panel-heart-color, #ff385c);
}

.hrck-panel-heart:not(#\9):not(#\9) svg {
    width: 18px;
    height: 18px;
}

/* Share a Wishlist button */
.hrck-panel-wishlist-btn:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-top: 12px;
    background: var(--hrck-side-panel-heart-color, #ff385c);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: opacity 0.2s;
    box-sizing: border-box;
}

.hrck-panel-wishlist-btn:hover:not(#\9):not(#\9) {
    opacity: 0.9;
    color: #fff;
}

.hrck-panel-wishlist-btn:not(#\9):not(#\9) svg {
    flex-shrink: 0;
}

/* =========================================================================
   Empty state
   ========================================================================= */

.hrck-panel-empty:not(#\9):not(#\9) {
    text-align: center;
    padding: 20px 0;
    color: #999;
    font-size: 13px;
}

.hrck-panel-empty-icon:not(#\9):not(#\9) {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.4;
}

.hrck-panel-empty-tip:not(#\9):not(#\9) {
    margin-top: 4px;
    font-size: 12px;
    color: #bbb;
}

/* =========================================================================
   Loading spinner
   ========================================================================= */

.hrck-panel-loading:not(#\9):not(#\9) {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.hrck-panel-spinner:not(#\9):not(#\9) {
    width: 24px;
    height: 24px;
    border: 3px solid #eee;
    border-top-color: #666;
    border-radius: 50%;
    animation: hrck-spin 0.6s linear infinite;
}

@keyframes hrck-spin {
    to { transform: rotate(360deg); }
}

/* =========================================================================
   Backdrop
   ========================================================================= */

.hrck-side-panel-backdrop:not(#\9):not(#\9) {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9996;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.hrck-side-panel-backdrop.hrck-backdrop-visible:not(#\9):not(#\9) {
    opacity: 1;
    pointer-events: auto;
}

/* =========================================================================
   Responsive: hidden below 960px
   ========================================================================= */

@media (max-width: 960px) {
    .hrck-side-panel-tab:not(#\9):not(#\9),
    .hrck-side-panel:not(#\9):not(#\9),
    .hrck-side-panel-backdrop:not(#\9):not(#\9) {
        display: none;
    }
}
