/**
 * 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.75rem 3rem;
    margin: 0 1.5rem;
    overflow: hidden;
    position: relative;
    background: transparent;
    border: none;
    border-radius: 0;
}

.fpo-shortcode-wrapper .swiper-slide {
    height: auto;
    box-sizing: border-box;
    display: flex;
}

/* Card styling -- transparent, content-only layout */
.fpo-shortcode-wrapper .floorplan-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0 !important;
    box-shadow: none;
    transition: transform 0.25s ease;
    overflow: hidden;
}

.fpo-shortcode-wrapper .floorplan-card:hover {
    transform: translateY(-3px);
}

/* Reorder card sections: header, specs, image, rent, actions */
.fpo-shortcode-wrapper .floorplan-card .floorplan-header { order: 1; }
.fpo-shortcode-wrapper .floorplan-card .floorplan-specs  { order: 2; }
.fpo-shortcode-wrapper .floorplan-card .floorplan-image  { order: 3; }
.fpo-shortcode-wrapper .floorplan-card .rent-info        { order: 4; }
.fpo-shortcode-wrapper .floorplan-card .floorplan-actions{ order: 5; }

/* Defensive: kill any inherited borders/dividers from theme or main stylesheet */
.fpo-shortcode-wrapper .floorplan-card,
.fpo-shortcode-wrapper .floorplan-card * {
    border-top: 0 !important;
    border-bottom: 0 !important;
}

/* Re-allow border on the CTA button since it uses border for styling */
.fpo-shortcode-wrapper .floorplan-card .fpo-btn-cta-primary {
    border-top: 1px solid var(--primary-color, #dc3545) !important;
    border-bottom: 1px solid var(--primary-color, #dc3545) !important;
}

/* Header: centered title with badge underneath -- balanced regardless of name length */
.fpo-shortcode-wrapper .floorplan-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem 1rem 0.4rem;
    margin-bottom: 0 !important;
    min-height: 5rem;
}

.fpo-shortcode-wrapper .floorplan-name {
    font-size: clamp(1.25rem, 2.2vw, 1.6rem) !important;
    line-height: 1.2;
    margin: 0;
    flex: 0 0 auto !important;
    word-break: break-word;
}

.fpo-shortcode-wrapper .floorplan-name a {
    color: #1a1a2e;
}

.fpo-shortcode-wrapper .floorplan-header .available-badge {
    align-self: center !important;
    font-size: 0.7rem !important;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 3px 10px !important;
    border-radius: 999px;
}

.fpo-shortcode-wrapper .available-badge.available {
    background: transparent;
    color: #1d6b3d;
    box-shadow: inset 0 0 0 1px #1d6b3d;
}

.fpo-shortcode-wrapper .available-badge.not-available {
    background: transparent;
    color: #6b6b76;
    box-shadow: inset 0 0 0 1px #b6b6c0;
}

.fpo-shortcode-wrapper .floorplan-actions {
    margin-top: auto;
    padding: 0.5rem 1rem 1rem;
    display: flex;
    justify-content: stretch;
}

.fpo-shortcode-wrapper .floorplan-actions .fpo-btn-cta-primary {
    width: 100%;
    text-align: center;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    border-radius: 999px;
}

/*
 * 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;
}

/* Floor plan image -- transparent frame so it sits on the page background directly */
.fpo-shortcode-wrapper .floorplan-image {
    position: relative;
    width: 100%;
    padding-top: 62%;
    overflow: hidden;
    border-radius: 0;
    margin: 0 0 0 0 !important;
    background: transparent;
    border: none;
}

.fpo-shortcode-wrapper .floorplan-image a {
    position: absolute;
    inset: 0;
    display: block;
}

.fpo-shortcode-wrapper .floorplan-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.6rem;
    border-radius: 0 !important;
}

/* Rent block */
.fpo-shortcode-wrapper .rent-info {
    padding: 0.85rem 1rem 0.4rem;
    margin-bottom: 0 !important;
    text-align: center;
}

.fpo-shortcode-wrapper .rent-range {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 2px;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
}

.fpo-shortcode-wrapper .rent-label,
.fpo-shortcode-wrapper .rent-period {
    font-size: 0.78rem !important;
    color: #8a8a96;
    letter-spacing: 0.01em;
    font-weight: 500 !important;
}

