:root {
    --primary: #7a3b1e;
    --primary-dark: #582a15;
    --accent: #c0392b;
    --pine: #2f4f3e;
    --text: #2b2320;
    --muted: #6b5f57;
    --border: #e6ded5;
    --bg: #faf7f2;
    --danger: #c0392b;
    --success: #2f7a4f;
    --card: #ffffff;
}

* { box-sizing: border-box; }

img { max-width: 100%; }

body {
    margin: 0;
    font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ---------------- Splash screen ---------------- */
#splash {
    position: fixed; inset: 0; z-index: 9999;
    background: linear-gradient(160deg, #2f4f3e 0%, #1c2f24 100%);
    display: flex; align-items: center; justify-content: center;
    transition: opacity .6s ease;
}
#splash.splash-hide { opacity: 0; pointer-events: none; }
.splash-inner { text-align: center; color: #fff; }
.splash-emblem { font-size: 3.5rem; animation: float 1.8s ease-in-out infinite; }
.splash-name { font-size: 1.4rem; letter-spacing: 2px; margin-top: 10px; font-weight: 600; }
.splash-bar { width: 180px; height: 4px; background: rgba(255,255,255,.25); border-radius: 4px; margin: 18px auto 0; overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 40%; background: #f1c40f; border-radius: 4px; animation: loadbar 1.4s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes loadbar { 0% { transform: translateX(-100%); } 100% { transform: translateX(350%); } }

/* ---------------- Header ---------------- */
.site-header { background: var(--primary); color: #fff; }
.header-inner { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; flex-wrap: wrap; gap: 10px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.3rem; display: flex; align-items: center; gap: 8px; }
.main-nav { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.main-nav a { color: #fff; text-decoration: none; font-size: .95rem; opacity: .92; }
.main-nav a:hover { opacity: 1; text-decoration: underline; }
.admin-link { font-size: 1.1rem; }

.nav-toggle {
    display: none; background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff;
    font-size: 1.3rem; line-height: 1; padding: 6px 12px; border-radius: 8px; cursor: pointer;
}

.lang-switch { position: relative; }
.lang-switch-btn {
    background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.3); color: #fff;
    padding: 7px 12px; border-radius: 8px; cursor: pointer; font-size: .9rem;
}
.lang-switch-menu {
    display: none; position: absolute; right: 0; top: 110%; background: #fff; color: var(--text);
    border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.2); min-width: 180px; overflow: hidden; z-index: 50;
}
.lang-switch-menu.open { display: block; }
.lang-switch-title { padding: 10px 14px; font-size: .75rem; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); }
.lang-switch-menu a { display: block; padding: 10px 14px; color: var(--text); text-decoration: none; font-size: .92rem; }
.lang-switch-menu a:hover, .lang-switch-menu a.active { background: #f3ece2; }

main { padding: 34px 20px 70px; }

h1 { font-size: 2rem; margin-bottom: 6px; font-family: Georgia, serif; }
h2 { font-size: 1.4rem; margin-top: 0; font-family: Georgia, serif; }
p.subtitle { color: var(--muted); margin-top: 0; }

/* ---------------- Hero ---------------- */
.hero {
    position: relative; margin: 0 -20px 40px; border-radius: 16px; overflow: hidden;
    min-height: 420px; display: flex; align-items: flex-end;
    background-size: cover; background-position: center;
}
.hero::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, rgba(0,0,0,.05) 0%, rgba(0,0,0,.65) 100%); }
.hero-content { position: relative; z-index: 2; color: #fff; padding: 40px; max-width: 700px; }
.hero-content h1 { font-size: 2.6rem; margin: 0 0 10px; }
.hero-content p { font-size: 1.1rem; }
.hero-actions { margin-top: 20px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------- Cards / grids ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 22px; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; margin-top: 20px; }
.room-card img { width: 100%; height: 170px; object-fit: cover; border-radius: 10px; background: #eee6db; margin-bottom: 12px; }
.room-card h3 { margin: 0 0 4px; font-family: Georgia, serif; }
.room-meta { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.badge { display: inline-block; background: #f3ece2; color: var(--primary-dark); border-radius: 999px; padding: 3px 11px; font-size: .78rem; margin: 2px 4px 2px 0; }
.price { font-weight: 700; font-size: 1.15rem; color: var(--primary-dark); }

.btn { display: inline-block; background: var(--primary); color: #fff; border: none; padding: 11px 20px; border-radius: 8px; text-decoration: none; font-size: .95rem; cursor: pointer; }
.btn:hover { background: var(--primary-dark); }
.btn-secondary { background: #6b5f57; }
.btn-secondary:hover { background: #4d443d; }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #962c21; }
.btn-small { padding: 7px 14px; font-size: .85rem; }
.btn-paypal { background: #ffc439; color: #002991; font-weight: 700; }
.btn-paypal:hover { background: #f0b429; }

form label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: .9rem; }
form input[type=text], form input[type=email], form input[type=tel], form input[type=number],
form input[type=password], form input[type=date], form select, form textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: .95rem; font-family: inherit;
}
form textarea { min-height: 90px; resize: vertical; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > div { flex: 1; min-width: 180px; }

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .95rem; }
.alert-success { background: #e3f3e8; color: #1e5c37; }
.alert-error { background: #fbe4e1; color: #8a2a1f; }

table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: .9rem; }
th { background: #f3ece2; }
.status-confirmed, .status-paid { color: var(--success); font-weight: 600; }
.status-cancelled, .status-failed { color: var(--danger); font-weight: 600; }
.status-pending_payment, .status-pending { color: #b8860b; font-weight: 600; }

.empty-state { text-align: center; color: var(--muted); padding: 40px 0; }
.top-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; flex-wrap: wrap; gap: 10px; }

/* ---------------- Location links ---------------- */
.map-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 14px; }
.map-links a { display: flex; align-items: center; gap: 8px; background: #f3ece2; padding: 12px 16px; border-radius: 10px; text-decoration: none; color: var(--primary-dark); font-weight: 600; }
.map-links a:hover { background: #ecdfcb; }

/* ---------------- Availability calendar ---------------- */
.cal-wrapper { margin: 18px 0 6px; border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: #fcfaf6; }
.cal-nav { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 10px; }
.cal-months-row { display: flex; gap: 24px; flex-wrap: wrap; }
.cal-month { flex: 1; min-width: 220px; }
.cal-header { text-align: center; font-weight: 600; margin-bottom: 8px; color: var(--primary-dark); text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { text-align: center; padding: 8px 0; font-size: .82rem; border-radius: 6px; cursor: pointer; background: #fff; border: 1px solid var(--border); }
.cal-cell:hover:not(.cal-disabled):not(.cal-empty) { background: #f3ece2; border-color: var(--primary); }
.cal-cell.cal-empty { background: transparent; border: none; cursor: default; }
.cal-cell.cal-disabled { color: #c9bfb3; background: #f4efe8; cursor: not-allowed; text-decoration: line-through; }
.cal-cell.cal-selected { background: var(--primary); color: #fff; border-color: var(--primary-dark); }

/* ---------------- Gallery ---------------- */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 20px; }
.gallery-item { display: block; border-radius: 10px; overflow: hidden; position: relative; }
.gallery-item img { width: 100%; height: 180px; object-fit: cover; display: block; transition: transform .3s; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-credit { font-size: .7rem; color: var(--muted); margin-top: 4px; }

#lightbox { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.88); z-index: 999; align-items: center; justify-content: center; flex-direction: column; cursor: zoom-out; }
#lightbox.open { display: flex; }
#lightbox img { max-width: 90vw; max-height: 82vh; border-radius: 8px; }
#lightboxCaption { color: #fff; margin-top: 14px; font-size: .95rem; }

/* ---------------- Footer ---------------- */
.site-footer { border-top: 1px solid var(--border); padding: 22px 0; color: var(--muted); font-size: .85rem; background: #fff; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.dev-credit a { color: var(--primary-dark); font-weight: 600; text-decoration: none; }
.dev-credit a:hover { text-decoration: underline; }

/* ---------------- Tables that might overflow on narrow screens ---------------- */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-responsive table { min-width: 640px; }

/* =====================================================================
   Responsive — tablet & mobile
   ===================================================================== */
@media (max-width: 780px) {
    .nav-toggle { display: inline-block; }
    .header-inner { position: relative; }
    .main-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        background: var(--primary-dark);
        margin-top: 12px;
        padding: 12px;
        border-radius: 10px;
    }
    .main-nav.nav-open { display: flex; }
    .main-nav a { padding: 10px 6px; border-radius: 6px; }
    .main-nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }
    .lang-switch { width: 100%; }
    .lang-switch-btn { width: 100%; text-align: left; }
    .lang-switch-menu { position: static; box-shadow: none; width: 100%; margin-top: 6px; }
    .admin-link { align-self: flex-start; }
}

@media (max-width: 640px) {
    .container { padding: 0 14px; }
    main { padding: 22px 14px 50px; }

    .hero { margin: 0 -14px 28px; min-height: 300px; border-radius: 12px; }
    .hero-content { padding: 22px; }
    .hero-content h1 { font-size: 1.6rem; }
    .hero-content p { font-size: 1rem; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; text-align: center; }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.2rem; }

    .card { padding: 16px; }
    .room-grid { gap: 12px; }
    .gallery-grid { gap: 10px; }

    .form-row { flex-direction: column; gap: 0; }
    .form-row > div { min-width: 0; }

    .top-actions { flex-direction: column; align-items: stretch; }
    .top-actions .btn { text-align: center; }

    .map-links { flex-direction: column; }
    .map-links a { justify-content: center; }

    .cal-months-row { flex-direction: column; gap: 14px; }
    .cal-month { min-width: 0; }
    .cal-cell { padding: 7px 0; font-size: .78rem; }

    #lightbox img { max-width: 94vw; max-height: 70vh; }

    .footer-inner { flex-direction: column; text-align: center; gap: 6px; }
}

@media (max-width: 420px) {
    .brand { font-size: 1.1rem; }
}
