@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700;800&family=Jost:wght@300;400;500;600&display=swap');

:root {
    --primary: #023373;
    --primary-dark: #022859;
    --darkest: #011C40;
    --accent: #128BA6;
    --bg-light: #F0F0F2;
    --white: #ffffff;
    --text: #1a1a1a;
    --muted: #6b7280;
    --radius: 10px;
    --shadow: 0 8px 24px rgba(2, 28, 64, 0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Jost', sans-serif;
    color: var(--text);
    background: var(--bg-light);
    line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, h4 {
    font-family: 'Playfair Display', serif;
    color: var(--darkest);
    line-height: 1.2;
}

/* ===== Logo ===== */
.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo .logo-mark {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    object-fit: contain;
}

.brand-logo .logo-text {
    line-height: 1.1;
}

.brand-logo .logo-text strong {
    display: block;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 1.35rem;
    letter-spacing: 2px;
    color: var(--primary);
}

.brand-logo .logo-text span {
    display: block;
    font-family: 'Jost', sans-serif;
    font-weight: 500;
    font-size: 0.62rem;
    letter-spacing: 5px;
    color: var(--accent);
}

/* ===== Header ===== */
header.site-header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

header.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 14px;
    padding-bottom: 14px;
}

nav.main-nav ul {
    display: flex;
    gap: 32px;
}

nav.main-nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--primary-dark);
    transition: color 0.2s;
    position: relative;
    padding-bottom: 4px;
}

nav.main-nav a:hover,
nav.main-nav a.active {
    color: var(--accent);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--primary);
    cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--accent);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--white);
    border: 1.5px solid var(--white);
}

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

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-danger {
    background: #b3261e;
    color: var(--white);
}

.btn-danger:hover { background: #8c1c16; }

/* ===== Hero ===== */
.hero {
    background: linear-gradient(135deg, var(--darkest) 0%, var(--primary) 60%, var(--accent) 140%);
    color: var(--white);
    padding: 110px 0;
    text-align: center;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 18px;
}

.hero p {
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto 32px;
    color: #dbe6f2;
}

.hero .hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Section ===== */
.section {
    padding: 70px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-header h2 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.section-header p {
    color: var(--muted);
    max-width: 560px;
    margin: 0 auto;
}

.section-light { background: var(--white); }

/* ===== Property Grid / Cards ===== */
.property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.property-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
}

.property-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(2, 28, 64, 0.14);
}

.property-img {
    height: 210px;
    background-size: cover;
    background-position: center;
    background-color: #cfd8e3;
    position: relative;
}

.property-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--accent);
    color: var(--white);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.property-tag.featured {
    background: #d4af37;
}

.property-tag.rented {
    background: var(--primary);
}

.countdown {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.countdown-label {
    font-size: 0.8rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.countdown-value {
    font-weight: 700;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
}

.property-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.property-body h3 {
    font-size: 1.2rem;
}

.property-price {
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 700;
    font-family: 'Playfair Display', serif;
}

.property-location {
    color: var(--muted);
    font-size: 0.9rem;
}

.property-meta {
    display: flex;
    gap: 16px;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.property-actions { margin-top: 12px; }

/* ===== Filters ===== */
.filters {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 36px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    align-items: end;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

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

input, select, textarea {
    font-family: 'Jost', sans-serif;
    padding: 11px 14px;
    border: 1px solid #d8dde3;
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--white);
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--accent);
    border-color: var(--accent);
}

/* ===== Detail page ===== */
.detail-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
}

.gallery-main {
    height: 420px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius);
    background-color: #cfd8e3;
    margin-bottom: 12px;
}

.gallery-thumbs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.gallery-thumbs div {
    width: 90px;
    height: 70px;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    border: 2px solid transparent;
    background-color: #cfd8e3;
}

.gallery-thumbs div.active { border-color: var(--accent); }

.detail-info h1 { font-size: 2rem; margin-bottom: 8px; }

.detail-features {
    display: flex;
    gap: 24px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.detail-features .feature {
    text-align: center;
}

.detail-features .feature strong {
    display: block;
    font-size: 1.4rem;
    color: var(--primary);
    font-family: 'Playfair Display', serif;
}

.detail-features .feature span {
    font-size: 0.8rem;
    color: var(--muted);
}

.sidebar-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.agent-mini {
    display: flex;
    align-items: center;
    gap: 14px;
}

.agent-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    color: var(--primary);
    font-size: 1.3rem;
    flex-shrink: 0;
    overflow: hidden;
}

