:root {
    --brand: #C8102E;
    --primary: #003580;
    --primary-hover: #00224f;
    --navy: #1a2b4a;
    --text: #1f2937;
    --muted: #6b7280;
    --bg: #ffffff;
    --surface: #f5f7fa;
    --surface-2: #eef2f7;
    --border: #d1d5db;
    --border-light: #e5e7eb;
    --accent: #febb02;
    --success: #008009;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 20px rgba(0, 53, 128, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 53, 128, 0.12);
    --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; }

.container {
    width: min(1140px, 94%);
    margin: 0 auto;
}

/* Header */
.site-header {
    padding: 0.85rem 0;
    background: var(--primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 200;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.01em;
}

.logo span { color: var(--accent); }

.logo-image {
    height: 40px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
}

.nav-links {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.9rem;
}

.nav-links a {
    color: rgba(255, 255, 255, 0.92);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius);
    transition: background 0.15s ease;
}

.nav-links a:hover { background: rgba(255, 255, 255, 0.12); }

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.35rem;
    border-radius: var(--radius);
    border: none;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}

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

.btn-primary:hover { background: var(--primary-hover); }

.btn-accent {
    background: var(--accent);
    color: var(--primary);
}

.btn-accent:hover { filter: brightness(0.97); }

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

.btn-outline:hover { background: var(--surface); }

.btn-block { width: 100%; }

/* Hero */
.hero {
    position: relative;
    min-height: 340px;
    display: flex;
    align-items: flex-end;
    padding: 3rem 0 5.5rem;
    color: #fff;
    background-size: cover;
    background-position: center;
    background-image:
        linear-gradient(180deg, rgba(0, 35, 88, 0.25) 0%, rgba(0, 35, 88, 0.65) 100%),
        url('/images/casasdemar/hero.jpg');
}

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

.hero-badge {
    display: inline-block;
    background: var(--accent);
    color: var(--primary);
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.8rem;
    margin-bottom: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    max-width: 720px;
    margin: 0 0 0.65rem;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.hero p {
    max-width: 560px;
    margin: 0;
    font-size: 1.05rem;
    opacity: 0.92;
}

/* Search bar (Booking-style) */
.hero-search-wrap {
    margin-top: -3.25rem;
    position: relative;
    z-index: 10;
    margin-bottom: 2.5rem;
}

.search-bar {
    background: var(--accent);
    border-radius: var(--radius-lg);
    padding: 4px;
    box-shadow: var(--shadow-lg);
}

.search-bar-inner {
    background: #fff;
    border-radius: calc(var(--radius-lg) - 2px);
    padding: 1.25rem 1.5rem;
}

.search-bar-title {
    margin: 0 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary);
}

