:root {
    --primary: #4B6CB7; /* Professional blue-violet */
    --primary-2: #6C63FF;
    --accent: #00BFA6; /* fresh green accent */
    --primary-dark: #3f5390;
    --primary-light: #eef1ff;
    --secondary-bg: #fbfcfe;
    --text-dark: #1f2933;
    --text-body: #5b6770;
    --border-color: #e6eef6;
    --white: #ffffff;
    --gradient-btn: linear-gradient(90deg, var(--primary) 0%, var(--primary-2) 100%);
    --gradient-banner: linear-gradient(90deg, rgba(75,108,183,0.95) 0%, rgba(108,99,255,0.9) 100%);
    --shadow-card: 0 12px 40px rgba(22,36,60,0.06);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    color: var(--text-body);
    background-color: var(--white);
    line-height: 1.6;
}

/* Smooth scrolling for in-page navigation */
html { scroll-behavior: smooth; }

h1, h2, h3, h4 {
    color: var(--text-dark);
    font-weight: 700;
}

a { text-decoration: none; }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.breadcrumb { padding: 18px 0; font-size: 14px; color: var(--text-body); }
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb strong { color: var(--text-dark); }

.text-purple { color: var(--primary); }
.text-purple-light { color: #d0cfff; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-primary {
    background: var(--gradient-btn);
    color: var(--white);
    box-shadow: 0 6px 20px rgba(75,108,183,0.18);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(108, 99, 255, 0.4); }

.btn-white {
    background: var(--white);
    color: var(--primary);
    font-weight: 600;
}

/* Header (default: flow in document). Use .header.scrolled to fix on scroll. */
.header {
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: transparent;
    z-index: 1000;
    box-shadow: none;
    transition: all 0.3s ease;
}

/* When header is transparent the nav text and hamburger should be light for contrast */
.header .logo { color: var(--white); }
.header .nav-links a { color: var(--white); }
.header .nav-links a:hover, .header .nav-links a.active { background: rgba(255,255,255,0.06); color: var(--white); }
.header .hamburger span { background: var(--white); }

/* Ensure the header dropdown toggle is white on transparent header and gets a dark translucent bg on hover/open */
.header .header-dropdown .dropdown-toggle { color: var(--white); }
.header .header-dropdown .dropdown-toggle:hover,
.header .header-dropdown .dropdown-toggle[aria-expanded="true"] {
    background: rgba(0,0,0,0.15);
    color: var(--white);
}
/* Header: use consistent dark text and opacity across all pages */
.header .logo { color: var(--text-dark); }
.header .nav-links a { color: var(--text-dark); }
.header .nav-links a:hover, .header .nav-links a.active { background: rgba(0,0,0,0.06); color: var(--text-dark); }
.header .hamburger span { background: var(--text-dark); }
.header .header-dropdown .dropdown-toggle { color: var(--text-dark); }
.header .header-dropdown .dropdown-toggle:hover,
.header .header-dropdown .dropdown-toggle[aria-expanded="true"] {
    background: rgba(0,0,0,0.06);
    color: var(--text-dark);
}

/* Index exception: when header has .header-white (used on index) and is NOT scrolled, keep text white for contrast over hero */
.header.header-white:not(.scrolled) .logo { color: var(--white); }
.header.header-white:not(.scrolled) .nav-links a { color: var(--white); }
.header.header-white:not(.scrolled) .nav-links a:hover,
.header.header-white:not(.scrolled) .nav-links a.active { background: rgba(255,255,255,0.06); color: var(--white); }
.header.header-white:not(.scrolled) .hamburger span { background: var(--white); }
.header.header-white:not(.scrolled) .header-dropdown .dropdown-toggle { color: var(--white); }
.header.header-white:not(.scrolled) .header-dropdown .dropdown-toggle:hover,
.header.header-white:not(.scrolled) .header-dropdown .dropdown-toggle[aria-expanded="true"] {
    background: rgba(255,255,255,0.06);
    color: var(--white);
}
/* Ensure dropdown menu items stay black (readable) even when header is transparent on index */
.header.header-white:not(.scrolled) .header-dropdown .dropdown-menu a {
    color: var(--text-dark);
}

