/**
 * IntelliRealty Favorites CSS
 * Heroldo Suite Design System
 */

:root {
    --ir-primary-blue: #0666E6;
    --ir-primary-blue-hover: #0558C7;
    --ir-danger: #DC3545;
    --ir-success: #28A745;
    --ir-gray-900: #212529;
    --ir-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====================================
   FAVORITE BUTTON
   ==================================== */

.ir-property-favorite-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--ir-transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    z-index: 10;
    padding: 0;
    outline: none;
}

.ir-property-favorite-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    background: white;
}

.ir-property-favorite-btn:focus {
    outline: 2px solid var(--ir-primary-blue);
    outline-offset: 2px;
}

.ir-property-favorite-btn.is-favorited {
    background: var(--ir-primary-blue);
}

.ir-property-favorite-btn.is-favorited:hover {
    background: var(--ir-primary-blue-hover);
}

.ir-property-favorite-btn .heart-icon {
    width: 22px;
    height: 22px;
    transition: transform var(--ir-transition);
    stroke: var(--ir-gray-900);
}

.ir-property-favorite-btn.is-favorited .heart-icon {
    transform: scale(1.2);
    stroke: white;
    fill: white;
}

.ir-property-favorite-btn .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Animation on favorite */
@keyframes heartBeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(1.1);
    }
}

.ir-property-favorite-btn.is-favorited .heart-icon {
    animation: heartBeat 0.5s ease;
}

/* ====================================
   TOAST NOTIFICATIONS - Using global ir-components.css
   ==================================== */
/* Base .ir-toast system defined in ir-components.css */

/* ====================================
   MERGE MODAL - Using global ir-components.css
   ==================================== */
/* Base .ir-modal, .ir-modal-overlay, .ir-modal-content defined in ir-components.css */

/* ====================================
   BUTTONS - Using global ir-components.css
   ==================================== */
/* Module-specific button overrides only if needed */

/* ====================================
   MOBILE RESPONSIVE
   ==================================== */
@media (max-width: 768px) {
    /* Toast and Modal responsive styles handled by ir-components.css */

    .ir-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .ir-property-favorite-btn {
        width: 40px;
        height: 40px;
    }

    .ir-property-favorite-btn .heart-icon {
        width: 20px;
        height: 20px;
    }
}

/* Touch optimizations */
@media (hover: none) and (pointer: coarse) {
    .ir-property-favorite-btn {
        width: 48px;
        height: 48px;
    }
}

/* ====================================
   FLOATING FAVORITES WIDGET
   ==================================== */

/* Trigger Button */
.ir-fav-widget__trigger {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--ir-primary-blue);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(6, 102, 230, 0.35);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9998;
}

.ir-fav-widget__trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(6, 102, 230, 0.45);
    background: var(--ir-primary-blue-hover);
}

.ir-fav-widget__trigger svg {
    stroke: white;
    fill: none;
    transition: fill 0.2s;
}

.ir-fav-widget__trigger.has-favorites svg {
    fill: white;
}

/* Count Badge */
.ir-fav-widget__count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    background: #DC3545;
    color: white;
    font-size: 12px;
    font-weight: 700;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    line-height: 1;
    border: 2px solid white;
}

/* Overlay */
.ir-fav-widget__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.ir-fav-widget.is-open .ir-fav-widget__overlay {
    opacity: 1;
    visibility: visible;
}

/* Slide-out Panel */
.ir-fav-widget__panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 90vw;
    height: 100%;
    background: #f8f9fa;
    z-index: 10000;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.ir-fav-widget.is-open .ir-fav-widget__panel {
    transform: translateX(0);
}

/* Panel Header */
.ir-fav-widget__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.ir-fav-widget__header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
}

.ir-fav-widget__close {
    width: 36px;
    height: 36px;
    border: none;
    background: #f3f4f6;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s;
}

.ir-fav-widget__close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Panel Body */
.ir-fav-widget__body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* Loading Spinner */
.ir-fav-widget__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.ir-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--ir-primary-blue);
    border-radius: 50%;
    animation: ir-spin 0.7s linear infinite;
}

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

/* Panel Cards */
.ir-fav-panel__card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 10px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    transition: all 0.2s;
    position: relative;
}

.ir-fav-panel__card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.ir-fav-panel__thumb {
    width: 72px;
    height: 54px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f3f4f6;
}

.ir-fav-panel__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ir-fav-panel__no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #d1d5db;
}

.ir-fav-panel__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ir-fav-panel__title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ir-fav-panel__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--ir-primary-blue);
}

.ir-fav-panel__remove {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

.ir-fav-panel__remove:hover {
    background: #fef2f2;
    color: #DC3545;
}

.ir-fav-panel__empty {
    text-align: center;
    color: #9ca3af;
    padding: 40px 20px;
    font-size: 15px;
}

/* ====================================
   WIDGET RESPONSIVE
   ==================================== */
@media (max-width: 480px) {
    .ir-fav-widget__trigger {
        bottom: 16px;
        right: 16px;
        width: 50px;
        height: 50px;
    }

    .ir-fav-widget__trigger svg {
        width: 20px;
        height: 20px;
    }

    .ir-fav-widget__panel {
        width: 100%;
        max-width: 100vw;
    }

    .ir-fav-panel__thumb {
        width: 60px;
        height: 45px;
    }
}
