/* Modern House Card Styles */

.extra-house-card-modern {
    display: grid;
    grid-template-columns: 420px 1fr;
    grid-template-areas: "gallery content";
    gap: 2rem;
    padding: 1.5rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    transition: box-shadow 0.3s ease;
}

.extra-house-card-modern:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Gallery Section */
.house-gallery-modern {
    grid-area: gallery;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.house-gallery-modern .swiper {
    border-radius: 8px;
    height: 320px;
}

.house-gallery-modern .swiper-slide {
    width: 100%;
}

.house-gallery-modern .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.house-gallery-modern .swiper-slide a {
    display: block;
    width: 100%;
    height: 100%;
}

.house-gallery-modern .swiper-button-prev,
.house-gallery-modern .swiper-button-next {
    color: #fff;
    transition: all 0.2s ease;
}

.house-gallery-modern .swiper-button-prev:hover,
.house-gallery-modern .swiper-button-next:hover {
    opacity: 0.8;
}

.house-gallery-modern .swiper-pagination {
    bottom: 12px;
}

.house-gallery-modern .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.7;
}

.house-gallery-modern .swiper-pagination-bullet-active {
    opacity: 1;
    background: #fff;
}

.no-image-placeholder-modern {
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #5c5c5c;
    gap: 12px;
}

.no-image-placeholder-modern i {
    font-size: 48px;
    opacity: 0.5;
}

.no-image-placeholder-modern span {
    font-size: 14px;
}

