:root {
    /* FletesCun UI Tokens */
    --fc-primary: #2563EB;
    --fc-primary-dark: #1B3A6B;
    --fc-primary-light: #60A5FA;
    --fc-bg-main: #ffffff;
    --fc-bg-alt: #F8FAFC;
    --fc-bg-icon: #EFF6FF;
    --fc-border: #E2E8F0;
    --fc-border-light: #F1F5F9;
    
    --fc-text-strong: #0F172A;
    --fc-text-main: #334155;
    --fc-text-muted: #64748B;
    --fc-text-light: #94A3B8;
    
    --fc-accent-warning: #F59E0B;
    --fc-accent-success: #10B981;
    
    /* Sombras modernas */
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 24px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.4);
}

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

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--fc-text-main);
    background-color: var(--fc-bg-alt);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
    color: var(--fc-text-strong);
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    position: relative;
    display: block;
    padding-bottom: 20px;
    text-align: center;
    width: 100%;
    margin-bottom: 1.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--fc-primary-light), var(--fc-primary));
    border-radius: 2px;
    margin: 0 auto;
}

/* Animaciones */
@keyframes engineIdle {
    0% { transform: translateY(0) rotate(0deg); }
    100% { transform: translateY(-1px) rotate(0.5deg); }
}

@keyframes heavyTruckDrive {
    0% { transform: translateX(0) rotate(0deg) translateY(0); }
    15% { transform: translateX(-2px) rotate(-4deg) translateY(3px); filter: drop-shadow(0 2px 4px rgba(37, 99, 235, 0.4)); }
    40% { transform: translateX(40px) rotate(5deg) translateY(-5px); filter: drop-shadow(-15px 5px 8px rgba(37, 99, 235, 0.3)); }
    70% { transform: translateX(10px) rotate(-3deg) translateY(2px); }
    85% { transform: translateX(-3px) rotate(1deg) translateY(-1px); }
    100% { transform: translateX(0) rotate(0deg) translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.6);
    box-shadow: var(--shadow-sm);
    padding: 0.8rem 0;
    transition: all 0.3s ease;
}

.navbar-brand img {
    height: 130px; 
    width: auto;
    transform-origin: bottom center; 
    transition: filter 0.3s ease;
}

.navbar-brand img:hover {
    animation: engineIdle 0.08s infinite alternate;
    filter: drop-shadow(0 0 12px rgba(37, 99, 235, 0.5));
}

.navbar-brand:active img {
    animation: heavyTruckDrive 0.8s ease-in-out; 
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--fc-text-muted) !important;
    padding: 8px 16px !important;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--fc-primary) !important;
    background-color: var(--fc-bg-icon);
}

/* Hero Section */
.hero-section {
    padding: 80px 0 100px;
    background: linear-gradient(135deg, var(--fc-primary-dark) 0%, var(--fc-primary) 50%, #1E40AF 100%);
    position: relative;
    overflow: hidden;
    clip-path: polygon(0 0, 100% 0, 100% 95%, 0 100%);
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(96,165,250,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-decor-1 {
    position: absolute;
    top: -10%;
    right: -5%;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

/* Botones */
.btn-gradient {
    background: linear-gradient(135deg, var(--fc-primary), #1e40af);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3), inset 0 1px 2px rgba(255,255,255,0.2);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.45);
    color: #ffffff;
}

/* Badges */
.badge-blue { 
    background: linear-gradient(135deg, var(--fc-bg-icon), #e0e7ff);
    color: var(--fc-primary); 
    display: inline-flex; 
    align-items: center;
    gap: 8px;
    padding: 10px 18px; 
    border-radius: 30px; 
    font-size: 0.85rem; 
    font-weight: 700; 
    border: 2px solid rgba(37, 99, 235, 0.2);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem !important;
}

.badge-blue::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.6s ease;
}

.badge-blue:hover::before {
    left: 100%;
}

/* Tarjetas de Servicios */
.ui-card {
    background: #ffffff;
    border: 1px solid var(--fc-border);
    border-radius: 20px;
    padding: 24px 18px;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-sm);
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-top: 3px solid transparent;
}

.ui-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--fc-primary-light), var(--fc-primary), #1e40af);
    border-radius: 20px 20px 0 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ui-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.15);
    border-color: var(--fc-primary-light);
    z-index: 2;
}

.ui-card:hover::before {
    opacity: 1;
}

.icon-box {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--fc-bg-icon), #ffffff);
    border: 2px solid rgba(37, 99, 235, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--fc-primary);
    font-size: 1.4rem;
    margin-bottom: 15px;
    transition: all 0.4s ease;
    box-shadow: inset 0 2px 8px rgba(37, 99, 235, 0.1), 0 4px 12px rgba(37, 99, 235, 0.08);
    position: relative;
}

