/*
 * Eview Listivo Card Enhancer 1.1
 * Target: Listivo listing cards / Card V4.
 * No PHP template overrides are used.
 */

html[dir="rtl"] .listivo-listing-card-v4,
html[dir="rtl"] .listivo-listing-card,
body.rtl .listivo-listing-card-v4,
body.rtl .listivo-listing-card {
    direction: rtl !important;
    font-family: "Almarai", Arial, sans-serif !important;
    background: #fff !important;
    border: 1px solid rgba(28, 23, 67, .14) !important;
    border-radius: var(--eview-card-radius) !important;
    overflow: hidden !important;
    box-shadow: var(--eview-card-shadow) !important;
}

/* Keep the card clean and close to the reference */
.listivo-listing-card-v4,
.listivo-listing-card {
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease !important;
}

.listivo-listing-card-v4:hover,
.listivo-listing-card:hover {
    transform: translateY(-2px);
    border-color: rgba(85, 74, 131, .22) !important;
    box-shadow: 0 12px 28px rgba(25, 18, 70, .09) !important;
}

/* IMAGE */
.listivo-listing-card-v4__image,
.listivo-listing-card-v4__image-container,
.listivo-listing-card__image,
.listivo-listing-card__image-container {
    position: relative !important;
    overflow: hidden !important;
}

.listivo-listing-card-v4__image img,
.listivo-listing-card__image img {
    width: 100% !important;
    height: var(--eview-card-image-height) !important;
    min-height: var(--eview-card-image-height) !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform .35s ease !important;
}

.listivo-listing-card-v4:hover .listivo-listing-card-v4__image img,
.listivo-listing-card:hover .listivo-listing-card__image img {
    transform: scale(1.015);
}

/* HEART / FAVORITE */
.listivo-listing-card-v4__favorite,
.listivo-listing-card-v4__favorite button,
.listivo-listing-card__favorite,
.listivo-listing-card__favorite button,
.listivo-listing-card-v4__image .listivo-icon-heart,
.listivo-listing-card__image .listivo-icon-heart {
    border-radius: 50% !important;
}

/* Force common favorite controls to look like the white circle in the reference */
.listivo-listing-card-v4__image button,
.listivo-listing-card__image button {
    transition: transform .2s ease, box-shadow .2s ease !important;
}

.listivo-listing-card-v4__image button:hover,
.listivo-listing-card__image button:hover {
    transform: scale(1.04) !important;
}

/* IMAGE COUNTER / GALLERY BADGE */
.listivo-listing-card-v4__image .listivo-listing-card-v4__gallery,
.listivo-listing-card-v4__image .listivo-listing-card__gallery,
.listivo-listing-card__image .listivo-listing-card-v4__gallery {
    border-radius: 7px !important;
}

/* CONTENT */
.listivo-listing-card-v4__content,
.listivo-listing-card__content {
    background: #fff !important;
    padding: 18px 20px 0 !important;
}

/* PRICE — reference has price first */
.listivo-listing-card-v4__value,
.listivo-listing-card-v4__value.listivo-listing-card-value-selector,
.listivo-listing-card__price,
.listivo-listing-card-v4__price {
    color: var(--eview-card-price) !important;
    font-family: "Almarai", Arial, sans-serif !important;
    font-weight: 700 !important;
    font-size: 18px !important;
    line-height: 1.8 !important;
}

/* If Listivo places the currency/secondary price beside the main value */
.listivo-listing-card-v4__value span,
.listivo-listing-card__price span {
    font-family: inherit !important;
}

/* Installment / secondary value */
.listivo-listing-card-v4__value + div,
.listivo-listing-card-v4__price + div {
    font-family: "Almarai", Arial, sans-serif !important;
    color: #55546a !important;
    font-size: 13px !important;
}

/* TITLE */
.listivo-listing-card-v4__name,
.listivo-listing-card-v4__title,
.listivo-listing-card__name,
.listivo-listing-card__title {
    color: #222 !important;
    font-family: "Almarai", Arial, sans-serif !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 2 !important;
    margin-top: 8px !important;
}

/* DESCRIPTION / small text */
.listivo-listing-card-v4__description,
.listivo-listing-card__description {
    color: #4d4b58 !important;
    font-size: 12px !important;
    line-height: 1.9 !important;
}

