/**
 * FPO Shortcode Carousel Styles
 * Scoped under .fpo-shortcode-wrapper to avoid conflicts with Divi and theme CSS.
 * Uses !important where necessary to override theme's Swiper overrides.
 */

/* Wrapper */
.fpo-shortcode-wrapper {
    position: relative;
    padding: 1rem 0 !important;
    max-width: 1200px !important;
    margin: 0 auto !important;
}

/* Filter buttons row */
.fpo-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 0 1rem;
}

.fpo-filter-btn {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
    background-color: #f0f0f0;
    color: #333;
}

.fpo-filter-btn:hover,
.fpo-filter-btn.active {
    background-color: var(--primary-color, #dc3545);
    color: #fff;
}

/* Swiper container -- extra padding so arrows sit fully outside the cards */
.fpo-shortcode-wrapper .fpo-carousel {
    padding: 1.5rem 3rem;
    margin: 0 1.5rem;
    overflow: hidden;
    position: relative;
    background: #f9f9fb;
    border: 1px solid #e8e8ec;
    border-radius: 12px;
}

.fpo-shortcode-wrapper .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

/* Card styling */
.fpo-shortcode-wrapper .floorplan-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.2s ease;
}

.fpo-shortcode-wrapper .floorplan-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.fpo-shortcode-wrapper .floorplan-actions {
    margin-top: auto;
    padding-top: 1rem;
}

/*
 * Arrow overrides -- theme has .swiper-button-prev { left: 32% !important }
 * and old Swiper background-image SVGs. We nuke all of it.
 */
.fpo-shortcode-wrapper .swiper-button-prev,
.fpo-shortcode-wrapper .swiper-button-next {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
    width: 32px !important;
    height: 32px !important;
    background-image: none !important;
    background-size: 0 !important;
    color: #999 !important;
    z-index: 10 !important;
}

.fpo-shortcode-wrapper .swiper-button-prev::after,
.fpo-shortcode-wrapper .swiper-button-next::after {
    font-size: 20px !important;
}

.fpo-shortcode-wrapper .swiper-button-prev {
    left: 0 !important;
    right: auto !important;
}

.fpo-shortcode-wrapper .swiper-button-next {
    right: 0 !important;
    left: auto !important;
}

/* Hidden slides (filtered out) */
.fpo-slide-hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 640px) {
    .fpo-shortcode-wrapper .fpo-carousel {
        padding: 0 2rem;
        margin: 0 1rem;
    }

    .fpo-filter-buttons {
        gap: 0.4rem;
    }

    .fpo-filter-btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.9rem;
    }
}

/* Specs on one line with tight gap */
.fpo-shortcode-wrapper .floorplan-specs {
    display: flex !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    flex-wrap: nowrap !important;
}

.fpo-shortcode-wrapper .floorplan-specs .spec-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.15rem !important;
    white-space: nowrap !important;
    min-width: 0 !important;
}

/* Force consistent image sizing -- square aspect ratio container */
.fpo-shortcode-wrapper .floorplan-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
    border-radius: 6px;
}

.fpo-shortcode-wrapper .floorplan-image a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.fpo-shortcode-wrapper .floorplan-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

/* Rent styling -- override main CSS secondary-color and font-size on .rent-range */
.fpo-shortcode-wrapper .rent-range {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

.fpo-shortcode-wrapper .rent-label,
.fpo-shortcode-wrapper .rent-period {
    font-size: 0.9rem;
    color: #666;
}

.fpo-shortcode-wrapper .rent-amount {
    font-size: 1.4rem;
    font-weight: 600;
}
