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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== TOP HEADER ==================== */
.top-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,0.95);
    padding: 10px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-wrap: wrap;
    gap: 10px;
}

.header-left h1 {
    font-size: 1.2rem;
    color: #0f3460;
    white-space: nowrap;
}

.header-logo {
    height: 46px;
    width: auto;
    display: block;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex: 1;
    justify-content: center;
    flex-wrap: wrap;
}

.header-nav a {
    color: #0f3460;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 600;
    padding: 6px 4px;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.header-nav a:hover {
    color: #1e88e5;
    border-bottom-color: #1e88e5;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.login-form-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.login-field input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    width: 140px;
    transition: border-color 0.3s;
}

.login-field input:focus {
    border-color: #0f3460;
}

.btn-login {
    padding: 8px 20px;
    background: #0f3460;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    white-space: nowrap;
}

.btn-login:hover {
    background: #1a4a7a;
}

.btn-login:disabled {
    background: #999;
    cursor: not-allowed;
}

.error-msg {
    background: #ffe0e0;
    color: #c0392b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
}

.client-link {
    color: #0f3460;
    font-size: 0.85rem;
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
}

.client-link:hover {
    text-decoration: underline;
}

/* ==================== MAIN ==================== */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 70px 20px 60px;
    background:
        radial-gradient(circle at 20% 30%, rgba(30,136,229,0.25), transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(255,213,79,0.12), transparent 40%);
}

.hero-inner {
    max-width: 760px;
}

.hero-inner h1 {
    color: #fff;
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.2;
}

.hero-inner p {
    color: #cfe0f5;
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 28px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-hero {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    background: #ffd54f;
    color: #1a1a2e;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.btn-hero-outline {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255,255,255,0.6);
    box-shadow: none;
}

.btn-hero-outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: #fff;
}

.main-content {
    flex: 1;
    display: flex;
    padding: 16px 0;
}

.comercios-panel {
    display: flex;
    gap: 16px;
    width: 100%;
}

.comercios-list {
    flex: 0 0 380px;
    background: rgba(255,255,255,0.95);
    border-radius: 0 10px 10px 0;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.comercios-list h2 {
    color: #0f3460;
    font-size: 1.1rem;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e0e0e0;
}

.filtro-localidad {
    width: 100%;
    padding: 8px 10px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.85rem;
    outline: none;
    margin-bottom: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.3s;
}

.filtro-localidad:focus {
    border-color: #0f3460;
}

.comercios-map {
    flex: 1;
    background: #ddd;
    border-radius: 10px 0 0 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-height: 500px;
    z-index: 1;
}

.comercios-map .leaflet-container {
    border-radius: 10px 0 0 10px;
}

/* ==================== COMERCIO CARDS ==================== */
#comerciosContainer {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.comercio-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.comercio-card:hover {
    background: #eef2f7;
}

.comercio-card.selected {
    background: #e3edf7;
    border-color: #0f3460;
}

.com-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.com-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.com-info strong {
    font-size: 0.9rem;
    color: #1a1a2e;
}

.com-rubro {
    font-size: 0.8rem;
    color: #0f3460;
    font-weight: 600;
}

.com-direccion {
    font-size: 0.78rem;
    color: #555;
}

.com-localidad {
    font-size: 0.75rem;
    color: #888;
}

/* ==================== CLIENT LOGIN ==================== */
.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    background: rgba(255,255,255,0.95);
    border-radius: 12px;
    padding: 30px 32px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.login-box h1 {
    color: #0f3460;
    font-size: 1.4rem;
    margin-bottom: 4px;
}

.login-logo {
    display: block;
    width: 240px;
    max-width: 100%;
    height: auto;
    margin: 0 auto 14px;
}

.login-box h2 {
    color: #666;
    font-size: 0.95rem;
    font-weight: 400;
    margin-bottom: 20px;
}

.login-box .form-group {
    margin-bottom: 14px;
    text-align: left;
}

.login-box .form-group label {
    display: block;
    font-size: 0.8rem;
    color: #555;
    margin-bottom: 4px;
    font-weight: 600;
}

.login-box .form-group input {
    width: 100%;
    padding: 9px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s;
}

.login-box .form-group input:focus {
    border-color: #0f3460;
}

.login-box .btn-login {
    width: 100%;
    margin-top: 6px;
}

.link-volver {
    display: inline-block;
    margin-top: 16px;
    color: #0f3460;
    font-size: 0.82rem;
    text-decoration: none;
    font-weight: 600;
}

.link-volver:hover {
    text-decoration: underline;
}

.no-cliente {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.no-cliente p {
    margin: 0 0 10px;
    color: #555;
    font-size: 0.85rem;
}

.btn-whatsapp {
    display: inline-block;
    background: #25D366;
    color: #fff;
    padding: 10px 22px;
    border-radius: 24px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.3s;
}

.btn-whatsapp:hover {
    background: #1fb959;
}

/* ==================== SCROLLBAR ==================== */
.seccion-contacto {
    padding: 50px 20px 60px;
    background: rgba(255,255,255,0.04);
}

.contacto-inner {
    max-width: 820px;
    margin: 0 auto;
    text-align: center;
}

.contacto-inner h2 {
    color: #fff;
    font-size: 1.7rem;
    margin-bottom: 8px;
}

.contacto-inner > p {
    color: #cfe0f5;
    margin-bottom: 30px;
}

.contacto-grid {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

.contacto-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.95);
    color: #0f3460;
    text-decoration: none;
    padding: 22px 30px;
    border-radius: 12px;
    min-width: 220px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.contacto-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(0,0,0,0.28);
}

.contacto-item strong {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
}

.contacto-item span {
    font-size: 1.05rem;
    font-weight: 600;
    color: #0f3460;
}

.site-footer {
    text-align: center;
    padding: 18px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    color: #9db3cc;
    font-size: 0.82rem;
}

.site-footer a {
    color: #ffd54f;
    text-decoration: none;
    font-weight: 600;
}

.site-footer a:hover {
    text-decoration: underline;
}

.comercios-list::-webkit-scrollbar {
    width: 6px;
}
.comercios-list::-webkit-scrollbar-track {
    background: transparent;
}
.comercios-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.comercios-list::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .top-header {
        flex-direction: column;
        align-items: stretch;
    }
    .header-nav {
        justify-content: center;
        order: 3;
    }
    .header-right {
        justify-content: center;
    }
    .login-form-inline {
        justify-content: center;
    }
    .login-field input {
        width: 120px;
    }
    .hero-inner h1 {
        font-size: 1.8rem;
    }
    .comercios-panel {
        flex-direction: column;
    }
    .comercios-list {
        flex: none;
        max-height: 300px;
    }
    .comercios-map {
        min-height: 350px;
    }
    .contacto-item {
        min-width: 180px;
        padding: 18px 22px;
    }
}
