/* Chambers Realty Group – Front-end Styles
   Black & Gold luxury branding
*/

:root {
    --crg-gold: #d4af37;
    --crg-gold-dark: #c9a227;
    --crg-gold-light: #e8d48b;
    --crg-charcoal: #0d0d0d;
    --crg-charcoal-light: #1a1a1a;
    --crg-silver: #c0c0c0;
    --crg-silver-light: #e8e8e8;
    --crg-border: rgba(212, 175, 55, 0.2);
}

/* Grid */
.crg-featured-grid,
.crg-listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.75rem;
    margin: 1.5rem 0;
}

/* Card */
.crg-card {
    background: var(--crg-charcoal-light);
    border: 1px solid var(--crg-border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: var(--crg-silver-light);
}

.crg-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px -10px rgba(212, 175, 55, 0.15);
}

.crg-card-image {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
}

.crg-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.crg-badge {
    position: absolute;
    top: 0.75rem;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.crg-badge-status {
    left: 0.75rem;
    background: linear-gradient(135deg, var(--crg-gold), var(--crg-gold-dark));
    color: var(--crg-charcoal);
}

.crg-badge-type {
    right: 0.75rem;
    background: rgba(13, 13, 13, 0.9);
    color: var(--crg-gold);
    border: 1px solid var(--crg-border);
}

.crg-card-body {
    padding: 1.25rem;
}

.crg-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.4rem;
    color: #fff;
    line-height: 1.3;
}

.crg-card-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--crg-gold);
    margin: 0 0 0.5rem;
}

.crg-card-address {
    font-size: 0.875rem;
    color: var(--crg-silver);
    margin: 0 0 0.85rem;
}

.crg-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--crg-silver);
    border-top: 1px solid var(--crg-border);
    padding-top: 0.85rem;
    margin-bottom: 1rem;
}

/* Buttons */
.crg-btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border-radius: 0.6rem;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.2s, background 0.2s;
    cursor: pointer;
    border: none;
}

.crg-btn-gold {
    background: linear-gradient(135deg, var(--crg-gold), var(--crg-gold-dark));
    color: var(--crg-charcoal) !important;
}

.crg-btn-gold:hover {
    opacity: 0.9;
}

.crg-btn-outline {
    display: block;
    width: 100%;
    background: transparent;
    color: var(--crg-gold) !important;
    border: 1px solid var(--crg-border);
}

.crg-btn-outline:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* Map */
.crg-map-wrapper {
    margin: 1.5rem 0;
}

.crg-map-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.crg-map-filter {
    padding: 0.45rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--crg-charcoal-light);
    color: var(--crg-silver);
    border: 1px solid var(--crg-border);
    cursor: pointer;
    transition: all 0.2s;
}

.crg-map-filter.active,
.crg-map-filter:hover {
    background: linear-gradient(135deg, var(--crg-gold), var(--crg-gold-dark));
    color: var(--crg-charcoal);
    border-color: transparent;
}

.crg-map {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--crg-border);
    background: var(--crg-charcoal);
}

/* Leaflet popup override */
.crg-map .leaflet-popup-content-wrapper {
    background: var(--crg-charcoal-light);
    color: var(--crg-silver-light);
    border-radius: 12px;
    border: 1px solid var(--crg-border);
    padding: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}

.crg-map .leaflet-popup-tip {
    background: var(--crg-charcoal-light);
}

.crg-map .leaflet-popup-content {
    margin: 0;
    min-width: 200px;
}

.crg-popup-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px 12px 0 0;
    display: block;
}

.crg-popup-body {
    padding: 0.75rem;
}

.crg-popup-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #fff;
    margin: 0 0 0.25rem;
}

.crg-popup-price {
    color: var(--crg-gold);
    font-weight: 700;
    margin: 0 0 0.35rem;
}

.crg-popup-meta {
    font-size: 0.75rem;
    color: var(--crg-silver);
    margin-bottom: 0.5rem;
}

/* Listings filters */
.crg-listings-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.crg-search,
.crg-filter-type {
    padding: 0.6rem 1rem;
    border-radius: 0.6rem;
    border: 1px solid var(--crg-border);
    background: var(--crg-charcoal-light);
    color: var(--crg-silver-light);
    font-size: 0.9rem;
}

.crg-search {
    flex: 1;
    min-width: 200px;
}

