/* =========================================================
   GALORINA — DISEÑO PROFESIONAL PLANO
   Inspirado en Booking.com / Airbnb / Modern marketplaces
   - Sin sombras, totalmente plano
   - 100% responsive (mobile-first)
   - Sistema consistente y limpio
========================================================= */

:root {
    /* Paleta */
    --primary: #003580;
    --primary-dark: #00224f;
    --primary-light: #e6effa;
    --secondary: #008009;
    --secondary-dark: #006907;
    --accent: #feba02;

    /* Neutrales */
    --bg: #f5f5f5;
    --panel: #ffffff;
    --text: #1a1a1a;
    --text-soft: #595959;
    --muted: #6b6b6b;
    --border: #e0e0e0;
    --border-strong: #c2c2c2;
    --hover: #f7f8fa;

    /* Estado */
    --danger: #c30404;
    --danger-bg: #ffeeee;
    --warning: #b8860b;
    --warning-bg: #fff8dc;
    --success: #008009;
    --success-bg: #e6f7e6;
    --info-bg: #e6f0fa;

    --radius: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    --header-h: 64px;
    --container-max: 1200px;
    --container-pad: 16px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; height: auto; display: block; }

button, input, select, textarea { font: inherit; color: inherit; }

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 12px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}
h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { margin: 0 0 12px; }

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-pad);
}

.section { padding: 24px 0; }
@media (min-width: 768px) { .section { padding: 32px 0; } }

/* HEADER */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: #fff;
    border: 0;
}
.site-header a { color: #fff; }

.header-top-strip {
    background: var(--primary-dark);
    font-size: 12px;
    color: #cfd9eb;
}
.header-top-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 32px;
    gap: 12px;
    flex-wrap: wrap;
}
.header-top-left, .header-top-right {
    display: flex;
    gap: 16px;
    align-items: center;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 16px;
    height: var(--header-h);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-decoration: none;
}
.brand:hover { text-decoration: none; }

.brand-mark {
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    background: #fff;
    color: var(--primary);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.site-logo { height: 36px; width: auto; object-fit: contain; }

.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-size: 18px; font-weight: 800; }
.brand-kicker { font-size: 11px; color: #cfd9eb; font-weight: 400; }

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    justify-content: center;
}
.nav a {
    padding: 8px 12px;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--radius);
    transition: background .15s;
}
.nav a:hover { background: rgba(255,255,255,.12); text-decoration: none; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.header-login, .header-register, .header-account, .header-logout {
    padding: 8px 14px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 13px;
    transition: background .15s;
    white-space: nowrap;
}
.header-login, .header-logout {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
}
.header-register, .header-account {
    background: #61CE70;
    color: #fff;
    border: 1px solid #61CE70;
}
.header-login:hover, .header-logout:hover {
    background: rgba(255,255,255,.12);
    text-decoration: none;
}
.header-register:hover, .header-account:hover {
    background: #4eb95e;
    border-color: #4eb95e;
    color: #fff;
    text-decoration: none;
}
.header-account {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    text-align: left;
}
.header-account span { font-size: 11px; color: rgba(255,255,255,.85); }
.header-account strong { font-size: 13px; color: #fff; }

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: var(--radius);
    width: 44px;
    height: 44px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    position: relative;
    z-index: 1001;
    -webkit-tap-highlight-color: rgba(255,255,255,.2);
    touch-action: manipulation;
}
.menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    transition: transform .25s, opacity .15s;
    transform-origin: center;
    pointer-events: none; /* el span no debe robar el click al botón */
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Overlay oscuro detrás del menú móvil */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 998;
    opacity: 0;
    transition: opacity .25s;
}
.mobile-menu-overlay.open {
    display: block;
    opacity: 1;
}