.icon-box::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.4), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.ui-card:hover .icon-box {
    background: linear-gradient(135deg, var(--fc-primary), var(--fc-primary-dark));
    color: #ffffff;
    transform: scale(1.15) rotate(5deg);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    border-color: var(--fc-primary-light);
}

.ui-card:hover .icon-box::after {
    opacity: 1;
}

.ui-card h3 { font-size: 1rem; margin-bottom: 10px; }
.ui-card p { font-size: 0.9rem; color: var(--fc-text-muted); line-height: 1.5; }

/* Galería de Imágenes */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.gallery-img-wrapper {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-md);
    background-color: var(--fc-border-light);
    border: 2px solid rgba(37, 99, 235, 0.1);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
}

.gallery-img-wrapper:hover {
    border-color: var(--fc-primary);
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.2);
    transform: translateY(-4px);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gallery-img-wrapper::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-img-wrapper:hover .gallery-img {
    transform: scale(1.12);
}

.gallery-img-wrapper:hover::after {
    opacity: 1;
}

/* Testimoniales */
.testimonial-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border: 2px solid rgba(37, 99, 235, 0.12);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.06);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 320px;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--fc-primary-light), var(--fc-primary), #1e40af, var(--fc-accent-warning));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(37, 99, 235, 0.15);
    border-color: var(--fc-primary-light);
}

.testimonial-card:hover::before {
    opacity: 1;
}

.quote-bg {
    position: absolute;
    top: -10px;
    right: 15px;
    font-size: 6rem;
    color: var(--fc-bg-alt);
    z-index: 0;
    font-family: serif;
    line-height: 1;
}

.testimonial-content {
    position: relative;
    z-index: 1;
    flex-grow: 1;
    font-size: 0.95rem;
    color: var(--fc-text-main);
    font-style: italic;
    margin-bottom: 20px;
}

.testimonial-stars {
    color: var(--fc-accent-warning);
    font-size: 0.9rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 1px solid var(--fc-border-light);
    padding-top: 20px;
    position: relative;
    z-index: 1;
}

.author-avatar-text {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--fc-primary-light), var(--fc-primary));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid var(--fc-bg-icon);
}

.author-info h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--fc-text-strong);
}

.author-info span {
    font-size: 0.8rem;
    color: var(--fc-text-light);
    display: block;
}

/* Ubicación */
.location-info-box {
    background: linear-gradient(135deg, #ffffff 0%, #f8fbff 100%);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.06);
    height: 100%;
    border: 2px solid rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
}

.location-info-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(37, 99, 235, 0.05), transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.map-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    height: 100%;
    min-height: 400px;
}

/* Footer */
footer {
    background: linear-gradient(180deg, #0F172A 0%, #020617 50%, #000000 100%);
    color: var(--fc-text-light);
    padding: 50px 0 20px;
    position: relative;
    border-top: 4px solid var(--fc-primary);
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.5), transparent);
    pointer-events: none;
}

.footer-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.footer-logo-container img {
    max-width: 220px;
    filter: brightness(0) invert(1) drop-shadow(0 0 15px rgba(255,255,255,0.2));
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.footer-logo-container img:hover {
    transform: scale(1.05);
}

footer h5 {
    color: #ffffff;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.footer-link {
    color: var(--fc-text-light);
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 15px;
    display: inline-block;
}

.footer-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--fc-primary);
    opacity: 0.5;
    transition: all 0.3s ease;
    box-shadow: 0 0 8px rgba(37, 99, 235, 0);
}

.footer-link:hover {
    color: #ffffff;
    padding-left: 22px;
    text-shadow: 0 0 8px rgba(37, 99, 235, 0.2);
}

.footer-link:hover::before {
    opacity: 1;
    background-color: var(--fc-accent-warning);
    box-shadow: 0 0 12px var(--fc-accent-warning);
    transform: translateY(-50%) scale(1.2);
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 1rem;
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.02);
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.contact-item:hover {
    background: rgba(255,255,255,0.06);
    border-left-color: var(--fc-primary);
    padding-left: 16px;
}