/* LOCATION */
.listivo-listing-card-v4__location,
.listivo-listing-card__location {
    color: #4b4a55 !important;
    font-size: 13px !important;
    line-height: 1.9 !important;
}

/* ATTRIBUTES ROW */
.listivo-listing-card-v4__attributes,
.listivo-listing-card-v4__meta,
.listivo-listing-card__attributes,
.listivo-listing-card__meta {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px !important;
    color: #222 !important;
    font-family: "Almarai", Arial, sans-serif !important;
    font-size: 13px !important;
    padding: 12px 0 18px !important;
}

.listivo-listing-card-v4__attribute,
.listivo-listing-card__attribute {
    color: #222 !important;
    white-space: nowrap !important;
}

/* DIVIDER BEFORE CONTACT AREA */
.listivo-listing-card-v4__footer,
.listivo-listing-card__footer {
    border-top: 1px solid #dedde2 !important;
    background: #fff !important;
    min-height: 58px !important;
    padding: 0 18px !important;
}

/* Contact buttons/links */
.listivo-listing-card-v4__footer a,
.listivo-listing-card__footer a,
.listivo-listing-card-v4 a[href^="tel:"],
.listivo-listing-card a[href^="tel:"],
.listivo-phone-hidden {
    font-family: "Almarai", Arial, sans-serif !important;
    font-weight: 600 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    transition: opacity .2s ease, transform .2s ease !important;
}

.listivo-listing-card-v4__footer a:hover,
.listivo-listing-card__footer a:hover,
.listivo-listing-card-v4 a[href^="tel:"]:hover,
.listivo-listing-card a[href^="tel:"]:hover {
    opacity: .78 !important;
    transform: translateY(-1px) !important;
}

/* Phone button: blue, WhatsApp-related elements remain green */
.listivo-listing-card-v4 a[href^="tel:"],
.listivo-listing-card a[href^="tel:"] {
    color: #087cc1 !important;
}

/* Avoid Listivo's big filled phone button look */
.listivo-listing-card-v4 .listivo-phone-hidden,
.listivo-listing-card .listivo-phone-hidden {
    background: transparent !important;
    color: #087cc1 !important;
    border: 0 !important;
}

/* Keep card body compact */
.listivo-listing-card-v4__content > *:last-child,
.listivo-listing-card__content > *:last-child {
    margin-bottom: 0 !important;
}

/* TABLET */
@media (max-width: 992px) {
    .listivo-listing-card-v4__image img,
    .listivo-listing-card__image img {
        height: 260px !important;
        min-height: 260px !important;
    }

    .listivo-listing-card-v4__content,
    .listivo-listing-card__content {
        padding: 16px 16px 0 !important;
    }

    .listivo-listing-card-v4__attributes,
    .listivo-listing-card-v4__meta,
    .listivo-listing-card__attributes,
    .listivo-listing-card__meta {
        gap: 14px !important;
    }
}

/* MOBILE */
@media (max-width: 768px) {
    .listivo-listing-card-v4,
    .listivo-listing-card {
        border-radius: 9px !important;
    }

    .listivo-listing-card-v4__image img,
    .listivo-listing-card__image img {
        height: 230px !important;
        min-height: 230px !important;
    }

    .listivo-listing-card-v4__content,
    .listivo-listing-card__content {
        padding: 15px 14px 0 !important;
    }

    .listivo-listing-card-v4__value,
    .listivo-listing-card-v4__value.listivo-listing-card-value-selector,
    .listivo-listing-card__price,
    .listivo-listing-card-v4__price {
        font-size: 16px !important;
    }

    .listivo-listing-card-v4__name,
    .listivo-listing-card-v4__title,
    .listivo-listing-card__name,
    .listivo-listing-card__title {
        font-size: 13px !important;
        line-height: 1.9 !important;
    }

    .listivo-listing-card-v4__attributes,
    .listivo-listing-card-v4__meta,
    .listivo-listing-card__attributes,
    .listivo-listing-card__meta {
        gap: 10px !important;
        font-size: 11px !important;
        padding-bottom: 14px !important;
    }

    .listivo-listing-card-v4__footer,
    .listivo-listing-card__footer {
        min-height: 54px !important;
        padding: 0 12px !important;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .listivo-listing-card-v4,
    .listivo-listing-card,
    .listivo-listing-card-v4__image img,
    .listivo-listing-card__image img {
        transition: none !important;
    }
}