.fpo-shortcode-wrapper .rent-amount {
    font-size: clamp(1.4rem, 2.4vw, 1.7rem);
    font-weight: 700;
    color: #1a1a2e;
    letter-spacing: -0.01em;
    line-height: 1.1;
}

/* Specs row -- sits directly below the availability badge */
.fpo-shortcode-wrapper .floorplan-specs {
    display: flex !important;
    justify-content: center !important;
    gap: 0.4rem !important;
    flex-wrap: nowrap !important;
    padding: 0 0.75rem 0.85rem !important;
    margin-bottom: 0 !important;
}

.fpo-shortcode-wrapper .floorplan-specs .spec-item {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: baseline !important;
    gap: 0.2rem !important;
    white-space: nowrap !important;
    min-width: 0 !important;
    padding: 0.3rem 0.4rem !important;
    background: transparent;
    border-radius: 0;
    font-size: 0.78rem;
    line-height: 1;
    color: #4a4a55;
}

.fpo-shortcode-wrapper .floorplan-specs .spec-label {
    font-size: 0.75rem !important;
    color: #888 !important;
    margin-bottom: 0 !important;
    font-weight: 500;
}

.fpo-shortcode-wrapper .floorplan-specs .spec-value {
    font-size: 0.82rem !important;
    font-weight: 700;
    color: #1a1a2e;
}

/* Responsive */
@media (max-width: 1024px) {
    .fpo-shortcode-wrapper .fpo-carousel {
        padding: 1.25rem 2.5rem;
        margin: 0 1rem;
    }
}

@media (max-width: 640px) {
    .fpo-shortcode-wrapper {
        padding: 0.5rem 0 !important;
    }

    .fpo-shortcode-wrapper .fpo-carousel {
        padding: 1rem 2rem;
        margin: 0 0.25rem;
        border-radius: 12px;
    }

    .fpo-shortcode-wrapper .floorplan-header {
        padding: 0.85rem 0.75rem 0.6rem;
        min-height: 0;
        gap: 0.4rem;
    }

    .fpo-shortcode-wrapper .floorplan-name {
        font-size: 1.2rem !important;
    }

    .fpo-shortcode-wrapper .floorplan-image {
        padding-top: 56%;
    }

    .fpo-shortcode-wrapper .rent-info {
        padding: 0.7rem 0.75rem 0.3rem;
    }

    .fpo-shortcode-wrapper .rent-amount {
        font-size: 1.35rem;
    }

    .fpo-shortcode-wrapper .floorplan-specs {
        gap: 0.3rem !important;
        padding: 0.35rem 0.5rem 0.2rem !important;
    }

    .fpo-shortcode-wrapper .floorplan-specs .spec-item {
        padding: 0.25rem 0.45rem !important;
        font-size: 0.72rem;
    }

    .fpo-shortcode-wrapper .floorplan-specs .spec-value {
        font-size: 0.78rem !important;
    }

    .fpo-shortcode-wrapper .floorplan-actions {
        padding: 0.4rem 0.75rem 0.85rem;
    }

    .fpo-shortcode-wrapper .floorplan-actions .fpo-btn-cta-primary {
        padding: 0.7rem 1rem;
        font-size: 0.9rem;
    }

    .fpo-filter-buttons {
        gap: 0.4rem;
    }

    .fpo-filter-btn {
        font-size: 0.8rem;
        padding: 0.35rem 0.9rem;
    }

    /* Tuck nav arrows in tighter so they don't crowd the card edges */
    .fpo-shortcode-wrapper .swiper-button-prev,
    .fpo-shortcode-wrapper .swiper-button-next {
        width: 26px !important;
        height: 26px !important;
    }

    .fpo-shortcode-wrapper .swiper-button-prev::after,
    .fpo-shortcode-wrapper .swiper-button-next::after {
        font-size: 16px !important;
    }
}

@media (max-width: 380px) {
    .fpo-shortcode-wrapper .fpo-carousel {
        padding: 0.85rem 1.5rem;
    }

    .fpo-shortcode-wrapper .floorplan-name {
        font-size: 1.1rem !important;
    }

    .fpo-shortcode-wrapper .floorplan-image {
        padding-top: 52%;
    }
}