/* Content Section */
.house-content-modern {
    grid-area: content;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.house-content-modern > * {
    margin-bottom: 5px;
}

.house-content-modern > *:last-child {
    margin-bottom: 0;
}

/* Header */
.house-header-modern {
    display: flex;
    flex-direction: column;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.house-title-modern {
    font-size: 1.6rem;
    font-weight: 500;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
}

.house-badges-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.badge-modern {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
}

.badge-unavailable {
    background: #fee;
    color: #c33;
}

.badge-minstay {
    background: #fff3cd;
    color: #856404;
}

/* Parameters */
.house-params-modern {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.house-params-modern .params-text {
    color: #495057;
    font-size: 14px;
}

.house-params-modern button {
    font-size: 16px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Description */
.house-description-modern {
    color: #495057;
    font-size: 15px;
    line-height: 1.6;
    position: relative;
}

.house-description-modern p {
    margin-bottom: 0.75rem;
}

.house-description-modern p:last-child {
    margin-bottom: 0;
}

.description-content {
    position: relative;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.description-content[data-collapsed="true"] {
    max-height: 5.5em; /* ~3-4 lines depending on line-height */
}

.description-content[data-collapsed="true"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2em;
    background: linear-gradient(to bottom, transparent, #fff);
}

.description-content[data-collapsed="false"] {
    max-height: none;
}

.description-content[data-collapsed="false"]::after {
    display: none;
}

.btn-description-toggle {
    background: none;
    border: none;
    color: #090909;
    font-size: 14px;
    font-weight: 400;
    padding: 4px 0;
    margin-top: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s ease;
}

.btn-description-toggle:hover {
    color: #174f12;
    text-decoration: none;
}

.btn-description-toggle:focus {
    outline: none;
}

.btn-description-toggle .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.btn-description-toggle[data-expanded="true"] .toggle-icon {
    transform: rotate(180deg);
}

/* Meta & Pricing */
.house-meta-modern {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0.8rem;
    background: #f8faf8;
    border-radius: 8px;
}

.meta-item-modern {
    display: flex;
    gap: 0.5rem;
    font-size: 14px;
}

.meta-label {
    font-weight: 600;
    color: #495057;
}

.meta-value {
    color: #5c5c5c;
}

/* Price Policy */
.price-policy-modern {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.policy-title {
    font-weight: 400;
    color: #495057;
    font-size: 14px;
}

.policy-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.policy-list li {
    color: #5c5c5c;
    font-size: 14px;
    padding-left: 1rem;
    position: relative;
}

.policy-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #adb5bd;
}

/* Price Display */

.price-with-discount {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.price-old {
    font-size: 1.15rem;
    color: #5c5c5c;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    font-weight: 300;
}

.price-old .currency {
    font-size: 0.875rem;
    font-weight: 300;
}

.price-new {
    font-size: 1.75rem;
    color: #28a745;
    font-weight: 700;
    line-height: 1;
}

.price-new .currency {
    font-size: 1rem;
    font-weight: 500;
}

.price-regular {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-amount {
    font-size: 1.6rem;
    color: #28a745;
    font-weight: 700;
    line-height: 1;
}

.currency {
    font-size: 1rem;
    color: #5c5c5c;
}

.price-tail {
    color: #5c5c5c;
    font-size: 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.price-breakdown {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.price-breakdown li {
    color: #5c5c5c;
    font-size: 13px;
}

/* Actions */
.house-actions-modern {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding-top: 15px;
}

.house-actions-modern .btn {
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.house-actions-modern .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.house-actions-modern .calc-btn {
    position: relative;
    display: inline-block;
}

.house-actions-modern .calc-btn .badge {
    pointer-events: none;
}

/* Responsive Design */

/* Large Desktop - Gallery left, content right */
@media (min-width: 1200px) {
    .extra-house-card-modern {
        grid-template-columns: 500px 1fr;
        gap: 2rem;
    }

    .house-gallery-modern .swiper {
        height: 350px;
    }
}

/* Tablet Landscape - Gallery left, content right (narrower) */
@media (max-width: 1199px) and (min-width: 992px) {
    .extra-house-card-modern {
        grid-template-columns: 380px 1fr;
        gap: 1.75rem;
    }

    .house-gallery-modern .swiper {
        height: 300px;
    }
}

/* Tablet Portrait - Gallery left, content right (compact) */
@media (max-width: 991px) and (min-width: 769px) {
    .extra-house-card-modern {
        grid-template-columns: 320px 1fr;
        gap: 1.5rem;
        padding: 1.25rem;
    }

    .house-gallery-modern {
        position: relative;
        top: 0;
    }

    .house-gallery-modern .swiper {
        height: 280px;
    }

    .house-title-modern {
        font-size: 1.5rem;
    }
}

/* Mobile - Gallery on top, content below */
@media (max-width: 768px) {
    .extra-house-card-modern {
        grid-template-columns: 1fr;
        grid-template-areas:
            "gallery"
            "content";
        gap: 1.25rem;
        padding: 1.25rem;
    }

    .house-gallery-modern {
        position: relative;
        top: 0;
        margin: -1.25rem -1.25rem 0 -1.25rem;
        border-radius: 12px 12px 0 0;
    }

    .house-gallery-modern .swiper {
        height: 300px;
        border-radius: 12px 12px 0 0;
    }

    .house-header-modern {
        padding-bottom: 0.75rem;
    }

    .house-title-modern {
        font-size: 1.5rem;
    }

    .price-new,
    .price-amount {
        font-size: 1.75rem;
    }

    .price-old {
        font-size: 1.125rem;
    }

    .house-actions-modern {
        flex-direction: column;
        gap: 0.625rem;
    }

    .house-actions-modern .btn,
    .house-actions-modern .calc-btn {
        width: 100%;
    }

    .house-actions-modern .calc-btn button {
        width: 100%;
    }
}

/* Small Mobile - Optimized for small screens */
@media (max-width: 576px) {
    .extra-house-card-modern {
        padding: 1rem;
        border-radius: 8px;
        gap: 1rem;
    }

    .house-gallery-modern {
        margin: -1rem -1rem 0 -1rem;
        border-radius: 8px 8px 0 0;
    }

    .house-gallery-modern .swiper {
        height: 300px;
        border-radius: 8px 8px 0 0;
    }

    .house-title-modern {
        font-size: 1.375rem;
    }

    .house-meta-modern {
        padding: 1rem;
    }

    .price-new,
    .price-amount {
        font-size: 1.625rem;
    }

    .price-old {
        font-size: 1rem;
    }

    .badge-modern {
        font-size: 12px;
        padding: 3px 10px;
    }
}

/* Extra Small Mobile - Compact view */
@media (max-width: 400px) {
    .extra-house-card-modern {
        padding: 0.875rem;
        gap: 0.875rem;
    }

    .house-gallery-modern {
        margin: -0.875rem -0.875rem 0 -0.875rem;
        border-radius: 8px 8px 0 0;
    }

    .house-gallery-modern .swiper {
        height: 220px;
        border-radius: 8px 8px 0 0;
    }

    .house-title-modern {
        font-size: 1.25rem;
    }

    .house-meta-modern {
        padding: 0.875rem;
    }

    .price-new,
    .price-amount {
        font-size: 1.5rem;
    }

    .house-params-modern {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .house-params-modern button {
        width: 100%;
    }

    .house-description-modern {
        font-size: 14px;
    }
}
