/**
 * Theme override: new property card design (lre-property-card).
 * Unified height, clean content layout, modern action bar.
 */

/* Grid: equal-height columns */
.lre-property-grid-col-container {
    display: flex;
    align-items: stretch;
    padding: 10px;
}

.lre-property-card {
    --lre-card-image-height: 180px;
    --lre-card-actions-height: 64px;
    --lre-card-content-height: 270px;
    display: flex;
    flex-direction: column;
    width: 100%;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 5px 10px rgba(17, 24, 39, 0.10);
    border: 1px solid #e8e8e8;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.lre-property-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 12px rgba(17, 24, 39, 0.14);
    border-color: #d9e1ee;
}

/* Force identical height in carousel and grid */
.lre-property-grid-col-container .lre-property-card,
.swiper-slide .lre-property-card {
    height: auto;
}

.lre-property-card__image-wrap {
    position: relative;
    width: 100%;
    height: var(--lre-card-image-height);
    aspect-ratio: auto;
    flex-shrink: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.lre-property-card__image-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 400px at 20% 20%, rgba(20, 71, 136, 0.10), rgba(255, 255, 255, 0) 60%),
        linear-gradient(135deg, rgba(230, 126, 34, 0.10), rgba(255, 255, 255, 0) 45%),
        #f5f5f5;
}

.lre-property-card__image-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M7 7h10a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2Z' stroke='%2399A3AF' stroke-width='1.5'/%3E%3Cpath d='M8.5 14.5 10.8 12.2c.4-.4 1-.4 1.4 0L14 14l1.2-1.2c.4-.4 1-.4 1.4 0L18 14.2' stroke='%2399A3AF' stroke-width='1.5' stroke-linecap='round'/%3E%3Cpath d='M10 10.5h.01' stroke='%2399A3AF' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center;
    background-size: 56px 56px;
    opacity: 0.35;
    pointer-events: none;
}

.lre-property-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.lre-property-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    z-index: 1;
}

.lre-property-card__image img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    min-width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.lre-property-card__favorite {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 0;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
}

.lre-property-card__favorite:hover,
.lre-property-card__favorite:focus {
    transform: scale(1.05);
}
.lre-property-card__favorite i.md-icons,
.lre-property-card__favorite i.md-icons svg {
    width: 20px;
    height: 20px;
    padding: 0;
}

.lre-property-card__favorite .md-icons svg,
.lre-property-card__favorite [aria-hidden="true"] {
    fill: currentColor;
}

.lre-property-card__favorite.remove-favorite .md-icons svg {
    fill: #ff4848;
}

.lre-property-card__favorite.lre-favorite-loading {
    opacity: 0.8;
    pointer-events: none;
}

/* Video badge – same size and style as favorite, next to it */
.lre-property-card__video-badge {
    position: absolute;
    bottom: 12px;
    left: 56px; /* 12px + 36px favorite + 8px gap */
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    pointer-events: none;
    transition: all 0.2s ease;
}

.lre-property-card__video-badge svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.lre-property-card:hover .lre-property-card__video-badge {
    background: rgba(0, 0, 0, 0.5);
}

/* Content – no icons, design-ordered layout, fixed structure */
.lre-property-card__content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px 10px 16px;
    height: var(--lre-card-content-height);
    min-height: 0;
    overflow: hidden;
    text-align: start;
}

.lre-property-card__price {
    margin: 0;
    font-size: 1.12rem;
    font-weight: 700;
    color: #0f3f78;
    line-height: 1.3;
    flex-shrink: 0;
    text-align: start;
}