@media (max-width: 900px) {
    .menu-toggle { display: flex !important; }

    /* Asegurar que el header tenga z-index para que el botón esté encima */
    .header-main { position: relative; z-index: 1000; }

    .nav {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        left: auto !important;
        width: min(85vw, 320px) !important;
        max-width: 320px;
        background: #fff !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: calc(var(--header-h, 64px) + 16px) 20px 24px !important;
        z-index: 999 !important;
        transform: translateX(100%) !important;
        transition: transform .25s ease-out !important;
        gap: 0 !important;
        overflow-y: auto !important;
        box-shadow: -4px 0 16px rgba(0,0,0,.1);
        visibility: visible !important;
    }
    .nav.open { transform: translateX(0) !important; }
    .nav a {
        color: var(--text, #222) !important;
        background: transparent !important;
        padding: 14px 4px !important;
        border-bottom: 1px solid var(--border, #e0e0e0);
        width: 100% !important;
        font-size: 16px;
        display: block !important;
    }
    .nav a:hover { background: transparent !important; color: var(--primary, #045CB4) !important; }

    .header-actions { gap: 6px; }
    .header-actions .header-login,
    .header-actions .header-register,
    .header-actions .header-logout {
        padding: 6px 10px;
        font-size: 12px;
    }
    .brand-kicker { display: none; }
    .header-top-strip { display: none; }

    /* Bloquear scroll del body cuando menú abierto */
    body.menu-open { overflow: hidden; }
}

@media (max-width: 480px) {
    .header-account { display: none; }
    .header-actions .header-logout { display: none; }
    .brand-name { font-size: 16px; }
    .brand-mark { width: 32px; height: 32px; font-size: 14px; }
    .site-logo { height: 32px; }
}

/* SELECTOR DE IDIOMAS */
.lang-selector { position: relative; }
.lang-selector summary {
    padding: 8px 10px;
    list-style: none;
    cursor: pointer;
    border-radius: var(--radius);
    border: 1px solid rgba(255,255,255,.4);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.lang-selector summary::-webkit-details-marker { display: none; }
.lang-selector summary:hover { background: rgba(255,255,255,.12); }
.lang-selector .lang-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-width: 140px;
    overflow: hidden;
    z-index: 100;
}
.lang-selector .lang-menu a {
    display: block;
    color: var(--text);
    padding: 8px 12px;
    font-size: 13px;
}
.lang-selector .lang-menu a:hover { background: var(--hover); text-decoration: none; }

/* HERO */
.hero {
    background: var(--primary);
    color: #fff;
    padding: 32px 0 80px;
    position: relative;
}
.hero::after {
    content: "";
    position: absolute;
    left: 0; right: 0;
    bottom: -1px;
    height: 50px;
    background: var(--bg);
    clip-path: polygon(0 100%, 100% 100%, 100% 0);
}
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 32px;
    align-items: center;
}
.hero h1 {
    font-size: clamp(26px, 4vw, 40px);
    color: #fff;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.hero p {
    color: #d8e2f1;
    font-size: 16px;
    max-width: 560px;
    margin-bottom: 20px;
}
.hero-card {
    background: #fff;
    color: var(--text);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}
.hero-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}
.hero-card-content { padding: 16px; }

@media (max-width: 768px) {
    .hero { padding: 24px 0 60px; }
    .hero-grid { grid-template-columns: 1fr; gap: 20px; }
    .hero-card img { height: 180px; }
}

/* SEARCH BOX */
.marketplace-search {
    margin-top: -40px;
    position: relative;
    z-index: 5;
    margin-bottom: 24px;
}
.search-box {
    background: #fff;
    border: 2px solid var(--accent);
    border-radius: var(--radius-md);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(5, 1fr) auto;
    gap: 4px;
}
.search-box .field {
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 12px;
    min-height: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.search-box .field label {
    font-size: 11px;
    color: var(--muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.search-box .field input,
.search-box .field select {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    width: 100%;
    outline: none;
}
.search-box .btn {
    height: auto;
    min-height: 48px;
    padding: 0 24px;
    border-radius: var(--radius);
    font-size: 14px;
    background: var(--primary);
    color: #fff;
}

@media (max-width: 900px) {
    .search-box { grid-template-columns: 1fr 1fr; }
    .search-box .btn { grid-column: 1 / -1; }
}
@media (max-width: 480px) {
    .search-box { grid-template-columns: 1fr; }
    .marketplace-search { margin-top: -30px; }
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 18px;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
.btn:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}
.btn.secondary {
    background: var(--secondary);
    border-color: var(--secondary);
}
.btn.secondary:hover {
    background: var(--secondary-dark);
    border-color: var(--secondary-dark);
}
.btn.outline {
    background: #fff;
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn.outline:hover {
    background: var(--primary-light);
    color: var(--primary);
}
.btn.ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border-strong);
}
.btn.ghost:hover {
    background: var(--hover);
    color: var(--primary);
}
.btn.danger {
    background: var(--danger);
    border-color: var(--danger);
}
.btn.danger:hover {
    background: #a30303;
    border-color: #a30303;
}
.btn.sm { min-height: 32px; padding: 4px 12px; font-size: 13px; }
.btn.lg { min-height: 48px; padding: 12px 24px; font-size: 16px; }
.btn.block { display: flex; width: 100%; }

/* PANELS */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
@media (max-width: 600px) {
    .panel { padding: 16px; border-radius: var(--radius-md); }
}

/* CARDS GRID */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}
.card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color .15s;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}
.card:hover { border-color: var(--primary); }
.card-media {
    aspect-ratio: 4 / 3;
    background: var(--hover);
    position: relative;
    overflow: hidden;
}
.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.card-media .badge {
    position: absolute;
    left: 8px;
    top: 8px;
    background: rgba(255,255,255,.95);
}
.card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}
.card h3 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.card .card-sub {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
    color: var(--muted);
    font-size: 12px;
}
.card-meta .pill {
    background: var(--hover);
    padding: 3px 8px;
    border-radius: var(--radius);
    color: var(--text-soft);
}
.price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text);
    margin-top: auto;
}
.price-from {
    font-size: 11px;
    color: var(--muted);
    font-weight: 400;
    text-transform: uppercase;
}
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.card-actions .btn { flex: 1; }

.rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--primary);
    color: #fff;
    padding: 3px 6px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 12px;
}

/* LISTING ROW */
.listing-row {
    display: grid;
    grid-template-columns: 220px 1fr 200px;
    gap: 16px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
    min-width: 0;
    transition: border-color .15s;
}
.listing-row:hover { border-color: var(--primary); }
.listing-row > div { min-width: 0; }
.listing-row .listing-img {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--hover);
}
.listing-row .listing-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.listing-body {
    padding: 14px 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.listing-row h3 {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.listing-row .location {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.listing-row p {
    font-size: 13px;
    color: var(--text-soft);
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.listing-features {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.mini-pill {
    font-size: 11px;
    font-weight: 600;
    background: var(--hover);
    color: var(--text-soft);
    padding: 3px 8px;
    border-radius: var(--radius);
    white-space: nowrap;
}
.listing-side {
    padding: 14px 14px 14px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-left: 1px solid var(--border);
    padding-left: 14px;
    text-align: right;
}
.listing-side .price-block .price { font-size: 22px; }
.listing-side .price-block small { color: var(--muted); font-size: 11px; }

@media (max-width: 768px) {
    .listing-row { grid-template-columns: 120px 1fr; }
    .listing-row .listing-img {
        aspect-ratio: auto;
        height: 100%;
    }
    .listing-side {
        grid-column: 1 / -1;
        border-left: 0;
        border-top: 1px solid var(--border);
        padding: 12px 14px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }
    .listing-row h3 { font-size: 16px; }
    .listing-side .price-block .price { font-size: 18px; }
}
@media (max-width: 480px) {
    .listing-row { grid-template-columns: 100px 1fr; }
    .listing-body { padding: 10px 0; }
    .listing-row p { -webkit-line-clamp: 1; }
}

/* CATEGORY TABS */
.category-tabs {
    display: flex;
    gap: 6px;
    margin: 16px 0;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}
.category-tabs::-webkit-scrollbar { height: 4px; }
.category-tabs::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
.category-tab {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 14px;
    font-weight: 600;
    color: var(--text-soft);
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: all .15s;
}
.category-tab.active, .category-tab:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    text-decoration: none;
}

/* BADGES */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--radius);
    background: var(--hover);
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.badge.primary { background: var(--primary-light); color: var(--primary); }
.badge.success { background: var(--success-bg); color: var(--success); }
.badge.warning { background: var(--warning-bg); color: var(--warning); }
.badge.danger  { background: var(--danger-bg); color: var(--danger); }
.badge.info    { background: var(--info-bg); color: var(--primary); }

.payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}
.payment-badge.pending { background: var(--warning-bg); color: var(--warning); }
.payment-badge.success { background: var(--success-bg); color: var(--success); }
.payment-badge.danger  { background: var(--danger-bg); color: var(--danger); }
.payment-badge.info    { background: var(--info-bg); color: var(--primary); }
.payment-badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ALERTS */
.alert {
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--primary);
    background: var(--info-bg);
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
}
.alert.success { border-left-color: var(--success); background: var(--success-bg); }
.alert.warning { border-left-color: var(--warning); background: var(--warning-bg); }
.alert.error, .alert.danger { border-left-color: var(--danger); background: var(--danger-bg); }
.alert strong { display: block; margin-bottom: 4px; }
.alert small { display: block; margin-top: 4px; color: var(--text-soft); }

/* FORMS */
.form-row { margin-bottom: 16px; }
.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
.input,
input:not([type]), input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="tel"], input[type="date"], input[type="search"],
input[type="time"], input[type="search"], input[type="url"],
input[type="file"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: #fff;
    font-size: 14px;
    color: var(--text);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.input:focus, input:focus, select:focus, textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 53, 128, .1);
}
textarea { resize: vertical; min-height: 80px; }
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }
.form-help {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

/* TABLES */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: #fff;
}
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 600px;
}
.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table th {
    background: var(--hover);
    font-weight: 700;
    color: var(--text);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: var(--hover); }