.crg-search:focus,
.crg-filter-type:focus {
    outline: none;
    border-color: var(--crg-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.25);
}

/* Agent card */
.crg-agent-card {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    background: var(--crg-charcoal-light);
    border: 1px solid var(--crg-border);
    border-radius: 1rem;
    overflow: hidden;
    max-width: 640px;
    margin: 1.5rem 0;
}

.crg-agent-photo {
    flex: 0 0 220px;
}

.crg-agent-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    min-height: 260px;
}

.crg-agent-info {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.crg-agent-info h3 {
    margin: 0 0 0.25rem;
    font-size: 1.5rem;
    color: #fff;
}

.crg-agent-title {
    color: var(--crg-gold);
    font-size: 0.9rem;
    margin: 0 0 0.75rem;
    letter-spacing: 0.03em;
}

.crg-agent-desc {
    color: var(--crg-silver);
    font-size: 0.9rem;
    margin: 0 0 1.25rem;
    line-height: 1.5;
}

@media (max-width: 600px) {
    .crg-agent-card {
        flex-direction: column;
    }
    .crg-agent-photo {
        flex: none;
    }
    .crg-agent-photo img {
        min-height: 220px;
    }
}

/* Rental sub-filters */
.crg-map-subfilters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    justify-content: center;
    margin: 0 0 1rem;
    padding: 0.75rem 1rem;
    background: rgba(212, 175, 55, 0.06);
    border: 1px solid var(--crg-border);
    border-radius: 0.75rem;
}
.crg-map-subfilters[hidden] {
    display: none !important;
}


/* Feature filter chips */
.crg-feature-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 1.25rem;
    padding: 0.75rem 1rem;
    background: var(--crg-charcoal-light, #1a1a1a);
    border: 1px solid var(--crg-border, rgba(212,175,55,0.2));
    border-radius: 0.75rem;
}
.crg-feature-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--crg-gold, #d4af37);
    margin-right: 0.35rem;
}
.crg-feat-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--crg-silver, #c0c0c0);
    cursor: pointer;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    border: 1px solid var(--crg-border, rgba(212,175,55,0.2));
    user-select: none;
}
.crg-feat-chip:has(input:checked),
.crg-feat-chip:hover {
    border-color: var(--crg-gold, #d4af37);
    color: var(--crg-gold, #d4af37);
    background: rgba(212,175,55,0.08);
}
.crg-feat-chip input {
    accent-color: #d4af37;
    margin: 0;
}


/* ===== Featured Homes Carousel ===== */
.crg-carousel {
    position: relative;
    margin: 1.5rem 0 2rem;
    padding: 0 2.75rem;
}
.crg-carousel-track {
    display: flex;
    gap: 1.25rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0.25rem 1rem;
    scrollbar-width: none;
}
.crg-carousel-track::-webkit-scrollbar { display: none; }
.crg-carousel-slide {
    flex: 0 0 min(340px, 85vw);
    scroll-snap-align: start;
    max-width: 380px;
}
.crg-carousel-btn {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    z-index: 5;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(212,175,55,0.45);
    background: rgba(13,13,13,0.92);
    color: #d4af37;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s, box-shadow 0.2s, transform 0.2s;
}
.crg-carousel-btn:hover {
    background: rgba(212,175,55,0.15);
    box-shadow: 0 0 16px rgba(212,175,55,0.25);
}
.crg-carousel-prev { left: 0; }
.crg-carousel-next { right: 0; }
.crg-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.45rem;
    margin-top: 0.25rem;
}
.crg-carousel-dots button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 0;
    padding: 0;
    background: rgba(192,192,192,0.35);
    cursor: pointer;
}
.crg-carousel-dots button.is-active {
    background: #d4af37;
    width: 18px;
    border-radius: 999px;
}
.crg-card-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0 0 0.85rem;
}
.crg-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(212,175,55,0.12);
    color: #d4af37;
    border: 1px solid rgba(212,175,55,0.3);
}
.crg-empty {
    color: #c0c0c0;
    padding: 1rem;
    border: 1px dashed rgba(212,175,55,0.3);
    border-radius: 0.75rem;
}
@media (max-width: 600px) {
    .crg-carousel { padding: 0 2.25rem; }
    .crg-carousel-slide { flex-basis: min(300px, 82vw); }
}
