/* ======================================
   INGELYV - Custom Styles
   Extends TailwindCSS CDN
   ====================================== */

/* ---- Base & Design Tokens ---- */
:root {
    --color-primary: #002D62;
    --color-primary-light: #1a4b8a;
    --color-accent-orange: #FF8C00;
    --color-accent-orange-hover: #e67e00;
    --color-background-light: #f5f5f8;
    --color-background-dark: #0f0f23;
    
    /* Modern shadow systems */
    --shadow-premium: 0 10px 30px -10px rgba(0, 45, 98, 0.15);
    --shadow-premium-hover: 0 20px 40px -15px rgba(0, 45, 98, 0.25);
    --shadow-glass: 0 8px 32px 0 rgba(0, 45, 98, 0.08);
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--color-background-light);
}

/* ---- Premium Utility Classes ---- */
.premium-gradient-bg {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-light) 100%);
}

.premium-gradient-text {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent-orange) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: var(--shadow-glass);
}

.glass-card-dark {
    background: rgba(15, 15, 35, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.hover-lift {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-premium-hover);
}

/* ---- Split-Screen Hero (Home) ---- */
.split-screen-container {
    height: calc(100vh - 96px);
    min-height: 600px;
}

.split-panel {
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.split-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 45, 98, 0.6);
    z-index: 10;
    transition: background 0.5s ease;
}

@media (min-width: 1024px) {
    .split-screen-container:hover .split-panel {
        width: 45%;
    }

    .split-screen-container .split-panel:hover {
        width: 55%;
    }

    .split-screen-container .split-panel:hover::before {
        background: rgba(0, 45, 98, 0.3);
    }
}

/* ---- Service Card Hover (Services Page) ---- */
.service-card:hover .service-icon-bg {
    background-color: #FF6B00;
    color: white;
}

.service-card:hover {
    border-color: #000061;
    transform: translateY(-4px);
}

/* ---- Blueprint Pattern (Contact Page) ---- */
.blueprint-pattern {
    background-size: 40px 40px;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
}

/* ---- Dark Theme Scrollbar ---- */
.dark-page::-webkit-scrollbar {
    width: 8px;
}

.dark-page::-webkit-scrollbar-track {
    background: #0f172a;
}

.dark-page::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

.dark-page::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* ---- Scroll Reveal Animation ---- */
.reveal {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Mobile Menu ---- */
.mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease-out;
    opacity: 0;
}

.mobile-menu.open {
    max-height: 400px;
    opacity: 1;
}

/* ---- Active Nav Link ---- */
.nav-link-active {
    color: #f2690d !important;
    font-weight: 700 !important;
}

.dark-page .nav-link-active {
    color: white !important;
}