.search-bar-subtitle {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.search-fields {
    display: grid;
    grid-template-columns: 1fr 1fr auto auto;
    gap: 0.75rem;
    align-items: end;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color 0.15s ease;
}

.search-field:focus-within {
    border-color: var(--primary);
}

.search-field label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.search-field input {
    border: none;
    padding: 0;
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    background: transparent;
    outline: none;
}

.search-note {
    margin: 0.85rem 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.search-results {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    padding: 0.85rem 1rem;
    background: #e8f4ea;
    border: 1px solid #b7dfc0;
    border-radius: var(--radius);
    color: #0d5c1a;
    font-size: 0.95rem;
}

.search-results strong { font-size: 1.1rem; }

/* Sections */
.section { padding: 3rem 0; }

.section-muted { background: var(--surface); }

.section-header { margin-bottom: 1.75rem; }

.section-title {
    color: var(--primary);
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    margin: 0 0 0.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-subtitle {
    color: var(--muted);
    margin: 0;
    max-width: 640px;
    font-size: 0.95rem;
}

/* Property cards */
.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.property-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.property-card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.property-card-image {
    position: relative;
    height: 210px;
    background-size: cover;
    background-position: center;
}

.property-card-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--success);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.property-card-badge.is-default {
    background: var(--primary);
}

.property-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem 1.15rem 1.15rem;
}

.property-card-body h3 {
    margin: 0 0 0.35rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.3;
}

.property-location {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 0.85rem;
}

.property-amenities {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.amenity {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.82rem;
    color: var(--text);
    background: var(--surface);
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.property-card-footer {
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.property-cta {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--primary);
}

.property-cta::after {
    content: ' →';
}

.empty-state {
    grid-column: 1 / -1;
    padding: 2rem;
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius-lg);
    color: var(--muted);
}

.empty-state a { color: var(--primary); font-weight: 600; }

/* Support cards */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.support-card {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.35rem;
    box-shadow: var(--shadow-sm);
}

.support-card h3 {
    color: var(--primary);
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.support-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

/* Detail page */
.breadcrumb {
    padding: 1rem 0 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.breadcrumb a { color: var(--primary); font-weight: 500; }
.breadcrumb a:hover { text-decoration: underline; }

.detail-hero {
    padding: 0 0 2rem;
    background: var(--surface);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 1.5rem;
    align-items: start;
}

.detail-image {
    min-height: 400px;
    border-radius: var(--radius-lg);
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow);
}

.detail-panel {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.detail-panel h1 {
    color: var(--primary);
    margin: 0.5rem 0 0.35rem;
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.card-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: var(--surface-2);
    padding: 0.3rem 0.55rem;
    border-radius: 4px;
}

.card-meta { color: var(--muted); font-size: 0.92rem; margin: 0; }

.info-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0 0;
    border-top: 1px solid var(--border-light);
}

.info-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.92rem;
}

.info-list li span { color: var(--muted); }
.info-list li strong { color: var(--primary); font-weight: 600; }

.booking-sidebar {
    position: sticky;
    top: 5.5rem;
}

.booking-sidebar .detail-panel {
    border: 2px solid var(--accent);
    box-shadow: var(--shadow);
}

/* Forms */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.85rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--primary);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 0.75rem 0.85rem;
    border: 2px solid var(--border-light);
    border-radius: var(--radius);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 0.15s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.error { color: #dc2626; font-size: 0.82rem; }

.alert-success {
    background: #dcfce7;
    color: #166534;
    padding: 0.85rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

/* Calendar */
.availability-calendar {
    background: #fff;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.calendar-header h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: capitalize;
}

.calendar-nav {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1.1rem;
    color: var(--primary);
    background: #fff;
    transition: background 0.15s ease;
}

.calendar-nav:hover { background: var(--surface); }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.82rem;
    color: var(--muted);
}

.calendar-legend .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    margin-right: 0.35rem;
}

.dot.available { background: #22c55e; }
.dot.reserved { background: #ef4444; }
.dot.pending { background: #f59e0b; }

.calendar-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 2px;
    text-align: center;
}

.calendar-table th {
    font-size: 0.72rem;
    color: var(--muted);
    padding: 0.5rem;
    font-weight: 600;
}

.day-cell {
    padding: 0.6rem 0;
    border-radius: 4px;
    font-size: 0.88rem;
    font-weight: 500;
}

.day-cell.is-available { background: #ecfdf5; color: #166534; }
.day-cell.is-reserved { background: #fef2f2; color: #991b1b; }
.day-cell.is-pending { background: #fffbeb; color: #92400e; }
.day-cell.is-past { background: var(--surface); color: #94a3b8; }
.day-cell.is-empty { background: transparent; }

.calendar-note {
    margin: 1rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

/* Footer */
.site-footer {
    background: linear-gradient(180deg, #002855 0%, var(--primary) 100%);
    color: rgba(255, 255, 255, 0.88);
    margin-top: 2rem;
}

.footer-main {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1fr;
    gap: 2.5rem;
    padding: 3rem 0 2.5rem;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-logo {
    display: inline-flex;
    align-items: center;
}

.footer-logo-image {
    height: 42px;
    width: auto;
    filter: brightness(0) invert(1);
}

.footer-logo-text {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.footer-tagline {
    margin: 0;
    max-width: 360px;
    font-size: 0.92rem;
    line-height: 1.65;
    color: rgba(255, 255, 255, 0.72);
}

.footer-heading {
    margin: 0 0 1rem;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

.footer-links,
.footer-contact-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.footer-links a,
.footer-contact-list a {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.92rem;
    transition: color 0.15s ease;
}

.footer-links a:hover,
.footer-contact-list a:hover {
    color: var(--accent);
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-size: 0.92rem;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.5;
}

.footer-icon {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.12);
}

.footer-bottom-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.62);
}

.footer-bottom-inner p {
    margin: 0;
}

.footer-bottom-note {
    color: rgba(255, 255, 255, 0.5);
}

/* Page panel (confirmation, travelers) */
.page-panel {
    max-width: 720px;
    margin: 0 auto;
}

.traveler-form-grid .traveler-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}

.traveler-form-grid .traveler-submit { margin-top: 0.5rem; }

/* Responsive */
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
    .booking-sidebar { position: static; }
    .detail-image { min-height: 280px; }
}

@media (max-width: 768px) {
    .search-fields { grid-template-columns: 1fr; }
    .nav-links a:not(.btn) { display: none; }
    .hero { min-height: 280px; padding-bottom: 4.5rem; }
    .hero-search-wrap { margin-top: -2.5rem; }
    .form-row { grid-template-columns: 1fr; }
    .traveler-form-grid .traveler-fields { grid-template-columns: 1fr; }
    .footer-main { grid-template-columns: 1fr; gap: 1.75rem; padding: 2.25rem 0 2rem; }
    .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
}