.table .actions {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

/* ADMIN/PROVIDER SHELL */
.admin-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    min-height: 100vh;
    background: var(--bg);
}
.sidebar {
    background: var(--primary-dark);
    color: #fff;
    padding: 16px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}
.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 16px;
    border-bottom: 1px solid rgba(255,255,255,.15);
    margin-bottom: 12px;
}
.dashboard-brand span { color: #fff; font-weight: 700; font-size: 14px; }
.dashboard-brand .brand-mark { background: #fff; color: var(--primary-dark); }
.dashboard-logo {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: var(--radius);
    background: #fff;
    padding: 2px;
}
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.sidebar-nav a {
    color: #cfd9eb;
    padding: 10px 12px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.sidebar-nav a:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
    text-decoration: none;
}
.sidebar-nav a.active {
    background: var(--primary);
    color: #fff;
}
.sidebar-nav .badge-count {
    background: var(--accent);
    color: var(--text);
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    margin-left: 6px;
}
.admin-main {
    padding: 24px;
    min-width: 0;
}
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    background: var(--primary);
    color: #fff;
    border: 0;
    border-radius: var(--radius);
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    font-size: 14px;
}

@media (max-width: 900px) {
    .admin-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 240px;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform .25s;
        height: 100vh;
        padding-top: 60px;
    }
    .sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: flex; align-items: center; gap: 6px; }
    .admin-main { padding: 60px 14px 16px; }
}

/* STATS */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    border-left: 4px solid var(--primary);
}
.stat-card.success { border-left-color: var(--success); }
.stat-card.warning { border-left-color: var(--warning); }
.stat-card.danger { border-left-color: var(--danger); }
.stat-card .stat-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.stat-card .stat-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.1;
}
.stat-card .stat-sub {
    font-size: 12px;
    color: var(--text-soft);
    margin-top: 4px;
}

/* DETAIL */
.detail-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}
.detail-gallery {
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
}
.detail-gallery img {
    width: 100%;
    height: 380px;
    object-fit: cover;
}
.booking-box {
    position: sticky;
    top: calc(var(--header-h) + 16px);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
}
@media (max-width: 900px) {
    .detail-layout { grid-template-columns: 1fr; }
    .booking-box { position: static; }
    .detail-gallery img { height: 280px; }
}
@media (max-width: 480px) {
    .detail-gallery img { height: 200px; }
}

