:root {
    --primary-color: #72379f;
    --primary-hover: #5e2a86;
    --secondary-color: #9e2628;
    --accent-color: #ffc107;
    --text-dark: #333;
    --text-light: #fff;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
    --border-radius: 16px;
}

#map-section {
    width: 100%;
    position: relative;
    display: block;
    clear: both;
    border-top: 4px solid var(--secondary-color);
    background: #eee;
}

.page-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.map-title-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 24px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.map-title-container:hover {
    transform: translateX(-50%) translateY(-5px) scale(1.03);
    background: white;
    box-shadow: 0 12px 40px rgba(114, 55, 159, 0.25);
}

.map-title-container .live-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-title-container h1 {
    font-size: 0.95rem;
    color: var(--secondary-color);
    font-weight: 800;
    margin: 0;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}

.map-title-container .dot {
    height: 10px;
    width: 10px;
    background-color: #28a745;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    animation: pulse 2s infinite;
}

/* Remove the line decoration for the overlay style */
.map-title-container h1::after {
    display: none;
}

.hero-content {
    position: absolute;
    z-index: 10;
    background: rgba(0, 0, 0, 0.4);
    padding: 20px 40px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    width: 80%;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.hero-content p {
    font-size: 1.1rem;
    opacity: 0.9;
}

#portada,
#portada_movil {
    width: 100%;
}

#portada img,
#portada_movil img {
    width: 100%;
    height: auto;
    display: block;
}

#map {
    height: 540px !important;
    width: 100%;
    position: relative;
    z-index: 1;
    border-bottom: 2px solid #eee;
}

/* Container for tracking info below map */
.tracking-info-container {
    position: relative;
    margin: 30px auto;
    z-index: 10;
    width: calc(100% - 40px);
    max-width: 500px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

@media (min-width: 600px) {
    .tracking-info-container {
        max-width: 800px;
    }
}

/* Grid for multiple cards */
.status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

@media (min-width: 600px) {
    .status-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.status-card {
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid #eee;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
    animation: slideUp 0.5s ease-out;
}

.status-card:hover {
    transform: translateY(-5px);
}

.status-card.secondary {
    border-left: 5px solid var(--primary-color);
}

.status-details {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 600;
}

.status-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
}

.map-title-container .live-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    padding: 0;
    margin-bottom: -2px;
}

.dot {
    height: 8px;
    width: 8px;
    background-color: #28a745;
    border-radius: 50%;
    display: inline-block;
    animation: pulse 1.5s infinite;
}

.icon-indicator {
    font-size: 24px;
    color: var(--primary-color);
    opacity: 0.3;
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(40, 167, 69, 0);
    }

    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

#cambiarUbicacionBtn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(114, 55, 159, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    width: 100%;
}

#cambiarUbicacionBtn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(114, 55, 159, 0.4);
}

#cambiarUbicacionBtn:active {
    transform: translateY(0);
}

#cambiarUbicacionBtn i {
    margin-right: 10px;
}

.pulse-animation {
    animation: icon-pulse 2s infinite;
}

@keyframes icon-pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

#marchaLinkIcon:hover {
    transform: scale(1.3) rotate(10deg);
}

/* Leaflet Customizations */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
}

.leaflet-popup-tip {
    box-shadow: var(--glass-shadow);
}

.leaflet-control-zoom {
    border: none !important;
    box-shadow: var(--glass-shadow) !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    border-radius: 8px !important;
    margin-bottom: 2px;
}