/**
 * Favorites functionality styles
 */

/* Heart button on listing cards */
.blok-favorite-btn {
    background: transparent;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.blok-favorite-btn:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.blok-favorite-btn .blok-favorite-icon {
    width: 24px;
    height: 24px;
    stroke: #ffffff;
    stroke-width: 2.5;
    fill: none;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.blok-favorite-btn.is-favorited .blok-favorite-icon,
.blok-favorite-btn.is-active .blok-favorite-icon {
    fill: #e74c3c;
    stroke: #e74c3c;
    filter: drop-shadow(0 2px 6px rgba(231, 76, 60, 0.4));
}

/* Pulse animation when toggling */
@keyframes favorite-pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.3);
    }
}

.blok-favorite-pulse {
    animation: favorite-pulse 0.6s ease;
}

/* Floating favorites button */
.blok-favorites-float-btn {
    position: fixed !important;
    bottom: 24px !important;
    right: 24px !important;
    width: 60px !important;
    height: 60px !important;
    background: #e74c3c !important;
    border: none !important;
    border-radius: 50% !important;
    color: white !important;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(231, 76, 60, 0.4) !important;
    transition: all 0.3s ease;
    z-index: 999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.blok-favorites-float-btn[hidden] {
    display: none !important;
}

/* Move left when scroll-to-top button is visible */
.blok-favorites-float-btn--shifted {
    right: 100px !important; /* 24px + 60px (scroll button width) + 16px gap */
}

.blok-favorites-float-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

.blok-favorites-float-btn svg {
    fill: white;
    stroke: white;
}

.blok-favorites-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #fff;
    color: #e74c3c;
    border-radius: 12px;
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    padding: 0 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.blok-favorites-badge[hidden] {
    display: none !important;
}

/* Listing detail page favorite button */
.blok-listing-hero__summary {
    position: relative;
}

.blok-listing-detail-favorite {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    z-index: 10;
}

.blok-listing-detail-favorite:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.blok-listing-detail-favorite .blok-favorite-icon {
    width: 28px;
    height: 28px;
    stroke: #333;
    stroke-width: 2;
    fill: none;
    transition: all 0.3s ease;
}

.blok-listing-detail-favorite.is-favorited .blok-favorite-icon,
.blok-listing-detail-favorite.is-active .blok-favorite-icon {
    fill: #e74c3c;
    stroke: #e74c3c;
}

/* Favorites Modal */
.blok-favorites-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 9999 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 20px;
}

.blok-favorites-modal[hidden] {
    display: none !important;
}

.blok-favorites-modal__overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.7) !important;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.blok-favorites-modal__content {
    position: relative !important;
    background: white !important;
    border-radius: 16px !important;
    max-width: 1200px !important;
    width: 100% !important;
    max-height: 90vh !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3) !important;
    animation: slideUp 0.3s ease;
    z-index: 10000 !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blok-favorites-modal__header {
    padding: 24px 32px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blok-favorites-modal__header h2 {
    margin: 0 0 4px 0;
    font-weight: 500;
    color: var(--brand-color-3);
    font-family: var(--font-1);
    font-size: 2rem;
}

.blok-favorites-modal__subtitle {
    margin: 0;
    font-size: 14px;
    font-weight: 400;
    color: #7f8c8d;
    line-height: 1.4;
}

.blok-favorites-modal__close {
    background: none;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
    color: #7f8c8d;
    flex-shrink: 0;
}

.blok-favorites-modal__close:hover {
    background: #f5f5f5;
    color: var(--brand-color-3);
}

.blok-favorites-modal__body {
    padding: 32px;
    overflow-y: auto;
    flex: 1;
}

/* Empty state */
.blok-favorites-empty {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.blok-favorites-empty[hidden] {
    display: none;
}

.blok-favorites-empty svg {
    margin-bottom: 24px;
    opacity: 0.3;
}

.blok-favorites-empty p {
    font-size: 20px;
    margin: 0 0 8px;
    color: #34495e;
}

.blok-favorites-empty small {
    font-size: 14px;
    color: #95a5a6;
}

/* Favorites grid */
.blok-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Favorite card styles (for modal) */
.blok-favorite-card {
    background: white;
    overflow: hidden;
    position: relative;
}

.blok-favorite-card__media {
    position: relative;
    width: 100%;
    height: 200px;
    min-height: 200px;
    overflow: hidden;
    background: #f0f0f0;
}

.blok-favorite-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.blok-favorite-card__image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.blok-favorite-card:hover .blok-favorite-card__image-link img {
    transform: scale(1.05);
}

.blok-favorite-card:hover .blok-card__carousel-btn {
    transform: translateY(-50%) scale(1.05);
}

/* Photo Carousel Navigation for Favorites */
.blok-favorite-card .blok-card__carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 4px;
    width: 32px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 45;
    opacity: 1;
    transition: all 0.35s ease;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: auto;
}

.blok-favorite-card .blok-card__carousel-btn:hover {
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.blok-favorite-card .blok-card__carousel-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.blok-favorite-card:hover .blok-card__carousel-btn:active {
    transform: translateY(-50%) scale(1.00);
}

.blok-favorite-card .blok-card__carousel-btn--prev {
    left: 0;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.blok-favorite-card .blok-card__carousel-btn--next {
    right: 0;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.blok-favorite-card .blok-card__carousel-btn svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    pointer-events: none;
}

/* Carousel Dots for Favorites */
.blok-favorite-card .blok-card__carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 45;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    backdrop-filter: blur(4px);
}

.blok-favorite-card .blok-card__carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transition: background 0.2s ease, width 0.2s ease;
    cursor: pointer;
}

.blok-favorite-card .blok-card__carousel-dot--active {
    background: rgba(255, 255, 255, 1);
    width: 18px;
    border-radius: 3px;
}

.blok-favorite-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 5;
}

