/* Mi Casa Rentals - Custom Branding Styles */
/* Bootstrap 5 handles layout — this file applies the Mi Casa design system */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Hanken+Grotesk:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #0B8266;
    --primary-dark: #096b54;
    --secondary-color: #E07A52;
    --secondary-dark: #c96840;
    --accent-color: #84D2D8;
    --text-dark: #1E2A2A;
    --text-mid: #33403F;
    --text-muted: #7E8B89;
    --text-light: #9A9F95;
    --bg-sand: #F4F1E8;
    --bg-sand-light: #F7F4EC;
    --bg-warm: #FBFAF4;
    --border-warm: #E8E3D6;
    --border-light: #DAD3C3;
    --success-color: var(--primary-color);
    --warning-color: #E07A52;
}

/* ── Typography ─────────────────────────────────────────────────── */
body {
    font-family: 'Hanken Grotesk', 'Segoe UI', sans-serif;
    color: var(--text-dark);
    background: #fff;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--text-dark);
    font-weight: 600;
}

/* ── Navbar ─────────────────────────────────────────────────────── */
.navbar {
    background: var(--bg-sand) !important;
    border-bottom: 1px solid var(--border-warm);
}

.navbar-brand {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--text-dark) !important;
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.01em;
}

.nav-link {
    color: var(--text-mid) !important;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.01em;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--primary-color) !important;
}

.dropdown-menu {
    border: 1px solid var(--border-warm);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    background: #fff;
}

.dropdown-item {
    color: var(--text-mid);
    font-size: 0.9rem;
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--bg-sand);
    color: var(--primary-color);
}

.navbar-toggler {
    border-color: var(--border-warm);
}

