/**
 * Side Panel — Saved & Recently Viewed
 */

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

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

.hrck-side-panel-tab.hrck-tab-shifted {
    right: 380px !important;
}

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

.hrck-tab-btn:hover {
    background: #f7f7f7;
    color: #222;
}

.hrck-tab-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.hrck-tab-heart-pop {
    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 {
    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 {
    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 {
    right: 0;
}

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

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

.hrck-side-panel-close {
    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 {
    background: #f0f0f0;
    color: #222;
}

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

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

.hrck-panel-section {
    padding: 16px 20px;
}

.hrck-panel-section + .hrck-panel-section {
    border-top: 1px solid #eee;
}

.hrck-panel-section-title {
    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 svg {
    flex-shrink: 0;
    color: #888;
}

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

.hrck-panel-card {
    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 {
    border-bottom: none;
}

.hrck-panel-card:hover {
    background: #fafafa;
    border-radius: 6px;
}

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

.hrck-panel-card-info {
    flex: 1;
    min-width: 0;
}

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

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

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

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

/* Heart button on recent cards */
.hrck-panel-heart {
    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 {
    color: #ff385c;
    transform: translateY(-50%);
}

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

.hrck-panel-heart svg {
    width: 18px;
    height: 18px;
}

/* Share a Wishlist button */
.hrck-panel-wishlist-btn {
    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 {
    opacity: 0.9;
    color: #fff;
}

.hrck-panel-wishlist-btn svg {
    flex-shrink: 0;
}

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

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

.hrck-panel-empty-icon {
    font-size: 24px;
    margin-bottom: 8px;
    opacity: 0.4;
}

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

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

.hrck-panel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.hrck-panel-spinner {
    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 {
    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 {
    opacity: 1;
    pointer-events: auto;
}

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

@media (max-width: 960px) {
    .hrck-side-panel-tab,
    .hrck-side-panel,
    .hrck-side-panel-backdrop {
        display: none !important;
    }
}
