/* Variables Globales - Paleta Corporativa Premium */
:root {
    --primary: #0f172a;
    /* Azul Marino Oscuro / Navy */
    --primary-light: #1e293b;
    --secondary: #0ea5e9;
    /* Azul Eléctrico para acentos */
    --secondary-hover: #0284c7;
    --accent: #f59e0b;
    /* Dorado para alertas/CTA alternativos */
    --bg-light: #f8fafc;
    /* Fondo claro */
    --text-main: #334155;
    /* Texto principal */
    --text-muted: #64748b;
    /* Texto secundario */
    --white: #ffffff;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
    /* Offset for fixed header */
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* Header Glassmorphism */
header {
    background: var(--glass-bg);
    padding: 0px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: var(--shadow-sm);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

.logo-img {
    height: 80px;
    object-fit: contain;
    transition: transform 0.35s ease;
}

.brand {
    display: inline-flex;
    align-items: center;
}

.brand:hover .logo-img {
    transform: translateY(-2px) scale(1.02);
}

/* Navegación */
nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--secondary);
    transition: width 0.3s ease;
    border-radius: 3px;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

.nav-link.active {
    color: var(--secondary);
}

/* Menú Toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1001;
    transition: color 0.3s ease;
}

.menu-toggle:hover {
    color: var(--secondary);
}

/* Layout Secciones */
.page-section {
    min-height: 100vh;
    padding-top: 0px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Animación Scroll Reveal */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.85) 0%, rgba(30, 41, 59, 0.8) 100%), url('Images/trasporte.webp') 20% 32%/cover no-repeat;
    color: var(--white);
    padding: 8rem 5% 6rem;
    text-align: center;
    border-radius: 0 0 40px 40px;
    margin: 0 1rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.hero-text {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: #cbd5e1;
    margin-bottom: 2.5rem;
    font-weight: 400;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary);
    color: var(--white);
    text-decoration: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: 0 10px 20px rgba(14, 165, 233, 0.3);
}

.cta-button:hover {
    transform: translateY(-3px);
    background: var(--secondary-hover);
    box-shadow: 0 15px 30px rgba(14, 165, 233, 0.4);
}

/* Banners y Stats */
.trust-banner {
    padding: 4rem 5%;
    text-align: center;
}

.trust-banner h3 {
    color: var(--primary);
    font-size: 1.8rem;
    margin-bottom: 2rem;
}

.stats-container {
    display: flex;
    justify-content: center;
    gap: 5rem;
    flex-wrap: wrap;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-number {
    display: block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--secondary);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat span:last-child {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-muted);
}

/* Sección Quiénes Somos / Visión */
.nosotros-section {
    background-color: var(--white);
    padding: 5rem 5%;
}

.nosotros-container {
    max-width: 1000px;
    margin: 0 auto;
    text-align: center;
}

.nosotros-title {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.nosotros-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    line-height: 1.8;
}

.nosotros-subtitle {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 2rem;
}

.compromiso-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    text-align: left;
}

.compromiso-card {
    background: var(--bg-light);
    padding: 2.5rem;
    border-radius: 16px;
    border-left: 4px solid var(--secondary);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    cursor: default;
}

.compromiso-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(14, 165, 233, 0.05));
    transition: width 0.4s ease;
}

.compromiso-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-left-width: 8px;
}

.compromiso-card:hover::after {
    width: 100%;
}

.card-icon-animated {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
    transition: transform 0.4s ease;
    display: inline-block;
}

.compromiso-card:hover .card-icon-animated {
    transform: scale(1.2) rotate(5deg);
    color: var(--primary);
}

.card-text {
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 500;
    position: relative;
    z-index: 2;
}

/* Sección Servicios */
.services-section {
    padding: 5rem 5%;
    background-color: var(--white);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-header .subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--secondary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: rgba(14, 165, 233, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--secondary);
    margin-bottom: 1.5rem;
}

.card h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.card p {
    color: var(--text-muted);
    line-height: 1.7;
}

/* Sección Contacto */
.contact-section {
    padding: 5rem 5%;
    background-color: var(--bg-light);
    display: flex;
    justify-content: center;
}

