:root {
    --primary: #f27f0d;
    --primary-dark: #d66d0a;
    --bg-light: #f8f7f5;
    --bg-dark: #221910;
    --text-main: #1c140d;
    --text-muted: #9c7349;
    --white: #ffffff;
    --radius-lg: 2rem;
    --radius-md: 1rem;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
}

.mobile-container {
    max-width: 430px;
    margin: 0 auto;
    background: var(--bg-light);
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
}

header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(248, 247, 245, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* Estilos de Marcadores Premium (Compartidos) */
.custom-marker-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 44px;
    margin-left: -22px;
    margin-top: -22px;
}

.marker-logo-circle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    /* Sin fondo ni bordes para que el logo flote */
}

.marker-logo-circle img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: none;
    z-index: 2;
    /* Sombra suave para que el logo flote con profundidad */
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.2));
}

.marker-fallback {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    font-weight: 800;
    font-size: 13px;
    z-index: 1;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.marker-label {
    background: rgba(255,255,255,0.85);
    padding: 1px 6px;
    border-radius: 6px;
    font-size: 8px;
    font-weight: 800;
    margin-top: 2px;
    white-space: nowrap;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(0,0,0,0.05);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    background: var(--primary);
    color: white;
    padding: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.user-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

main {
    padding: 0 20px 100px;
}

h1 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

#map {
    width: 100%;
    height: 300px;
    border-radius: var(--radius-lg);
    margin: 25px 0;
    box-shadow: var(--shadow);
    z-index: 1;
    position: relative; /* Asegurar contexto para el overlay */
}

/* Animación de carga del mapa */
@keyframes pulse-map {
    0% { opacity: 0.7; }
    50% { opacity: 0.4; }
    100% { opacity: 0.7; }
}

.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: var(--radius-lg);
    transition: opacity 0.5s ease-out;
}

.map-loading-text {
    font-weight: 600;
    color: var(--primary);
    animation: pulse-map 1.5s infinite ease-in-out;
    margin-top: 10px;
}

/* Sección de Ofertas Destacadas */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 30px 0 15px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-main);
}

.view-all {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
}

.offer-card {
    background: white;
    border-radius: 24px;
    padding: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    border: 1px solid rgba(0,0,0,0.04);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.offer-card:active {
    transform: scale(0.97);
}

.offer-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 100px; height: 100px;
    background: radial-gradient(circle, rgba(242,127,13,0.05) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.offer-top {
    display: flex;
    align-items: center;
    gap: 12px;
}

.offer-brand-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fdfdfd;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.offer-brand-logo img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.offer-main-info {
    flex: 1;
}

.offer-main-info h3 {
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.offer-location {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.offer-reward-tag {
    background: #fff4e6;
    color: var(--primary);
    padding: 10px 15px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.offer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 4px;
    padding: 0 4px;
}

.availability-bar-container {
    flex: 1;
    height: 6px;
    background: #f0f0f0;
    border-radius: 10px;
    margin-right: 15px;
    overflow: hidden;
}

.availability-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #ffb366);
    border-radius: 10px;
}

.availability-text {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.trending-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #ffeded;
    color: #ff4d4d;
    font-size: 10px;
    font-weight: 900;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Navbar inferior */
.bottom-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 380px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 10px 30px;
    display: flex;
    justify-content: space-between;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    z-index: 2000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
    text-decoration: none;
}

.nav-item.active {
    color: var(--primary);
}

.nav-item span {
    font-size: 24px;
}

/* Desktop optimization */
@media (min-width: 431px) {
    body {
        background-color: #e5e7eb;
    }
}

/* Fix para el desborde de Leaflet */
.leaflet-container {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-lg);
}

.custom-div-icon div {
    animation: marker-pulse 2s infinite;
}

/* Estilos para ocultar elementos en pantallas limpias (Login/Registro) */
body.hide-elements .user-badge {
    display: none;
}

body.hide-elements .logo-container {
    margin: 0 auto;
}