/* ---- Headings font override ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Space Grotesk', sans-serif;
}

/* ---- Grid pattern overlay ---- */
.grid-pattern {
    background-image: linear-gradient(#002D62 1px, transparent 1px), linear-gradient(90deg, #002D62 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ---- Form focus states (Contact) ---- */
.form-input:focus {
    outline: none;
    border-color: #f2690d;
    box-shadow: 0 0 0 2px rgba(242, 105, 13, 0.2);
}

/* ---- Smooth page transitions ---- */
.page-fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================
   MOBILE RESPONSIVE FIXES
   ========================================== */

/* ---- Small screens (max-width: 767px) ---- */
@media (max-width: 767px) {

    /* -- Header: reduce height on mobile -- */
    header .max-w-\[1440px\] {
        height: 64px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    header .max-w-\[1440px\] img {
        height: 44px !important;
    }

    /* -- Split-Screen Hero (Home): auto height for stacked panels -- */
    .split-screen-container {
        height: auto !important;
        min-height: unset !important;
    }

    .split-panel {
        height: auto !important;
        min-height: 420px;
        padding-top: 48px;
        padding-bottom: 48px;
    }

    /* -- Hero headings: scale down for mobile -- */
    .split-panel h2 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }

    .split-panel p {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 24px !important;
    }

    /* -- Hero CTA buttons: full width on mobile -- */
    .split-panel a[class*="h-12"] {
        width: 100% !important;
        max-width: 300px;
        height: 48px !important;
        font-size: 0.75rem !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
        justify-content: center !important;
    }

    /* -- General heading sizes on mobile -- */
    h1 {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
    }

    h2 {
        font-size: 1.5rem !important;
        line-height: 1.25 !important;
    }

    h3 {
        font-size: 1.15rem !important;
        line-height: 1.3 !important;
    }

    /* -- Section padding: reduce on mobile -- */
    section[class*="py-20"] {
        padding-top: 48px !important;
        padding-bottom: 48px !important;
    }

    section[class*="py-24"] {
        padding-top: 56px !important;
        padding-bottom: 56px !important;
    }

    section[class*="py-16"] {
        padding-top: 40px !important;
        padding-bottom: 40px !important;
    }

    section[class*="px-6"] {
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    /* -- Ecosistema section: tighter on mobile -- */
    .reveal.max-w-5xl img {
        border-radius: 4px;
    }

    /* -- Nosotros: Timeline adjustments -- */
    .space-y-12 > div {
        gap: 16px !important;
    }

    /* Timeline cards: full width and proper padding */
    .space-y-12 > div > div[class*="md:w-1/2"] {
        width: 100% !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        text-align: left !important;
    }

    .space-y-12 > div > div[class*="md:w-1/2"] > div[class*="bg-white"] {
        padding: 20px !important;
    }

    /* Hide timeline center line on mobile */
    .space-y-12 > div > div[class*="hidden md:flex"][class*="rounded-full"] {
        display: none !important;
    }

    /* -- Nosotros: Mission/Vision cards -- */
    div[class*="from-primary"][class*="p-10"],
    div[class*="from-accent-orange"][class*="p-10"] {
        padding: 24px !important;
    }

    /* -- Nosotros: Values grid -- */
    div[class*="lg:grid-cols-4"] > div[class*="p-8"] {
        padding: 20px !important;
    }

    /* -- Nosotros: Team cards -- */
    div[class*="md:grid-cols-2"][class*="gap-10"] {
        gap: 24px !important;
    }

    div[class*="md:grid-cols-2"][class*="gap-10"] > div .relative.h-80 {
        height: 240px !important;
    }

    /* -- Nosotros: Industrial banner -- */
    section[class*="h-64"] {
        height: 200px !important;
    }

    section[class*="h-64"] h2 {
        font-size: 1.25rem !important;
    }

    section[class*="h-64"] p {
        font-size: 0.8rem !important;
        margin-top: 8px !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
    }

    section[class*="h-64"] .material-symbols-outlined {
        font-size: 36px !important;
        margin-bottom: 8px !important;
    }

    /* -- Nosotros: CTA strip -- */
    section[class*="bg-primary"][class*="py-16"] .flex {
        text-align: center;
    }

    section[class*="bg-primary"][class*="py-16"] h2 {
        font-size: 1.35rem !important;
    }

    section[class*="bg-primary"][class*="py-16"] a[class*="shrink-0"] {
        width: 100% !important;
        justify-content: center !important;
    }

    /* -- Servicios: Hero banner text -- */
    section[class*="bg-primary"][class*="py-16"] h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    section[class*="bg-primary"][class*="py-16"] p {
        font-size: 0.9rem !important;
    }

    /* -- Servicios: Service cards grid -- */
    .service-card .p-6 h3 {
        font-size: 0.85rem !important;
    }

    /* -- Contacto: Form and info section -- */
    .dark-page section[class*="py-16"] h1 {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    .dark-page section[class*="py-16"] p[class*="text-lg"] {
        font-size: 0.95rem !important;
    }

    /* Contact cards grid */
    .dark-page div[class*="sm:grid-cols-2"][class*="gap-4"] {
        gap: 12px !important;
    }

    .dark-page div[class*="sm:grid-cols-2"][class*="gap-4"] > div {
        padding: 16px !important;
    }

    /* Contact form container */
    .dark-page div[class*="p-8"][class*="md:p-10"] {
        padding: 20px !important;
    }

    /* Map section */
    section[class*="h-80"] {
        height: 250px !important;
    }

    section[class*="h-80"] div[class*="absolute"][class*="top-4"] {
        max-width: 200px !important;
        padding: 10px !important;
    }

    section[class*="h-80"] div[class*="absolute"][class*="bottom-4"] {
        max-width: 200px !important;
        padding: 10px !important;
        font-size: 0.7rem !important;
    }

    /* -- Footer: reduce padding and gaps -- */
    footer {
        padding-top: 40px !important;
        padding-bottom: 24px !important;
    }

    footer .flex.flex-col.md\:flex-row {
        gap: 24px !important;
        margin-bottom: 24px !important;
    }

    footer .grid {
        gap: 24px !important;
    }

    footer h3 {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }

    footer ul {
        gap: 8px !important;
    }

    footer img {
        height: 40px !important;
    }

    /* -- WhatsApp floating button: slightly smaller on mobile -- */
    a[class*="fixed"][class*="bottom-6"][class*="right-6"] {
        width: 52px !important;
        height: 52px !important;
        bottom: 16px !important;
        right: 16px !important;
    }

    a[class*="fixed"][class*="bottom-6"][class*="right-6"] svg {
        width: 28px !important;
        height: 28px !important;
    }
}

/* ---- Medium screens (tablets, 768px - 1023px) ---- */
@media (min-width: 768px) and (max-width: 1023px) {

    .split-screen-container {
        height: auto !important;
        min-height: unset !important;
    }

    .split-panel {
        height: auto !important;
        min-height: 350px;
        padding-top: 48px;
        padding-bottom: 48px;
    }

    .split-panel h2 {
        font-size: 2.25rem !important;
    }

    h1 {
        font-size: 2.25rem !important;
    }

    section[class*="h-64"] {
        height: 220px !important;
    }
}