/**
 * Property Card Enhanced Styles
 *
 * Matches Houzez theme card design with:
 * - 4px border-radius (top image corners + bottom card corners)
 * - Gallery navigation
 * - Email & WhatsApp contact buttons
 *
 * @package ResalesModern
 * @version 2.2.0
 */

/* =========================================================================
   PROPERTY CARD
   ========================================================================= */
.rm-property-card {
    position: relative;
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.rm-property-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12), 0 8px 24px rgba(0,0,0,0.08);
    transform: translateY(-4px);
}

/* =========================================================================
   IMAGE CONTAINER
   ========================================================================= */
.rm-property-card__image-container {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: #f1f5f9;
}

.rm-property-card__image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.rm-property-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease, opacity 0.2s ease;
}

.rm-property-card:hover .rm-property-card__image {
    transform: scale(1.05);
}

.rm-property-card__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #e2e8f0;
    color: #94a3b8;
}

.rm-property-card__image--placeholder svg {
    width: 48px;
    height: 48px;
}

/* Image Overlay */
.rm-property-card__image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 40%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.rm-property-card:hover .rm-property-card__image-overlay {
    opacity: 1;
}

/* =========================================================================
   BADGES
   ========================================================================= */
.rm-property-card__badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    z-index: 10;
}

.rm-property-card__badges-left,
.rm-property-card__badges-right {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.rm-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 3px;
    line-height: 1.3;
}

.rm-badge--featured {
    background: #FFCB3D;
    color: #0F1E2E;
}

.rm-badge--sale {
    background: rgba(15, 30, 46, 0.9);
    color: #fff;
}

.rm-badge--rent {
    background: rgba(59, 130, 246, 0.9);
    color: #fff;
}

.rm-badge--reduced {
    background: #dc2626;
    color: #fff;
    font-weight: 700;
}

/* =========================================================================
   GALLERY ARROWS
   ========================================================================= */
.rm-card__nav-arrows {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
    z-index: 9;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.rm-property-card:hover .rm-card__nav-arrows {
    opacity: 1;
}

.rm-card__nav-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.95);
    border-radius: 4px;
    color: #475569;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18), 0 1px 3px rgba(0,0,0,0.1);
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
    padding: 0;
}

.rm-card__nav-arrow:hover {
    background: #fff;
    color: #0F1E2E;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.12);
}

.rm-card__nav-arrow svg {
    width: 16px;
    height: 16px;
}

/* =========================================================================
   IMAGE ACTIONS (favorite)
   ========================================================================= */
.rm-card__image-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.rm-property-card:hover .rm-card__image-actions {
    opacity: 1;
}

/* Hide when badges are in same position */
.rm-property-card__badges-right:not(:empty) ~ .rm-card__image-actions {
    top: auto;
    bottom: 12px;
}

.rm-card__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.92);
    border-radius: 50%;
    color: #475569;
    box-shadow: 0 2px 6px rgba(0,0,0,0.12);
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    padding: 0;
}

.rm-card__action-btn:hover {
    background: #FFCB3D;
    color: #0F1E2E;
}

.rm-card__action-btn.is-favorite {
    background: #ef4444;
    color: #fff;
}

.rm-card__action-btn.is-favorite svg {
    fill: currentColor;
}

.rm-card__action-btn svg {
    width: 18px;
    height: 18px;
}

/* =========================================================================
   GALLERY DOTS
   ========================================================================= */
.rm-card__gallery-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 10;
}

.rm-card__dot {
    width: 6px;
    height: 6px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    padding: 0;
}

.rm-card__dot:hover {
    background: rgba(255,255,255,0.8);
}

.rm-card__dot.active {
    background: #fff;
    width: 20px;
    border-radius: 3px;
}

/* =========================================================================
   CONTENT SECTION
   ========================================================================= */
.rm-property-card__content {
    padding: 16px 18px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Property Type */
.rm-card__type {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 6px;
}

/* Price */
.rm-card__price {
    font-size: 22px;
    font-weight: 700;
    color: #0F1E2E;
    margin-bottom: 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.2;
}

.rm-card__price-original {
    font-size: 14px;
    color: #94a3b8;
    text-decoration: line-through;
    font-weight: 400;
}

/* Title */
.rm-card__title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rm-card__title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.rm-card__title a:hover {
    color: #FFCB3D;
}

/* Location */
.rm-card__location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
}

.rm-card__location svg {
    width: 14px;
    height: 14px;
    color: #FFCB3D;
    flex-shrink: 0;
}

/* Features Row */
.rm-card__features {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid #f1f5f9;
}

.rm-card__feature {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: #475569;
}

.rm-card__feature svg {
    width: 16px;
    height: 16px;
    color: #94a3b8;
}

.rm-card__feature--icon-only {
    padding: 0;
}

/* =========================================================================
   CONTACT BUTTONS
   ========================================================================= */
.rm-card__contact-buttons {
    display: flex;
    gap: 0;
    border-top: 1px solid #f1f5f9;
}

.rm-contact-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 12px;
    font-size: 13px;
    font-weight: 700;
    color: #0F1E2E;
    background: #FFCB3D;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    border-right: 1px solid rgba(15,30,46,0.08);
}

.rm-contact-btn:last-child {
    border-right: none;
}

.rm-contact-btn:hover {
    background: #0F1E2E;
    color: #ffffff;
}

.rm-contact-btn--whatsapp:hover {
    background: #0F1E2E;
    color: #ffffff;
}

.rm-contact-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* =========================================================================
   CARD FOOTER / VIEW DETAILS — hidden now (replaced by contact btns)
   ========================================================================= */
.rm-property-card__footer {
    display: none;
}

/* Reference — hidden */
.rm-card__reference {
    display: none;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 768px) {
    .rm-property-card__image-container {
        height: 200px;
    }

    .rm-card__price {
        font-size: 20px;
    }

    .rm-card__title {
        font-size: 15px;
    }

    .rm-card__features {
        gap: 10px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .rm-property-card__image-container {
        height: 210px;
    }
}

@media (min-width: 1024px) {
    .rm-property-card__image-container {
        height: 220px;
    }
}

/* =========================================================================
   ACCESSIBILITY & MOTION
   ========================================================================= */
@media (prefers-reduced-motion: reduce) {
    .rm-property-card,
    .rm-property-card__image,
    .rm-card__nav-arrow,
    .rm-card__action-btn,
    .rm-card__image-actions,
    .rm-contact-btn {
        transition: none !important;
    }
}

@media (prefers-contrast: high) {
    .rm-property-card {
        border: 2px solid currentColor;
    }
    .rm-badge {
        border: 1px solid currentColor;
    }
}

.rm-card__nav-arrow:focus-visible,
.rm-card__action-btn:focus-visible,
.rm-contact-btn:focus-visible,
.rm-card__dot:focus-visible {
    outline: 2px solid #FFCB3D;
    outline-offset: 2px;
}