/* PAYMENT METHODS */
.payment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.payment-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    cursor: pointer;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: border-color .15s, background .15s;
    position: relative;
}
.payment-card:hover {
    border-color: var(--primary);
    background: var(--hover);
}
.payment-card input[type="radio"] {
    position: absolute;
    top: 12px;
    right: 12px;
    width: auto;
    margin: 0;
}
.payment-card:has(input:checked) {
    border-color: var(--primary);
    background: var(--primary-light);
}
.payment-card img {
    height: 28px;
    width: auto;
    margin-bottom: 4px;
}
.payment-card strong {
    font-size: 14px;
    color: var(--text);
}
.payment-card span {
    font-size: 12px;
    color: var(--muted);
}

/* STEPS */
.steps {
    list-style: none;
    counter-reset: step;
    margin: 12px 0;
    padding: 0;
}
.steps li {
    counter-increment: step;
    padding: 8px 0 8px 36px;
    position: relative;
    font-size: 14px;
}
.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 12px;
}

/* RECEIPT PREVIEW */
.receipt-preview {
    background: var(--hover);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 12px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.receipt-preview .icon { font-size: 32px; line-height: 1; }
.receipt-preview .info { flex: 1; min-width: 0; }
.receipt-preview .info strong {
    display: block;
    font-size: 13px;
    color: var(--text);
}
.receipt-preview .info small { color: var(--muted); font-size: 12px; }

/* HISTORY */
.history { margin: 12px 0; }
.history-item {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}
.history-item:last-child { border-bottom: 0; }
.history-item .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-strong);
    margin-top: 6px;
}
.history-item.upload .dot { background: var(--primary); }
.history-item.approval .dot { background: var(--success); }
.history-item.rejection .dot { background: var(--danger); }
.history-item .when { font-size: 11px; color: var(--muted); }
.history-item .what { font-weight: 600; }

/* MODAL */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 500;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal h2, .modal h3 { margin-top: 0; }
.modal-actions {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-end;
}
@media (max-width: 480px) {
    .modal { padding: 16px; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; }
}

/* FOOTER */
.footer {
    background: var(--primary-dark);
    color: #cfd9eb;
    padding: 32px 0 24px;
    margin-top: 40px;
}
.footer-inner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}
.footer-inner strong {
    display: block;
    color: #fff;
    margin-bottom: 8px;
    font-size: 14px;
}
.footer a { color: #cfd9eb; }
.footer a:hover { color: #fff; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 16px;
    font-size: 12px;
    text-align: center;
    color: #8a99b3;
}

/* UTILITIES */
.muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.show-mobile { display: none; }
@media (max-width: 600px) {
    .hide-mobile { display: none !important; }
    .show-mobile { display: block; }
}

/* AD SLOTS */
.ad-slot {
    background: var(--hover);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 12px;
    text-align: center;
    margin: 16px 0;
}
.ad-slot img { display: inline-block; max-width: 100%; }

/* JOB CARDS */
.job-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: border-color .15s;
    min-width: 0;
}
.job-card:hover { border-color: var(--primary); }
.job-card h3 {
    font-size: 16px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.job-card .job-meta {
    color: var(--muted);
    font-size: 12px;
    margin-bottom: 8px;
}

/* PROVIDER CARDS */
.provider-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: center;
    transition: border-color .15s;
    min-width: 0;
}
.provider-card:hover { border-color: var(--primary); }
.provider-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: var(--hover);
    overflow: hidden;
    border: 1px solid var(--border);
}
.provider-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.provider-card h3 {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* PLAN CARDS */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}
.plan-card {
    background: #fff;
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: border-color .15s;
}
.plan-card:hover { border-color: var(--primary); }
.plan-card.featured {
    border-color: var(--primary);
    position: relative;
}
.plan-card.featured::before {
    content: "Recomendado";
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: #fff;
    padding: 4px 12px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.plan-card h3 { margin: 0 0 8px; font-size: 18px; }
.plan-card .plan-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}
.plan-card .plan-price small {
    font-size: 13px;
    color: var(--muted);
    font-weight: 400;
}
.plan-card ul {
    list-style: none;
    padding: 0;
    margin: 12px 0 16px;
    flex: 1;
}
.plan-card ul li {
    padding: 6px 0 6px 22px;
    position: relative;
    font-size: 13px;
    color: var(--text-soft);
}
.plan-card ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success);
    font-weight: 700;
}