.lre-property-card__title {
    margin: 0;
    font-size: 1.06rem;
    line-height: 1.4;
    font-weight: 650;
    flex-shrink: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lre-property-card__title a {
    color: #1a1a1a;
    text-decoration: none;
}

.lre-property-card__title a:hover,
.lre-property-card__title a:focus {
    color: #144788;
}

.lre-property-card__subtitle {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lre-property-card__location-row {
    margin: 0;
    font-size: 0.9rem;
    color: #6b7280;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lre-property-card__stats {
    margin-top: auto;
    flex-shrink: 0;
    padding: 10px 12px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
    border-radius: 12px;
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
}

.lre-property-card__stat {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
}

.lre-property-card__stat-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lre-property-card__stat-label {
    margin-top: 2px;
    font-size: 0.78rem;
    color: #9aa3af;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lre-property-card__availability {
    margin: 2px 0 0 0;
    font-size: 0.84rem;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    padding: 6px 10px;
    width: fit-content;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lre-property-card__availability-label {
    font-weight: 600;
    color: #111827;
}

/* Actions – modern spacing, unified design language */
.lre-property-card__actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px;
    height: var(--lre-card-actions-height);
    box-sizing: border-box;
    flex-shrink: 0;
    border: 0;
    border-radius: 0;
    overflow: visible;
}

.lre-property-card__btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s ease, transform 0.2s ease;
    border: 1.5px solid var(--maincolor);
    border-radius: 8px;
    background: var(--maincolor);
    color: #fff;
    min-height: 40px;
    white-space: nowrap;
    filter: none;
}

.lre-property-card__btn:hover,
.lre-property-card__btn:focus {
    outline: none;
    filter: brightness(0.9);
}

/* Primary: Call – same brand color as other buttons */
.lre-property-card__btn--call {
    background: #3a454b;
    border-color: #3a454b;
    color: #fff;
}

.lre-property-card__btn--call:hover,
.lre-property-card__btn--call:focus {
    filter: brightness(0.9);
}

.lre-property-card__btn--call:hover,
.lre-property-card__btn--call:focus {
    outline: none;
}

.lre-property-card__btn-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.lre-property-card__btn > span:not(.lre-property-card__btn-icon) {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}

.lre-property-card__btn-icon i.md-icons {
    width: 18px;
    height: 18px;
    padding: 0;
}

/* Make framework SVG icons follow button color */
.lre-property-card__btn .md-icons svg {
    fill: currentColor;
    width: 18px;
    height: 18px;
}

/* WhatsApp icon – inherits button text color (currentColor) */
.lre-property-card__btn--whatsapp .lre-property-card__btn-icon--whatsapp::before {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h.004c2.744 0 5.528-.921 7.744-2.677 2.52-1.971 4.088-4.806 4.088-7.917 0-2.553-1-4.947-2.744-6.752C19.244 2.896 16.742 2 14.052 2h-.004C8.521 2 4.017 6.505 4.017 12.029c0 2.209.577 4.334 1.666 6.153L4 22l4.066-1.069a11.96 11.96 0 0 0 5.945 1.589'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.872.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h.004c2.744 0 5.528-.921 7.744-2.677 2.52-1.971 4.088-4.806 4.088-7.917 0-2.553-1-4.947-2.744-6.752C19.244 2.896 16.742 2 14.052 2h-.004C8.521 2 4.017 6.505 4.017 12.029c0 2.209.577 4.334 1.666 6.153L4 22l4.066-1.069a11.96 11.96 0 0 0 5.945 1.589'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* RTL adjustments */
[dir="rtl"] .lre-property-card__favorite {
    left: auto;
    right: 12px;
}

[dir="rtl"] .lre-property-card__video-badge {
    left: auto;
    right: 56px; /* 12px + 36px favorite + 8px gap */
}

/* Carousel: slide fills height, card fixed height */
.swiper-wrapper {
    align-items: stretch;
}

.swiper-slide {
    display: flex;
    height: auto;
}

.swiper-slide > * {
    width: 100%;
}

.swiper-slide .swiper-property-col,
.swiper-slide .lre-property-grid-col-container {
    display: flex;
    width: 100%;
    height: 100%;
    margin-bottom: 0;
}

.swiper-slide .lre-property-card {
    width: 100%;
}

/* Robust image height inside carousel (prevents "collapsed" image area) */
.swiper-slide .lre-property-card__image-wrap {
    height: var(--lre-card-image-height);
    aspect-ratio: auto;
}

/* Mobile: allow natural height (avoids squeezed buttons/lines) */
@media (max-width: 640px) {
    .lre-property-card__content {
        height: auto;
    }
    .lre-property-card__actions {
        height: auto;
        flex-wrap: wrap;
    }
}