.agent-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Agentes ===== */
.agent-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    text-align: center;
}

.agent-card .agent-avatar {
    width: 90px;
    height: 90px;
    margin: 0 auto 16px;
    font-size: 2rem;
}

/* ===== Footer ===== */
footer.site-footer {
    background: var(--darkest);
    color: #cdd9e6;
    padding: 50px 0 24px;
    margin-top: 60px;
}

footer .footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

footer h4 {
    color: var(--white);
    margin-bottom: 14px;
    font-size: 1rem;
}

footer a:hover { color: var(--accent); }

footer .footer-bottom {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    font-size: 0.85rem;
    color: #8ea3bb;
}

/* ===== Alerts ===== */
.alert {
    padding: 14px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert-success { background: #e3f5e9; color: #1a7a45; border: 1px solid #b6e3c6; }
.alert-error { background: #fdeceb; color: #b3261e; border: 1px solid #f5c2bd; }

/* ===== Admin ===== */
body.admin-body {
    background: var(--bg-light);
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--darkest);
    color: var(--white);
    padding: 24px 0;
    flex-shrink: 0;
}

.admin-sidebar .brand-logo { padding: 0 24px 24px; }
.admin-sidebar .brand-logo .logo-text strong,
.admin-sidebar .brand-logo .logo-text span { color: var(--white); }
.admin-sidebar .brand-logo .logo-text span { color: var(--accent); }

.admin-sidebar nav a {
    display: block;
    padding: 13px 24px;
    color: #cdd9e6;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.admin-sidebar nav a:hover,
.admin-sidebar nav a.active {
    background: rgba(255,255,255,0.06);
    border-left-color: var(--accent);
    color: var(--white);
}

.admin-main {
    flex: 1;
    padding: 32px;
    overflow-x: auto;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--accent);
}

.stat-card .stat-number {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--primary);
    font-weight: 700;
}

.stat-card .stat-label {
    color: var(--muted);
    font-size: 0.9rem;
}

table.admin-table {
    width: 100%;
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border-collapse: collapse;
}

table.admin-table th,
table.admin-table td {
    padding: 14px 18px;
    text-align: left;
    border-bottom: 1px solid #eef0f2;
    font-size: 0.92rem;
}

table.admin-table th {
    background: var(--bg-light);
    color: var(--primary-dark);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

table.admin-table tr:last-child td { border-bottom: none; }

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pendiente { background: #fff3cd; color: #92740c; }
.badge-confirmada { background: #e3f5e9; color: #1a7a45; }
.badge-cancelada { background: #fdeceb; color: #b3261e; }
.badge-active { background: #e3f5e9; color: #1a7a45; }
.badge-inactive { background: #eef0f2; color: var(--muted); }

.actions-row { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px;
    max-width: 800px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.form-grid .full-width { grid-column: 1 / -1; }

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--darkest) 0%, var(--primary) 100%);
    padding: 20px;
}

.login-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 380px;
    box-shadow: var(--shadow);
    text-align: center;
}

.login-card .brand-logo { justify-content: center; margin-bottom: 24px; }

.image-thumb-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.image-thumb-list .thumb {
    position: relative;
    width: 100px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-light);
}

.image-thumb-list .thumb img { width: 100%; height: 100%; object-fit: cover; }

.image-thumb-list .thumb form {
    position: absolute;
    top: 4px;
    right: 4px;
}

.image-thumb-list .thumb button {
    background: rgba(179,38,30,0.9);
    color: white;
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
    .detail-grid { grid-template-columns: 1fr; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; }
    .admin-sidebar nav { display: flex; flex-wrap: wrap; }
    .admin-sidebar nav a { padding: 10px 16px; }
}

@media (max-width: 720px) {
    nav.main-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        box-shadow: var(--shadow);
        display: none;
        flex-direction: column;
    }
    nav.main-nav.open { display: flex; }
    nav.main-nav ul { flex-direction: column; padding: 16px 24px; gap: 0; }
    nav.main-nav ul li a { display: block; padding: 12px 0; }
    .nav-toggle { display: block; }
    .hero h1 { font-size: 2.1rem; }
}