/* Testimonios carrusel */
.testimonials-carousel {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 10px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.testimonials-carousel::-webkit-scrollbar {
    height: 6px;
}

.testimonials-carousel::-webkit-scrollbar-track {
    background: var(--fc-bg-alt);
    border-radius: 10px;
}

.testimonials-carousel::-webkit-scrollbar-thumb {
    background: var(--fc-primary);
    border-radius: 10px;
}

.testimonial-card {
    flex: 0 0 100%;
    scroll-snap-align: start;
}

@media (min-width: 577px) {
    .testimonial-card {
        flex: 0 0 calc(50% - 10px);
    }
}

@media (min-width: 992px) {
    .testimonial-card {
        flex: 0 0 calc(33.333% - 14px);
    }
}

/* Footer Acordeón */
.footer-section-toggle {
    display: none;
    cursor: pointer;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
}

.footer-section-toggle:hover {
    color: var(--fc-primary-light);
}

.footer-section-toggle i {
    transition: transform 0.3s ease;
}

.footer-section-toggle.active i {
    transform: rotate(180deg);
}

.footer-section-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.footer-section-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* Responsividad */
@media (max-width: 576px) {
    .navbar-brand img {
        height: 70px;
    }
    .navbar {
        padding: 0.6rem 0;
    }
    .nav-link {
        font-size: 0.85rem;
        padding: 6px 12px !important;
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .gallery-img-wrapper {
        aspect-ratio: 1/1;
    }
}

@media (min-width: 577px) and (max-width: 991px) {
    .navbar-brand img {
        height: 90px;
    }
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 992px) {
    .navbar-brand img {
        height: 120px;
    }
    .container {
        max-width: 1300px;
    }
    section {
        padding-top: 50px !important;
        padding-bottom: 50px !important;
    }
    section .text-center {
        margin-bottom: 3rem;
    }
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 200px;
    }
    .gallery-img-wrapper {
        aspect-ratio: auto;
    }
    footer {
        padding: 70px 0 30px;
    }
}

@media (max-width: 768px) {
    .footer-section-toggle {
        display: flex;
    }
    section .text-center {
        margin-bottom: 2rem;
    }
    .footer-section-content {
        margin-bottom: 15px;
    }
    footer {
        padding: 30px 0 15px;
    }
    .footer-logo-container {
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    .footer-logo-container img {
        max-width: 120px;
    }
    .footer-logo-container p {
        font-size: 0.9rem !important;
        margin-top: 0.5rem !important;
    }
    footer h5 {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    .contact-item {
        margin-bottom: 0.75rem;
        padding: 8px;
    }
}

/* Touch Optimization */
@media (hover: none) and (pointer: coarse) {
    .ui-card, .testimonial-card, .gallery-img-wrapper {
        transform: none;
    }
    .ui-card:active, .testimonial-card:active, .gallery-img-wrapper:active {
        transform: scale(0.98);
    }
}

/* Utilidades */
.z-1 {
    position: relative;
    z-index: 1;
}

/* Motion and responsive refinements */
html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 92px;
}

.hero-section .badge-blue,
.hero-section h1,
.hero-section p,
.hero-section .btn-gradient,
.hero-section img {
    animation: heroReveal 0.8s both;
}

.hero-section h1 { animation-delay: 0.08s; }
.hero-section p { animation-delay: 0.16s; }
.hero-section .btn-gradient { animation-delay: 0.24s; }
.hero-section img { animation-delay: 0.18s; }

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

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

@keyframes heroReveal {
    from { opacity: 0; transform: translateY(22px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 991.98px) {
    .navbar-collapse {
        margin-top: 0.75rem;
        padding: 0.5rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--fc-border);
        border-radius: 14px;
        box-shadow: var(--shadow-md);
    }

    .navbar-nav {
        align-items: stretch !important;
    }

    .nav-link {
        display: block;
        padding: 10px 12px !important;
    }

    .hero-section {
        padding: 64px 0 84px;
        clip-path: polygon(0 0, 100% 0, 100% 98%, 0 100%);
    }

    .hero-section .row {
        row-gap: 1.5rem;
    }

    .hero-section h1 {
        font-size: clamp(2.1rem, 6vw, 3.3rem);
    }

    .location-info-box {
        padding: 28px;
    }
}

@media (max-width: 576px) {
    .navbar-brand img {
        height: 58px;
        max-width: 180px;
    }

    .navbar-toggler {
        padding: 0.35rem 0.5rem;
    }

    .hero-section {
        padding: 48px 0 64px;
    }

    .hero-section .container,
    section .container {
        padding-left: 18px;
        padding-right: 18px;
    }

    .hero-section h1 {
        font-size: clamp(2rem, 10vw, 2.7rem);
        line-height: 1.12;
    }

    .hero-section p {
        font-size: 1rem !important;
        line-height: 1.55;
    }

    .hero-section .btn-gradient {
        width: 100%;
        justify-content: center;
    }

    #servicios .row > .col-6 {
        width: 100%;
    }

    #servicios .ui-card {
        padding: 22px;
    }

    .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .gallery-img-wrapper {
        border-radius: 11px;
        border-width: 1px;
    }

    .testimonial-card {
        min-height: 285px;
        padding: 22px;
        border-radius: 16px;
    }

    .testimonials-carousel {
        margin-left: -2px;
        margin-right: -2px;
        gap: 12px;
    }

    .location-info-box {
        padding: 22px;
        border-radius: 16px;
    }

    .map-container {
        min-height: 300px;
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.bg-alt {
    background-color: var(--fc-bg-alt) !important;
}

.text-light {
    color: var(--fc-text-light) !important;
}

.opacity-75 {
    opacity: 0.75;
}