/* AUTH */
.auth-shell {
    max-width: 420px;
    margin: 32px auto;
}
.auth-shell .panel { padding: 24px; }
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    margin: -24px -24px 20px;
}
.auth-tabs a {
    flex: 1;
    text-align: center;
    padding: 14px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.auth-tabs a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}
.auth-tabs a:hover { text-decoration: none; }

/* CHAT */
.chat-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    height: calc(100vh - var(--header-h) - 80px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
}
.chat-list {
    border-right: 1px solid var(--border);
    overflow-y: auto;
    background: var(--hover);
}
.chat-thread {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.chat-msg {
    max-width: 80%;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    font-size: 13px;
    word-wrap: break-word;
}
.chat-msg.in { background: var(--hover); color: var(--text); }
.chat-msg.out {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
}
.chat-input {
    border-top: 1px solid var(--border);
    padding: 12px;
    display: flex;
    gap: 8px;
}
@media (max-width: 768px) {
    .chat-shell { grid-template-columns: 1fr; height: auto; min-height: 70vh; }
    .chat-list { display: none; }
}

/* PRINT */
@media print {
    .site-header, .footer, .sidebar, .sidebar-toggle,
    .menu-toggle, .nav, .header-actions, .btn { display: none !important; }
    .admin-shell { grid-template-columns: 1fr; }
    .panel, .card { border: 1px solid #000 !important; }
}

/* COMPATIBILIDAD CON CLASES ANTIGUAS - GALORINA LEGACY */

/* Topbar de admin/provider */
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.admin-topbar h1 { margin: 0 0 4px; }
.admin-topbar p { margin: 0; color: var(--muted); font-size: 13px; }

/* Stats simple (legacy) */
.stat {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    border-left: 4px solid var(--primary);
}
.stat span {
    display: block;
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 4px;
}
.stat strong {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}

/* Status pills inline (legacy) */
.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--hover);
    color: var(--text-soft);
}
.status.published, .status.active, .status.confirmed, .status.approved, .status.paid {
    background: var(--success-bg); color: var(--success);
}
.status.pending, .status.draft, .status.pending_qr, .status.pending_cash {
    background: var(--warning-bg); color: var(--warning);
}
.status.rejected, .status.cancelled, .status.failed {
    background: var(--danger-bg); color: var(--danger);
}

/* Botones legacy small */
.btn.small {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 13px;
}
.btn.small.ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid var(--border-strong);
}
.btn.small.chat {
    background: var(--info-bg);
    color: var(--primary);
    border: 1px solid var(--primary);
}
.btn.small.whatsapp {
    background: #25d366;
    color: #fff;
    border: 1px solid #25d366;
}
.btn.small.pay {
    background: var(--secondary);
    color: #fff;
    border: 1px solid var(--secondary);
}

/* Sidebar overlay para móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.5);
    z-index: 140;
}
.sidebar-overlay.open {
    display: block;
}

/* Op-badge */
.op-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.op-badge.rent { background: var(--info-bg); color: var(--primary); }
.op-badge.sale { background: var(--success-bg); color: var(--success); }
.op-badge.gallery-op {
    position: absolute;
    top: 12px;
    left: 12px;
}

/* Section title (legacy) */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}
.section-title h2, .section-title h1 { margin: 0 0 4px; }
.section-title p { margin: 0; color: var(--muted); font-size: 13px; }

/* Eyebrow */
.eyebrow {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 8px;
}

/* Provider logo inline (legacy) */
.provider-logo-inline {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 4px;
}

