/**
 * Affordable Properties Tabbed Section
 * Shortcode: [rocks_affordable_tabs]
 *
 * Design System: 8pt grid, rem units, CSS variables from style.css
 * Card design: Exact match of homepage Curated Collection cards
 */

/* ==========================================================================
   1. Section Wrapper (Padding/Background Handled by Elementor)
   ========================================================================== */
.rocks-affordable-section {
    width: 100%;
}

.rocks-affordable-container {
    width: 100%;
}

/* ==========================================================================
   2. Section Header
   ========================================================================== */
.rocks-affordable-header {
    text-align: center;
    margin-bottom: 4rem;
}

.rocks-affordable-subtitle {
    color: #7B6339 !important;
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: block;
    margin-bottom: 2rem;
    line-height: 1.2;
}

.rocks-affordable-title {
    font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
    font-size: var(--h2-size);
    /* Global H2 Size */
    font-weight: 700;
    margin: 0 0 2rem 0;
    letter-spacing: -0.02em;
    color: #1A1A1A;
    /* Dark Grey */
    line-height: 1.2;
}

.rocks-affordable-desc {
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    /* 18px */
    color: var(--color-text, #333333);
    line-height: 1.6;
    max-width: 40rem;
    /* 640px */
    margin: 0 auto;
}

/* ==========================================================================
   3. Tab Bar
   ========================================================================== */
.rocks-affordable-tabs {
    display: flex;
    justify-content: center;
    width: max-content;
    margin: 0 auto 2.5rem auto;
    /* 40px */
    border: 1px solid var(--color-stroke, #E2E4E8);
    border-radius: var(--radius-md, 1rem);
    /* 16px */
    overflow: hidden;
    background: var(--color-white, #FFFFFF);
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.03);
}

.rocks-affordable-tab {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    /* 12px 32px */
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--color-text, #333333);
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    border-right: 1px solid var(--color-stroke, #E2E4E8);
}

.rocks-affordable-tab:last-child {
    border-right: none;
}

@media (hover: hover) {
    .rocks-affordable-tab:hover {
        background: #f8f9fa;
        color: var(--color-heading, #1A1A1A);
    }
}

.rocks-affordable-tab.active {
    background: var(--color-primary, #111111);
    color: var(--color-white, #FFFFFF);
}

/* ==========================================================================
   4. Tab Panels
   ========================================================================== */
.rocks-affordable-panel {
    display: none;
    animation: rocksAffordableFadeIn 0.4s ease;
}

.rocks-affordable-panel.active {
    display: block;
}

@keyframes rocksAffordableFadeIn {
    from {
        opacity: 0;
        transform: translateY(0.5rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   5. Card Grid
   ========================================================================== */
.rocks-affordable-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    /* 32px */
}

/* ==========================================================================
   6. Property Card — Exact match of homepage loop cards
   ========================================================================== */
.rocks-affordable-card {
    background: var(--color-white, #FFFFFF);
    border-radius: 1rem;
    /* 16px */
    border: 1px solid var(--color-stroke, #E2E4E8);
    box-shadow: 0 0.625rem 1.875rem rgba(0, 0, 0, 0.05);
    /* 0 10px 30px */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    padding-bottom: 1rem;
    /* 16px */
}

@media (hover: hover) {
    .rocks-affordable-card:hover {
        transform: translateY(-0.3125rem);
        /* -5px */
        box-shadow: 0 1.25rem 2.5rem rgba(0, 0, 0, 0.08);
        /* 0 20px 40px */
        border-color: var(--color-accent, #C5A059);
    }
}

/* 6a. Card Image */
.rocks-affordable-card-img {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.rocks-affordable-card-img img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

/* Badge — matches homepage dark gray badge */
.rocks-affordable-badge {
    position: absolute;
    top: 1.5rem;
    /* 24px */
    left: 1.5rem;
    /* 24px */
    background-color: #333333;
    color: #cccccc;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    /* 4px 8px */
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    /* 12px */
    font-weight: 500;
    line-height: 1;
    z-index: 2;
}

/* 6b. Card Body */
.rocks-affordable-card-body {
    padding: 1.5rem 1rem 0 1rem;
    /* 24px top padding, 16px sides */
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Title — truncated with ellipsis */
.rocks-affordable-card-title {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
    font-size: 1.25rem !important;
    /* 20px */
    font-weight: 700 !important;
    color: #1A1A1A !important;
    line-height: 1.3 !important;
    /* 26px */
    margin: 0 0 0.5rem 0 !important;
    /* 8px bottom */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Location — plain text, no icon */
.rocks-affordable-location {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    /* 16px */
    color: #333333;
    font-weight: 400;
    margin-bottom: 1.5rem;
    /* 24px */
    line-height: 1.4;
}

/* 6c. Meta Row (Beds, Baths, Area) — FontAwesome icons */
.rocks-affordable-meta {
    display: flex;
    gap: 1rem;
    /* 16px */
    margin-bottom: 1.5rem;
    /* 24px */
    flex-wrap: nowrap;
    /* Prevent stacking */
    align-items: center;
}

.rocks-affordable-meta-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    /* 6px */
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    /* 14px */
    color: #333333;
    font-weight: 400;
    white-space: nowrap;
    /* Prevent words like "1 Bed" from wrapping to two lines */
}

.rocks-affordable-meta-item i,
.rocks-affordable-meta-item svg {
    color: #333333;
    font-size: 0.875rem;
    width: 1em;
    height: 1em;
    display: inline-block;
}

/* 6d. Price — at the bottom, black, large */
.rocks-affordable-price {
    padding: 0;
    margin-top: auto;
    /* Push to bottom */
}

.rocks-affordable-price .price-val {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    /* 24px */
    font-weight: 400;
    color: #000000;
    line-height: 1.2;
}

/* ==========================================================================
   7. Empty State
   ========================================================================== */
.rocks-affordable-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--color-text, #69727d);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

/* ==========================================================================
   8. CTA Button
   ========================================================================== */
.rocks-affordable-cta {
    text-align: center;
    margin-top: 3rem;
    /* 48px */
}

.rocks-affordable-cta a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    /* 16px 32px */
    background-color: var(--color-primary, #111111);
    color: var(--color-white, #FFFFFF);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 600;
    font-size: 15px;
    /* 15px matches See all properties */
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
}

@media (hover: hover) {
    .rocks-affordable-cta a:hover {
        opacity: 0.85;
    }
}

/* ==========================================================================
   9. Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .rocks-affordable-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .rocks-affordable-header {
        text-align: left;
    }

    .rocks-affordable-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        /* 24px */
    }

    .rocks-affordable-tabs {
        width: 100%;
        max-width: 100%;
    }

    .rocks-affordable-tab {
        flex: 1;
        /* Stretch evenly on mobile */
        padding: 0.625rem 0.5rem;
        /* Reduced sides */
        font-size: 0.875rem;
    }

    .rocks-affordable-desc {
        font-size: 1rem;
    }

    .rocks-affordable-cta a {
        width: 100%;
    }
}