.contact-card {
    background: var(--white);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    max-width: 1000px;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    overflow: hidden;
}

.contact-header {
    background: var(--primary);
    color: var(--white);
    padding: 3rem;
}

.contact-header h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.contact-header p {
    color: #cbd5e1;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-content {
    display: contents;
    /* Allows child elements to participate in parent grid if needed, or we just structure differently */
}

.contact-card {
    display: flex;
    flex-direction: row;
}

.contact-info-panel {
    background: var(--primary);
    color: var(--white);
    padding: 3rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contact-header-text h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--white);
}

.contact-header-text p {
    color: #cbd5e1;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.contact-form-panel {
    padding: 3.5rem 3rem;
    flex: 1.2;
    background: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-item i {
    background: rgba(14, 165, 233, 0.1);
    color: var(--secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.info-item h4 {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.info-item p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Floating Labels Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 1.2rem 1rem 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: transparent;
    transition: border-color 0.3s ease;
    color: var(--text-main);
}

.contact-form textarea {
    resize: vertical;
    min-height: 120px;
    padding-top: 1.6rem;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: var(--secondary);
}

.contact-form label {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 1rem;
}

/* Alinear el label al inicio en el textarea ya que es más alto */
.contact-form textarea ~ label {
    top: 1.2rem;
    transform: none;
}

.contact-form input:focus~label,
.contact-form input:not(:placeholder-shown)~label,
.contact-form textarea:focus~label,
.contact-form textarea:not(:placeholder-shown)~label {
    top: 0.4rem;
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 600;
    transform: translateY(0);
}

.contact-form select:focus~.select-label,
.contact-form select:valid~.select-label {
    top: 0.5rem;
    font-size: 0.75rem;
    color: var(--secondary);
    font-weight: 600;
}

.submit-btn {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.submit-btn:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(15, 23, 42, 0.15);
}

/* Footer */
.main-footer {
    background: var(--primary);
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 5%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Botón Flotante WhatsApp */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    right: 40px;
    background-color: #25d366;
    color: #FFF;
    border-radius: 50%;
    text-align: center;
    font-size: 32px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-float:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.3);
}

/* Botón Flotante Facebook */
.facebook-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 110px;
    right: 40px;
    background-color: #1877f2;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    font-size: 32px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.facebook-float:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 15px 30px rgba(24, 119, 242, 0.3);
}

/* Botón de Música */
.music-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 40px;
    left: 40px;
    background-color: #7c3aed;
    color: #fff;
    border-radius: 50%;
    border: none;
    text-align: center;
    font-size: 28px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.music-float:hover {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 15px 30px rgba(124, 58, 237, 0.3);
}

/* Responsive */
@media (max-width: 992px) {
    .contact-card {
        flex-direction: column;
    }

    .contact-info-panel {
        padding: 3rem 2rem;
    }

    .contact-form-panel {
        padding: 3rem 2rem;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 6rem 5% 4rem;
        margin: 0;
        border-radius: 0 0 24px 24px;
    }

    .hero h2 {
        font-size: 2.2rem;
    }

    .hero p {
        font-size: 1.05rem;
    }

    header {
        justify-content: center;
        padding: 0.5rem 1rem;
        height: 80px;
        position: fixed;
        width: 100%;
        top: 0;
        z-index: 1000;
    }

    .logo-container {
        display: flex;
        justify-content: center;
        width: 100%;
    }

    .logo-img {
        height: 60px; /* slightly smaller to fit header height */
    }

    .menu-toggle {
        display: block;
        position: absolute;
        right: 1.5rem;
        top: 50%;
        transform: translateY(-50%);
    }

    nav {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--glass-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        flex-direction: column;
        gap: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        border-top: 1px solid var(--glass-border);
        border-bottom: 1px solid var(--glass-border);
        padding: 0;
        z-index: 999;
    }

    nav.active {
        display: flex;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 1.2rem;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        border-radius: 0;
    }

    .nav-link::after {
        display: none;
    }

    .nav-link.active {
        background: rgba(14, 165, 233, 0.05);
        color: var(--secondary);
    }

    .stats-container {
        gap: 2rem;
    }

    .whatsapp-float {
        bottom: 30px;
        right: 20px;
    }

    .facebook-float {
        bottom: 100px;
        right: 20px;
    }

    .music-float {
        bottom: 30px;
        left: 20px;
    }
}

/* ============================
   COIN FLIP OVERLAY
   ============================ */
.coin-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.coin-overlay.active {
    opacity: 1;
    visibility: visible;
}

.coin-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

/* Coin 3D Container */
.coin-container {
    width: 200px;
    height: 200px;
    perspective: 800px;
}

.coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    /* Initial state: not spinning */
}