.blok-favorite-card__badge--state {
    background: rgba(0, 0, 0, 0.7);
}

.blok-favorite-card__badge--state-for-sale {
    background: rgba(46, 204, 113, 0.9);
}

.blok-favorite-card__badge--state-to-let {
    background: rgba(52, 152, 219, 0.9);
}

.blok-favorite-card__badge--state-sold {
    background: rgba(231, 76, 60, 0.9);
}

.blok-favorite-img-counts {
    width: 51px;
    height: 28px;
    background: rgba(17, 17, 17, 0.4);
    position: absolute;
    right: 0px;
    top: 0px;
    padding: 5px 7px;
    color: rgb(255, 255, 255);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.blok-favorite-icon-pic {
    width: 16px;
    height: 16px;
}

.blok-favorite-count-number {
    font-weight: 600;
}

/* Tags for On Show and Mandate Type - positioned on photo bottom left */
.blok-favorite-card__tags {
    position: absolute;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 4px;
    z-index: 40;
    flex-wrap: wrap;
    max-width: calc(100% - 60px); /* Leave space for photo count badge */
}

.blok-favorite-card-tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 0;
    line-height: 1;
    background-color: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    backdrop-filter: blur(4px);
}

.blok-favorite-card-tag--on-show {
    background-color: var(--brand-color-1);
    color: var(--fourth-color);
}

.blok-favorite-card-tag--mandate {
    background-color: var(--brand-color-1);
    color: var(--fourth-color);
}


.blok-favorite-card__price {
    margin: 0;
    font-weight: 700;
    font-size: 26px;
    line-height: 30px;
    color: #111111;
}

.blok-favorite-card__stats-line {
    margin: 0;
    font-size: 15px;
    color: #555555;
}

.blok-favorite-card__address {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
    color: #555555;
}

.blok-favorite-card__address-link {
    color: var(--second-color);
    text-decoration: none;
}

.blok-favorite-card__address-link:hover {
    color: var(--brand-color-4);
    text-decoration: underline;
}

/* Favorites modal cards should match main grid cards */
.blok-favorites-modal .blok-favorite-card {
    overflow: hidden;
}

.blok-favorites-modal{
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.blok-favorites-modal .blok-favorite-card__media {
    height: 200px;
    min-height: 200px;
}

/* Adjust card actions layout for favorites */
.blok-favorite-card__actions {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.blok-favorite-card__body{
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    padding-top: 10px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .blok-favorites-float-btn {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }

    /* Move left when scroll-to-top button is visible (mobile) */
    .blok-favorites-float-btn--shifted {
        right: 88px !important; /* 16px + 56px (scroll button width) + 16px gap */
    }

    .blok-favorites-modal {
        padding: 0;
    }

    .blok-favorites-modal__content {
        border-radius: 0;
        max-height: 100vh;
        height: 100vh;
    }

    .blok-favorites-modal__header {
        padding: 20px;
    }

    .blok-favorites-modal__header h2 {
        font-size: 24px;
    }

    .blok-favorites-modal__subtitle {
        font-size: 13px;
    }

    .blok-favorites-modal__body {
        padding: 20px;
    }

    .blok-favorites-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 16px;
    }

    .blok-favorites-modal .blok-favorite-card__media {
        height: 180px;
        min-height: 180px;
    }
}

@media (max-width: 480px) {
    .blok-favorites-badge {
        top: -2px;
        right: -2px;
        min-width: 20px;
        height: 20px;
        font-size: 11px;
    }
}