/* Active plan pill */
.active-plan {
    background: var(--success-bg);
    color: var(--success);
}

/* Guest card (booking forms) */
.guest-card {
    background: var(--hover);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
}
.guest-card h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
}

/* Code input (verify-email) */
.code-input {
    font-size: 24px !important;
    text-align: center;
    letter-spacing: 8px;
    font-weight: 700;
}

/* Dashboard grid (account) */
.dashboard-grid {
    display: grid;
    gap: 16px;
}

/* Auth panel legacy */
.auth-panel { padding: 24px; }
.auth-tab {
    flex: 1;
    text-align: center;
    padding: 14px;
    color: var(--muted);
    font-weight: 600;
    border-bottom: 2px solid transparent;
}
.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.google-btn {
    background: #fff;
    color: var(--text);
    border: 1px solid var(--border-strong);
    margin-top: 8px;
}

/* Container narrow */
.container.narrow {
    max-width: 600px;
}

/* Resend form */
.resend-form {
    margin-top: 12px;
    text-align: center;
}

/* Chat legacy */
.whatsapp-panel {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
}
.wa-head {
    background: var(--primary);
    color: #fff;
    padding: 14px 18px;
}
.wa-head strong { display: block; }
.wa-head span { font-size: 12px; color: #cfd9eb; }
.wa-body {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
    background: var(--hover);
}
.wa-msg {
    background: #fff;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    max-width: 80%;
    border: 1px solid var(--border);
}
.wa-msg.me {
    background: var(--primary);
    color: #fff;
    margin-left: auto;
    border-color: var(--primary);
}
.wa-msg strong { display: block; font-size: 11px; opacity: .8; }
.wa-msg p { margin: 2px 0; }
.wa-msg img { max-width: 100%; border-radius: 4px; margin-top: 4px; }
.wa-msg small { font-size: 10px; opacity: .6; display: block; margin-top: 4px; }
.wa-compose {
    border-top: 1px solid var(--border);
    padding: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Room list (legacy) */
.room-list { display: flex; flex-direction: column; gap: 8px; }
.room-card {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    background: var(--hover);
    border-radius: var(--radius);
    padding: 12px;
    border: 1px solid var(--border);
}
.room-card img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: var(--radius);
}
.room-card h3 { margin: 0 0 4px; font-size: 14px; }

/* Panel table-wrap */
.panel.table-wrap { padding: 0; overflow: hidden; }
.panel.table-wrap .table { margin: 0; }

/* Plan grid (alias) */
.plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

/* Provider grid (alias) */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.provider-card-logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--primary-light);
    border: 1px solid var(--border);
}
.provider-card-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.provider-logo-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}
.provider-card-body { text-align: center; }
.provider-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 10px;
}
.provider-service-count {
    font-size: 12px;
    margin: 8px 0 0;
}

/* Row actions (legacy listing) */
.row-actions {
    padding: 14px 14px 14px 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    text-align: right;
}
.row-actions .price { font-size: 22px; }
.row-actions .btn { white-space: nowrap; }

/* Gallery (legacy) */
.gallery-main {
    position: relative;
}
.gallery-thumbs {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.gallery-thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
}
.gallery-thumb.active {
    border-color: var(--primary);
}

/* Detail content (legacy) */
.detail-content { padding: 16px 0; }
.listing-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

/* Chat box (legacy) */
.chat-box {
    max-height: 60vh;
    overflow-y: auto;
}
.chat-box .message {
    background: var(--hover);
    padding: 10px 12px;
    border-radius: var(--radius);
    margin-bottom: 8px;
    border: 1px solid var(--border);
}
.chat-box .message strong {
    display: block;
    font-size: 12px;
    color: var(--primary);
    margin-bottom: 2px;
}
.chat-box .message small {
    color: var(--muted);
    font-size: 11px;
}

/* Booking summary alert */
.alert.error[data-booking-summary],
[data-booking-summary] {
    margin: 12px 0;
}
[data-booking-summary].error {
    border-left-color: var(--danger);
    background: var(--danger-bg);
}

/* ACCESSIBILITY */
:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