/* ── Header contact ──────────────────────────────────────────────── */
.header-contact a {
    color: var(--text-mid);
    text-decoration: none;
    margin-left: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.header-contact a:hover {
    color: var(--primary-color);
}

/* ── Hero ────────────────────────────────────────────────────────── */
.hero-section {
    position: relative;
    min-height: 520px;
    background: linear-gradient(135deg, var(--text-dark) 0%, #2A3534 100%);
    color: white;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-section.with-image {
    background-size: cover;
    background-position: center;
}

.hero-section .hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(11, 35, 30, 0.52);
}

.hero-section h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: white;
    font-size: 3rem;
    font-weight: 600;
    line-height: 1.15;
}

.hero-section p {
    font-size: 1.15rem;
    opacity: 0.88;
}

.hero-carousel {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.hero-carousel .carousel-item img {
    width: 100%;
    height: 520px;
    object-fit: cover;
}

.hero-content {
    position: relative;
    z-index: 10;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
    letter-spacing: 0.01em;
}

.btn-primary:hover,
.btn-primary:focus {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-success {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
}

.btn-success:hover,
.btn-success:focus {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
    font-weight: 600;
    border-radius: 10px;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-light {
    background: #fff;
    border-color: rgba(255,255,255,0.6);
    color: var(--text-dark);
    font-weight: 600;
    border-radius: 10px;
}

.btn-light:hover {
    background: var(--bg-sand);
}

.btn-outline-light {
    border-color: rgba(255,255,255,0.7);
    color: #fff;
    font-weight: 600;
    border-radius: 10px;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
    border: 1px solid var(--border-warm);
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.card-title {
    font-family: 'Cormorant Garamond', Georgia, serif;
    color: var(--text-dark);
    font-weight: 600;
}

/* ── Property Cards ──────────────────────────────────────────────── */
.property-card {
    border: 1px solid var(--border-warm);
}

.property-card .card-img-top {
    height: 200px;
    object-fit: cover;
}

.property-card .price {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
}

/* ── Featured Cards ──────────────────────────────────────────────── */
.featured-card {
    border: 2px solid var(--border-warm);
}

/* ── Unit Cards ──────────────────────────────────────────────────── */
.unit-card {
    border: 1px solid var(--border-warm);
}

.unit-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

/* ── Badges ──────────────────────────────────────────────────────── */
.badge.bg-success {
    background: var(--primary-color) !important;
}

.badge.bg-info {
    background: var(--accent-color) !important;
    color: var(--text-dark) !important;
}

/* ── Amenity Badges ──────────────────────────────────────────────── */
.amenity-badge {
    background: var(--bg-sand);
    color: var(--text-mid);
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-warm);
    display: inline-block;
    margin: 2px;
}

/* ── Military Banner ─────────────────────────────────────────────── */
.military-banner {
    background: var(--text-dark);
    color: #fff;
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}

/* ── Section backgrounds ─────────────────────────────────────────── */
.bg-light {
    background: var(--bg-sand) !important;
}

/* ── Pricing Info ────────────────────────────────────────────────── */
.pricing-info {
    background: var(--bg-warm);
    border-left: 4px solid var(--secondary-color);
    border-radius: 0 10px 10px 0;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-mid);
}

/* ── Testimonials ────────────────────────────────────────────────── */
.testimonial-card {
    background: white;
    border: 1px solid var(--border-warm);
    border-left: 4px solid var(--accent-color);
    border-radius: 16px;
}

.testimonial-card.featured {
    border-left-color: var(--secondary-color);
    background: var(--bg-warm);
}

.testimonial-rating {
    color: var(--secondary-color);
    font-size: 1.1rem;
}

/* ── Benefits Section ────────────────────────────────────────────── */
.benefits-section {
    background: var(--bg-sand);
}

.benefit-icon {
    font-size: 2.25rem;
    margin-bottom: 0.75rem;
    display: block;
}

/* ── Contact Section ─────────────────────────────────────────────── */
.contact-section {
    background: var(--text-dark);
    color: white;
}

.contact-section h2,
.contact-section h4 {
    color: white;
    font-family: 'Cormorant Garamond', Georgia, serif;
}

.contact-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.contact-icon {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    display: block;
}

.contact-link {
    color: white;
    font-size: 1.15rem;
    text-decoration: none;
    font-weight: 600;
}

.contact-link:hover {
    color: var(--accent-color);
}

/* ── CTA Section ─────────────────────────────────────────────────── */
.cta-section {
    background: var(--bg-sand);
}

.cta-section .contact-link {
    color: var(--primary-color);
    font-weight: 600;
}

.cta-section .contact-link:hover {
    color: var(--primary-dark);
}

/* ── Requirements ────────────────────────────────────────────────── */
.requirements-section {
    background: #fff;
}

.requirements-list {
    list-style: none;
    padding: 0;
}

.requirements-list li {
    padding: 0.5rem 0;
    padding-left: 2rem;
    position: relative;
    color: var(--text-mid);
    border-bottom: 1px solid var(--border-warm);
}

.requirements-list li:last-child {
    border-bottom: none;
}

.requirements-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
    background: var(--text-dark);
    color: rgba(255,255,255,0.75);
    padding: 2rem 0;
}

footer a {
    color: rgba(255, 255, 255, 0.7);
}

footer a:hover {
    color: white;
}

/* ── Social Media ────────────────────────────────────────────────── */
.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.social-link:hover {
    background: var(--primary-color);
    color: white;
}

/* ── Filter Buttons ──────────────────────────────────────────────── */
.filter-btn {
    border: 1.5px solid var(--border-warm);
    color: var(--text-mid);
    background: #fff;
    border-radius: 999px;
    padding: 0.45rem 1.1rem;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ── Map ─────────────────────────────────────────────────────────── */
.map-container {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border-warm);
}

.map-image {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Video Modal ─────────────────────────────────────────────────── */
.video-modal .modal-content {
    background: #000;
}

.video-modal .modal-header {
    border-bottom: none;
}

.video-modal .btn-close {
    filter: invert(1);
}

.video-modal .ratio {
    background: #000;
}

/* ── Airbnb Booking Box ──────────────────────────────────────────── */
.airbnb-box {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: rgba(132, 210, 216, 0.12);
    border: 1px solid var(--accent-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.airbnb-box-top {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.airbnb-box-icon {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FFE4E9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.airbnb-box-text strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.airbnb-box-text span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-mid);
}

.btn-airbnb {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    border: 1.5px solid #FF385C;
    color: #FF385C;
    background: #fff;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    width: 100%;
    transition: all 0.2s;
}

.btn-airbnb:hover {
    background: #FF385C;
    color: #fff;
}

.btn-airbnb.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* ── Long-Term Stay Box ──────────────────────────────────────────── */
.longterm-box {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    background: rgba(224, 122, 82, 0.1);
    border: 1px solid var(--secondary-color);
    border-radius: 12px;
    padding: 0.85rem 1rem;
}

.longterm-box-top {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.longterm-box-icon {
    flex: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #FBE3D6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.longterm-box-text strong {
    display: block;
    font-size: 0.85rem;
    color: var(--text-dark);
}

.longterm-box-text span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-mid);
}

.btn-longterm {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-weight: 700;
    font-size: 0.85rem;
    width: 100%;
    transition: background 0.2s;
}

.btn-longterm:hover {
    background: var(--secondary-dark);
    color: #fff;
}

/* ── Video Tour Button ───────────────────────────────────────────── */
.video-tour-btn {
    background: var(--bg-sand);
    border: 1.5px solid var(--border-warm);
    color: var(--text-mid);
    padding: 0.5rem 1rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.video-tour-btn:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* ── Main-page unit cards (per-unit actions + search highlight) ──── */
.units-list {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.unit-card {
    border: 1px solid #EDE8DB;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Highlighted "matches your search" state */
.unit-card.matched {
    border: 2px solid var(--primary-color);
    box-shadow: 0 12px 30px rgba(11, 130, 102, 0.20);
}

.unit-card-head {
    display: grid;
    grid-template-columns: 0.7fr 1fr 0.9fr 1.3fr;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-warm);
}

.unit-card.matched .unit-card-head {
    background: #DDF0E5;
}

.unit-name {
    font-weight: 700;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.unit-specs {
    color: #48514F;
    font-size: 0.9rem;
}

.unit-rent {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.unit-avail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.unit-avail.has-dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary-color);
    flex: none;
}

.unit-avail .text-success {
    color: var(--primary-color) !important;
    font-weight: 600;
}

.unit-avail .text-muted {
    color: var(--text-muted) !important;
    font-weight: 500;
}

/* Actions row (video tour + Airbnb + Apply) */
.unit-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    padding: 0.875rem 1.25rem;
    border-top: 1px solid #F0EBDE;
}

.unit-card.matched .unit-card-actions {
    background: #EAF6EF;
}

.unit-actions-spacer {
    flex: 1;
    min-width: 0;
}

.unit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    border: none;
    transition: transform 0.16s ease, background 0.18s ease, border-color 0.18s ease;
}

.unit-btn-video {
    gap: 0.5rem;
    background: #fff;
    color: var(--primary-color);
    border: 1.5px solid #BFE0DD;
    padding: 0.7rem 1.125rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.unit-btn-video:hover {
    background: #EAF6F4;
    border-color: var(--primary-color);
}

.unit-btn-icon {
    font-size: 0.9rem;
    line-height: 1;
}

.unit-btn-airbnb,
.unit-btn-apply {
    flex-direction: column;
    gap: 1px;
    padding: 0.6rem 1.25rem;
}

.unit-btn-airbnb {
    background: #E0564B;
    color: #FFF6F3;
    box-shadow: 0 8px 20px rgba(224, 86, 75, 0.24);
}

.unit-btn-apply {
    background: var(--primary-color);
    color: #F4F1E8;
    box-shadow: 0 8px 20px rgba(11, 130, 102, 0.24);
}

.unit-btn-airbnb:hover,
.unit-btn-apply:hover {
    transform: translateY(-1px);
    color: #fff;
}

.unit-btn-main {
    font-size: 0.875rem;
    font-weight: 700;
}

.unit-btn-sub {
    font-size: 0.7rem;
    opacity: 0.85;
}

/* "Matches your search" indicator — inline on desktop, full-width bar on mobile */
.unit-match-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    font-size: 0.84rem;
    font-weight: 700;
}

.unit-match-bar {
    display: none;
}

.unit-check {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.unit-check::after {
    content: '';
    width: 8px;
    height: 4px;
    border-left: 2px solid #F4F1E8;
    border-bottom: 2px solid #F4F1E8;
    transform: rotate(-45deg);
    margin-top: -2px;
}

.unit-check.light {
    background: rgba(244, 241, 232, 0.22);
}

/* Mobile: stack head, stack buttons full-width, matches-bar at card bottom */
@media (max-width: 768px) {
    .unit-card-head {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "name  rent"
            "specs avail";
        row-gap: 0.5rem;
    }

    .unit-name  { grid-area: name; }
    .unit-rent  { grid-area: rent; justify-self: end; }
    .unit-specs { grid-area: specs; }
    .unit-avail { grid-area: avail; justify-self: start; }

    .unit-rent {
        font-size: 1.375rem;
    }

    .unit-card-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
    }

    .unit-actions-spacer,
    .unit-match-inline {
        display: none;
    }

    .unit-btn {
        width: 100%;
        padding: 0.8rem 1rem;
    }

    .unit-btn-video {
        justify-content: center;
    }

    .unit-btn-airbnb,
    .unit-btn-apply {
        align-items: flex-start;
    }

    .unit-btn-main { font-size: 0.925rem; }
    .unit-btn-sub  { font-size: 0.75rem; }

    .unit-match-bar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        background: var(--primary-color);
        color: #F4F1E8;
        font-size: 0.84rem;
        font-weight: 700;
    }
}

/* ── Alert overrides ─────────────────────────────────────────────── */
.alert-info {
    background: var(--bg-sand);
    border: 1px solid var(--border-warm);
    color: var(--text-mid);
    border-radius: 12px;
}

/* ── Hidden testimonials ─────────────────────────────────────────── */
.hidden-testimonial {
    display: none;
}

.hidden-testimonial.show {
    display: block;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero-section {
        min-height: 400px;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-carousel .carousel-item img {
        height: 400px;
    }

    /* Hide carousel prev/next buttons on the listing page for mobile
       (touch swipe still works; buttons are unreliable on touch devices) */
    #property-detail-container .carousel-control-prev,
    #property-detail-container .carousel-control-next {
        display: none;
    }
}