.coin.spinning {
    animation: coinFlip 2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.coin-front,
.coin-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 30px rgba(14, 165, 233, 0.4),
        0 0 60px rgba(14, 165, 233, 0.15),
        inset 0 0 15px rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e293b 100%);
    border: 3px solid rgba(14, 165, 233, 0.5);
}

.coin-back {
    transform: rotateY(180deg);
}

.coin-img {
    width: 90%;
    height: 90%;
    object-fit: contain;
    border-radius: 50%;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3));
}

@keyframes coinFlip {
    0% {
        transform: rotateY(0deg) scale(0.3);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    25% {
        transform: rotateY(720deg) scale(1.1);
    }
    50% {
        transform: rotateY(1440deg) scale(1);
    }
    75% {
        transform: rotateY(2160deg) scale(1.05);
    }
    100% {
        transform: rotateY(2880deg) scale(1);
    }
}

/* Brillo pulsante después de aterrizar */
.coin.landed {
    animation: coinGlow 2s ease-in-out infinite;
}

@keyframes coinGlow {
    0%, 100% {
        filter: drop-shadow(0 0 15px rgba(14, 165, 233, 0.3));
    }
    50% {
        filter: drop-shadow(0 0 35px rgba(14, 165, 233, 0.6));
    }
}

/* Partículas decorativas */
.coin-container::before,
.coin-container::after {
    content: '✦';
    position: absolute;
    font-size: 1.5rem;
    color: var(--accent);
    opacity: 0;
    z-index: 1;
}

.coin.spinning ~ .coin-container::before,
.coin-overlay.active .coin-container::before {
    animation: sparkle1 2s 1.5s ease forwards;
}

.coin.spinning ~ .coin-container::after,
.coin-overlay.active .coin-container::after {
    animation: sparkle2 2s 1.8s ease forwards;
}

@keyframes sparkle1 {
    0% { opacity: 0; transform: translate(-30px, -20px) scale(0); }
    50% { opacity: 1; transform: translate(-50px, -40px) scale(1.2); }
    100% { opacity: 0; transform: translate(-70px, -60px) scale(0); }
}

@keyframes sparkle2 {
    0% { opacity: 0; transform: translate(30px, 20px) scale(0); }
    50% { opacity: 1; transform: translate(50px, -30px) scale(1); }
    100% { opacity: 0; transform: translate(70px, -50px) scale(0); }
}

/* Texto de éxito */
.coin-success-text {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.coin-overlay.active .coin-success-text {
    animation: fadeInUp 0.6s 2.1s ease forwards;
}

.coin-success-text h3 {
    font-size: 2rem;
    color: var(--white);
    margin-bottom: 0.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.coin-success-text p {
    font-size: 1.15rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Botón Continuar */
.coin-close-btn {
    background: var(--secondary);
    color: var(--white);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(14, 165, 233, 0.3);
    opacity: 0;
    transform: translateY(15px);
}

.coin-overlay.active .coin-close-btn {
    animation: fadeInUp 0.5s 2.5s ease forwards;
}

.coin-close-btn:hover {
    background: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 15px 35px rgba(14, 165, 233, 0.4);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive coin overlay */
@media (max-width: 768px) {
    .coin-container {
        width: 150px;
        height: 150px;
    }

    .coin-success-text h3 {
        font-size: 1.5rem;
    }

    .coin-success-text p {
        font-size: 1rem;
    }
}