/* When header becomes scrolled (white bg), dropdown toggle should be dark like other nav items */
.header.scrolled .header-dropdown .dropdown-toggle {
    color: var(--text-dark);
    background: transparent;
}
.header.scrolled .header-dropdown .dropdown-toggle:hover,
.header.scrolled .header-dropdown .dropdown-toggle[aria-expanded="true"] {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* If you want a subtle backdrop when the menu opens, keep existing body.menu-open::after rules */

/* Header style when the page is scrolled: solid background for readability */
.header.scrolled {
    /* kept for compatibility if JS toggles this class */
    background: rgba(255,255,255,0.96);
}
.header.scrolled .logo { color: var(--text-dark); }
.header.scrolled .nav-links a { color: var(--text-dark); }
.header.scrolled .hamburger span { background: var(--text-dark); }

/* When the header becomes fixed on scroll, add top padding to the following main
   so the first section doesn't slide under the header. Also set a global
   scroll-padding for in-page anchor links. Adjust the value if your header
   height changes. */
.header + main,
.header + section {
    padding-top: 72px; /* fallback for pages that don't use <main> */
}

html { scroll-padding-top: 72px; }

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .container { position: relative; }

.logo {
    font-weight: 800;
    font-size: 20px;
    color: var(--primary-2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 600;
    font-size: 15px;
    padding: 8px 10px;
    border-radius: 8px;
}

.nav-links .chevron-icon { margin-left: 6px; font-size: 0.85em; vertical-align: middle; color: var(--text-dark); }

/* Header dropdown (compact) */
.header-dropdown { position: relative; display: inline-block; }
.header-dropdown .dropdown-toggle {
    background: transparent;
    border: 0;
    padding: 8px 10px;
    font-weight: 600;
    color: var(--text-dark);
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.header-dropdown .dropdown-toggle[aria-expanded="true"] { background: var(--primary-light); color: var(--primary-dark); }
.header-dropdown .dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 180px;
    background: var(--white);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 24px rgba(22,36,60,0.08);
    padding: 6px 0;
    display: none;
    z-index: 1200;
}
.header-dropdown .dropdown-menu[aria-hidden="false"] { display: block; }
.header-dropdown .dropdown-menu li { list-style: none; }
.header-dropdown .dropdown-menu a { display: block; padding: 8px 14px; color: var(--text-dark); font-weight: 600; }
.header-dropdown .dropdown-menu a:hover { background: var(--primary-light); color: var(--primary-dark); }

/* Keep service titles readable on small screens */
@media (max-width: 992px) {
    .service-text h3 { font-size: 28px; }
}

/* Ensure dropdown items match nav font size on mobile */
@media (max-width: 900px) {
    .header-dropdown .dropdown-menu a { font-size: 16px; }
}

@media (max-width: 900px) {
    .header-dropdown .dropdown-menu { left: auto; right: 0; min-width: 160px; }
}

/* When mobile nav is open, render header dropdown inline inside the panel */
@media (max-width: 900px) {
    .nav-links.nav-active .header-dropdown { width: 100%; }
    .nav-links.nav-active .header-dropdown .dropdown-toggle { width: 100%; text-align: left; padding-left: 12px; }
    /* Only show the dropdown when the header-dropdown has 'open' class (controlled by JS) */
    .nav-links.nav-active .header-dropdown .dropdown-menu {
        position: static;
        display: none;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 6px 0 12px 0;
    }
    .nav-links.nav-active .header-dropdown.open .dropdown-menu { display: block; }
    .nav-links.nav-active .header-dropdown .dropdown-menu a {
        display: block;
        padding: 12px 16px;
        margin: 6px 12px;
        background: var(--white);
        border-radius: 8px;
    }
}

.nav-links a:hover, .nav-links a.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-contact { display: none; }

.menu-toggle { display: none; }

/* Hamburger lines */
.menu-toggle { width: 48px; height: 48px; display: none; align-items: center; justify-content: center; cursor: pointer; }
.hamburger { display: inline-block; width: 26px; height: 18px; position: relative; }
.hamburger span { display: block; position: absolute; height: 2px; width: 100%; background: var(--text-dark); left: 0; transition: all 0.3s ease; border-radius: 2px; }
.hamburger span:nth-child(1) { top: 0; }
.hamburger span:nth-child(2) { top: 8px; }
.hamburger span:nth-child(3) { top: 16px; }
.menu-toggle.open .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.menu-toggle.open .hamburger span:nth-child(2) { opacity: 0; }
.menu-toggle.open .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* Hero */
.hero {
    background: transparent;
    height: 100vh;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
/* Background video and dark overlay */
.hero { position: relative; }
.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6); /* 60% black */
    z-index: 2;
}
.hero-content { position: relative; z-index: 3; }
.hero-image img {
  width: 100%;
  max-width: 450px;
  height: auto;
}

/* Background video and dark overlay */


/* Center all images and make them responsive */
img { display: block; margin: 0 auto; max-width: 100%; height: auto; }

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 50px;
}

.hero-text h1 {
    font-size: 44px;
    line-height: 1.2;
    margin-bottom: 20px;
    color: var(--white);
}

.hero-text p {
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 450px;
    color: var(--white);
}

/* Required asterisk styling and form error messages */
.required { color: #e02424; margin-left: 4px; }
.errmsg { color: #e02424; font-size: 13px; margin-top: 6px; }
/* Floating error popup */
.errmsg-popup {
    background: #e02424;
    color: var(--white);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 12px rgba(224, 36, 36, 0.3);
    white-space: nowrap;
    animation: slideDown 0.3s ease-out;
    pointer-events: none;
}

/* File upload areas: separate input from file list */
.file-upload {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.file-upload-input {
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    background: rgba(255,255,255,0.01);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.file-upload-input p {
    color: rgba(255,255,255,0.7);
    margin: 0;
    font-size: 14px;
}

.file-upload-input input[type="file"] {
    cursor: pointer;
}

.file-upload-input .file-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(224, 36, 36, 0.3);
    color: var(--white);
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.file-upload-input .file-remove:hover {
    background: rgba(224, 36, 36, 0.5);
    border-color: rgba(224, 36, 36, 0.6);
}

.file-upload-input .file-remove:focus {
    outline: 2px solid rgba(255,255,255,0.12);
}

/* File upload list and remove button (in upload-input area) */
.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item { display: flex; align-items: center; gap: 0; background: rgba(255,255,255,0.02); padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.08); }
.file-item .file-name { flex: 1; color: var(--white); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.file-upload.dragover { outline: 2px dashed rgba(255,255,255,0.18); }

.illustration-placeholder {
    width: 100%;
    height: 350px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Why Choose */
.section-header {
    text-align: center;
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 { font-size: 32px; margin-bottom: 15px; }

.features { padding: 60px 0; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: transform 0.3s;
    text-align: center;
    border: 1px solid #f0f0f0;
}

.feature-card:hover { transform: translateY(-5px); }

.icon-box {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
}

.icon-box.blue { background: rgba(79,107,192,0.12); color: #4f6bc0; }
.icon-box.green { background: rgba(79,107,192,0.12); color: #4f6bc0; }
.icon-box.orange { background: rgba(79,107,192,0.12); color: #4f6bc0; }
.icon-box.yellow { background: rgba(79,107,192,0.12); color: #4f6bc0; }
.icon-box.pink { background: rgba(79,107,192,0.12); color: #4f6bc0; }
.icon-box.cyan { background: rgba(79,107,192,0.12); color: #4f6bc0; }

.feature-card h3 { font-size: 18px; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: #777; }

/* Case study cards for Casos de éxito */
.cases-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; }
.case-card {
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 18px 40px rgba(22,36,60,0.04);
    overflow: hidden;
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 22px;
    border: 1px solid #f3f5f8;
}
.case-media img { width: 140px; height: 140px; aspect-ratio: 1 / 1; object-fit: contain; border-radius: 50%; background: transparent; display: block; flex-shrink: 0; }
.case-body { display: flex; flex-direction: column; gap: 8px; }
.case-body .business-name { font-size: 18px; color: var(--text-dark); margin: 0; font-weight: 700; }
.case-body .case-role { font-size: 13px; color: var(--primary); margin: 0; font-weight: 600; }
.case-body .case-desc { font-size: 14px; color: var(--text-body); margin-top: 6px; line-height: 1.6; }

@media (max-width: 768px) {
    .case-card { padding: 18px; align-items: center; }
    .case-media img { width: 120px; height: 120px; aspect-ratio: 1 / 1; }
    .case-body { text-align: left; }
}

/* Make case logos circular */
.case-media img { border-radius: 50%; }

/* Hover lift for cards */
.case-card { transition: transform 300ms cubic-bezier(.2,.9,.3,1), box-shadow 300ms ease; }
.case-card:hover { transform: translateY(-8px); box-shadow: 0 30px 60px rgba(22,36,60,0.10); }

/* CTA inside case card */
.btn-case { margin-top: 8px; align-self: flex-start; padding: 8px 14px; border-radius: 12px; font-size: 14px; }

/* Services */
.services { padding: 80px 0; }

.service-row {
    display: flex;
    align-items: center;
    gap: 60px;
    margin-bottom: 100px;
}

.service-row.reverse { flex-direction: row-reverse; }

.service-img { flex: 1; display: flex; justify-content: center; }
.service-text { flex: 1; }

.service-text h3 { font-size: 28px; margin-bottom: 25px; }

/* Benefits list styling */
.benefits-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    list-style: none;
    margin-top: 25px !important;
    margin-left: 0 !important;
}

.benefits-list li {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-body);
}

.benefits-list i {
    color: var(--accent);
    font-size: 18px;
    margin-top: 3px;
    flex-shrink: 0;
}

/* Features grid for visual layout */
.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

.feature-item {
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #fbfcfe 100%);
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.feature-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(75,108,183,0.1);
    border-color: var(--primary-light);
}

.feature-icon {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 15px;
}

.feature-item h4 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.feature-item p {
    font-size: 14px;
    color: var(--text-body);
    margin: 0;
}

.mockup {
    width: 100%;
    max-width: 450px;
    height: 300px;
    /* background: #f4f6f8;
    border: 1px solid #e0e0e0; */
    /* border-radius: 12px; */
    position: relative;
    /* box-shadow: 0 15px 40px rgba(0,0,0,0.06); */
    display: flex;
    
    justify-content: center;
}

.badge-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    background: white;
}
.badge-icon.purple { top: -20px; right: -20px; background: #6C63FF; color: white; }
.badge-icon.code { top: -20px; left: -20px; background: #6C63FF; color: white; }
.badge-icon.orange { top: -20px; right: -20px; background: #ff7043; color: white; }
.badge-icon.yellow { top: -20px; left: -20px; background: #ffca28; color: white; }
.badge-icon.pink { top: -20px; right: -20px; background: #ff4081; color: white; }
.badge-icon.blue { top: -20px; left: -20px; background: #405cf8; color: white; }

/* Form */
.contact-form-section { padding: 80px 0; background: #fcfcfd; }

.main-form {
    background: var(--white);
    max-width: 800px;
    margin: 0 auto;
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    border: 1px solid #eee;
}

.main-form h4 { margin-bottom: 25px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: #333; }

input, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: 0.3s;
}

input:focus, textarea:focus { outline: none; border-color: var(--primary); }

.tags-input { display: flex; flex-wrap: wrap; gap: 10px; }
.tag {
    padding: 8px 16px;
    background: #f0f0f0;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
}
.tag:hover, .tag.active { background: var(--primary); color: white; }

.file-upload {
    border: 2px dashed #ddd;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    color: #888;
    font-size: 13px;
}

.submit-btn { width: 100%; border: none; margin-top: 10px; }

/* FAQ */

/* (services dropdown styles removed per request) */
.faq { padding: 80px 0; }
.faq-list { max-width: 800px; margin: 0 auto; }
.faq-item {
    border: 1px solid #eee;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.faq-question {
    padding: 20px;
    background: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 18px;
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.36s ease, padding 0.3s ease;
    background: #fff;
}

.faq-item.active .faq-answer { padding: 20px; max-height: 600px; }
.faq-item.active .faq-question { color: var(--primary); }

/* Visual style for answer box when active (left accent) */
.faq-item.active .faq-answer { box-shadow: none; border-left: 4px solid var(--primary-2); background: #fbfdff; }
.faq-answer p { color: var(--text-body); line-height: 1.7; font-size: 15px; }

/* Chevron rotation */
.faq-question i { transition: transform 0.28s ease, color 0.28s ease; color: var(--primary-dark); }
.faq-item.active .faq-question i { color: var(--primary); transform: none; }

/* Make sure FAQ aligns well on small screens */
@media (max-width: 600px) {
    .faq-question { font-size: 16px; padding: 16px; }
    .faq-answer p { font-size: 15px; }
    .faq-list { padding: 0 6px; }
}

/* Bottom CTA */
.bottom-cta { padding: 60px 0; }
.cta-box {
    background: var(--gradient-banner);
    border-radius: 20px;
    padding: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    position: relative;
    overflow: hidden;
}

.cta-text h3 { color: white; font-size: 28px; }

/* Support CTA (Emergency) */
.support-cta { padding: 40px 0; }
.support-grid { display: flex; align-items: center; justify-content: space-between; }
.support-text { max-width: 760px; }
.support-text h2 { font-size: 22px; color: var(--text-dark); margin-bottom: 8px; }
.support-text p { color: var(--text-body); margin-bottom: 8px; }
.btn-round { border-radius: 999px; padding: 14px 26px; display: inline-flex; align-items: center; gap: 10px; box-shadow: 0 8px 30px rgba(75,108,183,0.12); }

@media (max-width: 768px) {
    .support-grid { flex-direction: column; text-align: center; gap: 18px; }
    .support-text h2 { font-size: 20px; }
    .support-text p { font-size: 15px; max-width: 420px; margin: 0 auto; }
    .btn-round { padding: 12px 22px; }
    
    /* Features grid responsive */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .feature-item {
        padding: 20px;
    }
    
    .feature-icon {
        font-size: 28px;
    }
}

/* Footer */
.footer { background: #f8f9fa; padding: 60px 0 20px; font-size: 14px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer h4 { margin-bottom: 20px; font-size: 16px; }
.footer ul li { margin-bottom: 10px; }
.footer ul li a { color: #5b6770; }
.footer ul li a:hover { color: var(--primary); }

.newsletter-form { display: flex; gap: 5px; margin-bottom: 20px; }
.newsletter-form input { padding: 8px; border-radius: 4px; }
.newsletter-form button {
    background: var(--primary); color: white; border: none;
    padding: 0 15px; border-radius: 4px; cursor: pointer;
}

.footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.2);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    color: rgba(0, 0, 0, 0.2);
}

/* Mobile navigation styles */
.nav-links {
    transition: transform 0.32s ease, opacity 0.32s ease;
}

/* Mobile overlay nav (hidden by default) */
@media (max-width: 900px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        left: auto;
        height: 100vh;
        width: 60%;
        max-width: 420px;
        background: rgba(255,255,255,0.98);
        box-shadow: -8px 0 30px rgba(15,23,42,0.06);
        padding: 80px 28px 20px 28px;
        display: flex;
        flex-direction: column;
        gap: 18px;
        transform: translateX(100%);
        opacity: 0;
        z-index: 999;
    }
    .nav-links.nav-active { transform: translateX(0); opacity: 1; display: flex; animation: navSlide 360ms cubic-bezier(.2,.9,.3,1); }
    .nav-links a { padding: 12px 10px; border-radius: 8px; }

    /* Make all nav items and dropdown toggles the same readable size on mobile */
    .nav-links a,
    .nav-links .dropdown-toggle,
    .nav-links .header-dropdown .dropdown-toggle {
        font-size: 16px;
        line-height: 1.3;
        color: var(--text-dark) !important;
    }

    /* Animated closing state: keep transitions consistent when removing nav-active */
    .nav-links.nav-closing {
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: transform 360ms cubic-bezier(.2,.9,.3,1), opacity 260ms ease;
    }

    .nav-close {
        position: absolute;
        top: 18px;
        right: 14px;
        background: transparent;
        border: none;
        font-size: 22px;
        color: var(--text-dark) !important;
        cursor: pointer;
        display: none;
        padding: 8px;
    }
    .nav-close { z-index: 1001; }
    .nav-close i { pointer-events: auto; }
    .nav-links .nav-close { display: block; }

    /* Menu item entrance: start slightly right and faded */
    .nav-links a { opacity: 0; transform: translateX(12px); transition: transform 320ms ease, opacity 320ms ease; }
    .nav-links.nav-active a { opacity: 1; transform: translateX(0); }

    /* Stagger children appearance for a polished feel */
    .nav-links.nav-active a:nth-child(1) { transition-delay: 0.06s; }
    .nav-links.nav-active a:nth-child(2) { transition-delay: 0.12s; }
    .nav-links.nav-active a:nth-child(3) { transition-delay: 0.18s; }
    .nav-links.nav-active a:nth-child(4) { transition-delay: 0.24s; }
    .nav-links.nav-active a:nth-child(5) { transition-delay: 0.30s; }
    .nav-links.nav-active a:nth-child(6) { transition-delay: 0.36s; }
}

/* Mobile-contact button shown only inside mobile nav */
.nav-links .mobile-contact { display: none; }

@media (max-width: 900px) {
    .nav-links .mobile-contact {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 14px 18px;
        background: #25D366; /* WhatsApp green */
        color: var(--white) !important;
        border-radius: 12px;
        margin: 8px auto 0;
        box-shadow: 0 10px 36px rgba(37,211,102,0.14);
        width: 94%;
    }
    .nav-links .mobile-contact i { font-size: 18px; }

    /* Remove the textual 'Contacto' item from mobile nav */
    .nav-links .nav-contact { display: none !important; }
}

/* Floating WhatsApp button */
.whatsapp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: #25D366;
    color: white;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 30px rgba(37,211,102,0.18);
    z-index: 1000;
    transition: transform 0.18s ease;
    animation: whatsapp-pulse 2s infinite;
}
.whatsapp-float:hover { transform: translateY(-4px); }
.whatsapp-float i { font-size: 22px; }

@keyframes whatsapp-pulse {
    0% { box-shadow: 0 0 0 0 rgba(37,211,102,0.35); }
    70% { box-shadow: 0 0 0 12px rgba(37,211,102,0); }
    100% { box-shadow: 0 0 0 0 rgba(37,211,102,0); }
}

/* Hide floating whatsapp when mobile menu overlay is open */
body.menu-open .whatsapp-float { display: none !important; }

/* When the mobile menu is open hide the external menu-toggle (right-side X) so
    only the internal close button remains visible */
body.menu-open .menu-toggle { display: none !important; }

/* Backdrop when menu is open for focus */
body.menu-open::after {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,0.12);
    z-index: 998;
    animation: fadeIn 320ms ease forwards;
}

/* Ensure active nav receives pointer events and the close button is above the backdrop */
.nav-links.nav-active { pointer-events: auto; }
.nav-close { z-index: 2000 !important; background: rgba(255,255,255,0.9); border-radius: 6px; }
.nav-close i { pointer-events: auto; }

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes navSlide {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Pop-in for mobile contact CTA inside menu */
.nav-links.nav-active .mobile-contact {
    transform: translateY(8px) scale(0.98);
    opacity: 0;
    animation: contactPop 420ms cubic-bezier(.2,.9,.3,1) 0.28s forwards;
}

@keyframes contactPop {
    0% { transform: translateY(8px) scale(0.98); opacity: 0; }
    60% { transform: translateY(-4px) scale(1.02); opacity: 1; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes slideDown {
    0% { transform: translateY(-10px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

@keyframes fadeInModal {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes scaleModal {
    0% { transform: scale(0.9); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Modal styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
    animation: fadeInModal 0.3s ease-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    padding: 0;
    animation: scaleModal 0.3s ease-out;
    overflow: hidden;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, #6964f8 0%, #6c63ff 100%);
}

.modal-header h2 {
    margin: 0;
    color: var(--white);
    font-size: 22px;
    font-weight: 600;
}

.modal-body {
    padding: 20px;
    color: var(--text-body);
    font-size: 15px;
    line-height: 1.6;
}

.modal-body p {
    margin: 0;
}

.modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    margin: 0;
}

.modal-close {
    padding: 10px 24px;
    font-size: 14px;
}

/* Dark mode for modal */
:root.dark-mode .modal-content {
    background: var(--card-bg);
}

:root.dark-mode .modal-header {
    background: linear-gradient(135deg, #6964f8 0%, #6c63ff 100%);
    border-bottom-color: var(--border-color);
}

:root.dark-mode .modal-body {
    color: var(--text-color);
}

:root.dark-mode .modal-body p {
    color: var(--text-color);
}

.menu-toggle.open { transform: rotate(0.001deg); }
.menu-toggle.open .hamburger { transition: transform 260ms ease; }

/* Responsive: better stacking and F/Z reading hierarchy */

@media (max-width: 900px) {
    .hero-content { grid-template-columns: 1fr; padding-top: 30px; }
    .hero-text h1 { font-size: 32px; }
    .service-row { flex-direction: column; gap: 20px; margin-bottom: 50px; }
    .service-row.reverse { flex-direction: column; }
    .menu-toggle { display: flex; }
    /* keep .nav-links as fixed overlay (defined earlier) */
    .nav-contact { display: inline-block; }
}

@media (max-width: 480px) {
    .container { padding: 0 14px; }
    .hero-text p { font-size: 15px; }
    .hero-text h1 { font-size: 26px; }
    .features-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }

    /* Make mobile nav wider on small phones for easier tapping */
    .nav-links { width: 92%; }
}

/* Small screen typography/layout tweaks */
@media (max-width: 480px) {
    .hero { padding: 40px 0; }
    .hero-text h1 { font-size: 28px; }
    .illustration-placeholder { height: auto; padding: 20px 0; }
    .hero-text p { max-width: 100%; }
    .service-row { margin-bottom: 40px; gap: 20px; }
    .feature-card { padding: 20px; }
    .main-form { padding: 20px; }
}

/* Responsive */
@media (max-width: 992px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; }
    .hero-text p { margin: 0 auto 30px; }
    .service-row, .service-row.reverse { flex-direction: column; text-align: center; gap: 30px; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .cta-box { flex-direction: column; text-align: center; gap: 20px; }
}

@media (max-width: 768px) {
    .nav-links, .header .btn { display: none; }
    .menu-toggle { display: block; font-size: 24px; cursor: pointer; }
    .form-row { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
}

/* Reduce vertical spacing between sections on small screens */
@media (max-width: 768px) {
    .services { padding: 40px 0; }
    .service-row { margin-bottom: 30px; gap: 18px; }
    .contact-form-section { padding: 20px 0; }
    .section-header { margin-bottom: 18px; }
}

@media (max-width: 480px) {
    .services { padding: 30px 0; }
    .service-row { margin-bottom: 20px; }
    .contact-form-section { padding: 12px 0; }
    .section-header { margin-bottom: 14px; }
}

/* Ensure the internal nav close button is hidden on desktop and only shown on mobile */
@media (min-width: 901px) {
    .nav-close { display: none !important; }
}

/* Scroll reveal animations */
.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 640ms cubic-bezier(.2,.9,.3,1), transform 640ms cubic-bezier(.2,.9,.3,1);
    will-change: opacity, transform;
}
.reveal.in-view {
    opacity: 1;
    transform: translateY(0);
}

/* Slightly different motion for hero image (slide from right) */
.hero-image.reveal { transform: translateX(26px); }
.hero-image.reveal.in-view { transform: translateX(0); }

/* Stagger feature cards (uses inline transition-delay set by JS) */
.feature-card.reveal { transform: translateY(28px); }
.feature-card.reveal.in-view { transform: translateY(0); }

/* Make reveal quieter on small screens */
@media (max-width: 480px) {
    .reveal { transform: translateY(10px); }
    .hero-image.reveal { transform: translateX(12px); }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    visibility: visible;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(75, 108, 183, 0.2);
    border-top: 4px solid var(--primary);
    border-right: 4px solid var(--primary-2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    font-size: 16px;
    color: var(--primary);
    font-weight: 500;
    letter-spacing: 1px;
}

.loader-dots {
    display: inline-block;
    width: 20px;
}

.loader-dots::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}