/* Variables and Reset */
:root {
    --primary-color: #2563eb;
    /* Vibrant Royal Blue */
    --primary-dark: #1e40af;
    --secondary-color: #eff6ff;
    /* Blue 50 */
    --accent-color: #f59e0b;
    /* Amber for highlights */
    --text-main: #1e293b;
    --text-light: #475569;
    --bg-white: #ffffff;
    --bg-offwhite: #f8fafc;
    --white: #ffffff;
    --black: #0f172a;
    --shadow-sm: 0 1px 3px rgba(37, 99, 235, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(37, 99, 235, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(37, 99, 235, 0.1), 0 4px 6px -2px rgba(37, 99, 235, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 1rem;
    --transition: all 0.3s ease;
    --container-width: 1200px;
    --font-heading: 'Clash Display', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    line-height: 1.6;
    background-color: var(--bg-white);
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    color: var(--black);
    font-weight: 600;
}

h1 {
    font-size: 3rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.text-link {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.text-link:hover {
    gap: 0.75rem;
    color: var(--primary-dark);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--text-main);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: var(--black);
}

.btn-outline {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.btn-outline-white {
    border-color: var(--white);
    color: var(--white);
}

.btn-outline-white:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

.full-width {
    width: 100%;
}

/* Header */
.header {
    background-color: #142850;
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 15px 15px -5px rgba(0, 0, 0, 0.8);
    height: 80px;
    display: flex;
    align-items: center;
}

.header .logo img {
    filter: brightness(0) invert(1);
    -webkit-filter: brightness(0) invert(1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    /* Reduce left/right padding for mobile space */
}

.logo {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: -1px;
}

.logo-sub {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-center {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-weight: 600;
    color: var(--white);
    position: relative;
    padding: 0.5rem 0;
    letter-spacing: -0.01em;
}

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

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

.nav-link:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    color: var(--white);
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Search Styles - Dropdown Box */
.search-btn {
    background: none;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.search-overlay {
    position: absolute;
    top: 100%;
    right: 1rem;
    width: 350px;
    background: var(--white);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    z-index: 900;
}

.search-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-container {
    position: relative;
    width: 100%;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

#site-search {
    width: 100%;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    background: var(--bg-offwhite);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    color: var(--text-main);
    outline: none;
}

#site-search:focus {
    border-color: var(--primary-color);
    background: var(--white);
}

#site-search::placeholder {
    color: var(--text-light);
}

.close-search {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.25rem;
    display: none;
    /* Hide default X, can rely on clicking outside or toggle */
}

/* Only show close button on mobile if needed, or remove completely if using toggle behavior */

.search-results {
    width: 100%;
    margin-top: 1rem;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.5rem;
    display: none;
    /* Hide when empty */
}

.search-results:not(:empty) {
    display: block;
}

.search-result-item {
    background: transparent;
    padding: 0.75rem;
    border-bottom: 1px solid #f1f5f9;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-offwhite);
}

.search-result-item a {
    color: var(--text-main);
    display: block;
}

.search-result-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    font-size: 0.95rem;
}

.search-result-item p {
    color: var(--text-light);
    font-size: 0.8rem;
    margin-bottom: 0;
    line-height: 1.4;
}

/* Dropdown */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    min-width: 200px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    font-size: 0.95rem;
}

.dropdown-menu li a:hover {
    background-color: var(--bg-offwhite);
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    margin-top: -80px;
    /* Offset header height */
    padding-top: 80px;
}

.hero-bg-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transform: scale(1);
    transition: opacity 1.5s ease-in-out, transform 8s linear;
}

.slide.active {
    opacity: 1;
    transform: scale(1.1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.8), rgba(30, 64, 175, 0.7));
    z-index: -1;
}

/* If using an image later */
/* .hero-bg { background-image: url('hero.jpg'); background-size: cover; ... } */

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    /* Narrower for focus */
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
}

.hero-small h1 {
    color: var(--white);
}

/* Watermark Logo for Hero Sections */
.hero,
.hero-small {
    position: relative;
    overflow: hidden;
}

.hero::after,
.hero-small::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    transform: none;
    width: 100%;
    height: 100%;
    background-image: url('images/logo-gayag.png');
    background-position: left center;
    background-repeat: no-repeat;
    background-size: auto 100%;
    /* Force height to match container height */
    filter: brightness(0) invert(1);
    opacity: 0.08;
    /* More texture-like opacity */
    z-index: 0;
    pointer-events: none;
}


/* Hero Redesign Grid */
.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
    height: 100%;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero .hero-text {
    text-align: left;
    max-width: 100%;
}

.hero .hero-text>* {
    opacity: 0;
    animation: slideInLeft 1s ease-out forwards;
}

.hero .hero-badge {
    animation-delay: 0.2s;
}

.hero h1 {
    animation-delay: 0.4s;
}

.hero-description {
    animation-delay: 0.6s;
}

.hero-buttons {
    animation-delay: 0.8s;
}

.hero-stats {
    animation-delay: 1s;
}

.hero h1 {
    font-size: 3.5rem;
    /* Larger title */
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.2rem;
    color: #cbd5e1;
    margin-bottom: 2.5rem;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: flex-start;
}

.hero-stats {
    display: flex;
    gap: 4rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.h-stat strong {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.h-stat span {
    font-size: 0.9rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.hero-visual {
    position: relative;
    perspective: 1000px;
    animation: float 6s ease-in-out infinite;
}

.hero-card-img {
    width: 100%;
    border-radius: 1.5rem;
    transform: rotateY(-12deg) rotateX(5deg);
    box-shadow: -30px 30px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.5s ease;
}

.hero-visual:hover .hero-card-img {
    transform: rotateY(0) rotateX(0);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-15px);
    }

    100% {
        transform: translateY(0px);
    }
}

@media (max-width: 992px) {
    .hero-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero .hero-text {
        text-align: center;
        margin: 0 auto;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero-buttons {
        justify-content: center;
    }

    .hero-stats {
        justify-content: center;
        gap: 2rem;
    }

    .hero-visual {
        display: none;
    }
}

/* Services Grid */
.section {
    padding: 5rem 0;
}

.bg-light {
    background-color: var(--bg-offwhite);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, 360px);
    justify-content: center;
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: 10px 10px 20px -5px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    border: 1px solid #e2e8f0;
}

.service-card:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 15px 15px 25px -5px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.service-card-hover {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    height: 100%;
    box-shadow: 10px 10px 20px -5px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.service-card-hover:hover {
    transform: scale(1.02) translateY(-5px);
    box-shadow: 15px 15px 25px -5px rgba(0, 0, 0, 0.4);
    border-color: var(--primary-color);
}

.icon-box {
    width: 60px;
    height: 60px;
    background: var(--secondary-color);
    color: var(--primary-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Stats */
.stats-grid {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 2rem;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.stat-label {
    font-size: 1.1rem;
    color: var(--text-light);
}

/* About Split */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.overline {
    text-transform: uppercase;
    color: var(--primary-color);
    letter-spacing: 2px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.check-list li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.check-list i {
    color: var(--primary-color);
}

.img-placeholder {
    width: 100%;
    min-height: 400px;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.img-placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* Contact */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

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

.contact-info-card h3 {
    color: var(--white);
}

.contact-info-card p {
    color: rgba(255, 255, 255, 0.8);
}

.info-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-icon {
    margin-top: 0.25rem;
    font-size: 1.25rem;
}

.contact-info-card h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--white);
}

.social-links {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-links a:hover {
    background: var(--white);
    color: var(--primary-color);
}

.contact-form {
    padding: 3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

/* Footer */
.footer {
    background: var(--black);
    color: var(--white);
    padding-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo .logo-text {
    color: var(--white);
}

.footer p {
    color: #94a3b8;
    margin-top: 1rem;
}

.footerh4 {
    margin-bottom: 1.5rem;
    color: var(--white);
}

.footer li {
    margin-bottom: 0.75rem;
}

.footer li a {
    color: #94a3b8;
}

.footer li a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    padding: 2rem 0;
    text-align: center;
    color: #64748b;
    font-size: 0.9rem;
}

/* Hide mobile specific links on desktop */
.mobile-contact,
.mobile-client {
    display: none;
}

/* Nested Dropdown (Submenu) */
.has-submenu {
    position: relative;
}

.submenu {
    position: absolute;
    left: 100%;
    top: 0;
    min-width: 220px;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    padding: 0.5rem 0;
    transition: all 0.3s ease;
    list-style: none;
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.submenu li a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.2s;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}

.submenu li a:hover {
    background: #f8fafc;
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    padding-left: 2rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    /* Show mobile links in menu */
    .mobile-contact {
        display: block;
        width: 100%;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 1rem;
        margin-top: 0.5rem;
    }

    .mobile-client {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }

    /* Hide header buttons to save space */
    .header-actions .btn-primary {
        display: none;
    }

    .mobile-hide-btn {
        display: none !important;
        /* Force hide client button in header on mobile */
    }

    h1 {
        font-size: 2.25rem;
    }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.8rem;
        /* Slightly larger */
        cursor: pointer;
        color: #ffffff !important;
        /* Force white color */
        padding: 0.5rem;
        z-index: 1002;
        /* Ensure above everything */
        display: flex;
        /* Centering */
        align-items: center;
        justify-content: center;
    }

    .mobile-menu-btn i {
        color: #ffffff !important;
        /* Double force for icon font */
    }

    .nav-center {
        display: none;
        /* Hide for now, enable with JS */
        flex-direction: column;
        position: fixed;
        /* Changed to fixed to ensure it stays on screen */
        top: 80px;
        left: 0;
        width: 100%;
        background: #142850;
        /* Match header color */
        padding: 2rem;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
        /* Stronger shadow */
        align-items: flex-start;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        z-index: 999;
        /* Ensure it is on top */
    }

    /* Mobile Dropdown Fix */
    .nav-center .dropdown-menu {
        display: none;
        /* Hidden by default on mobile */
        position: static;
        width: 100%;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background-color: rgba(0, 0, 0, 0.2);
        /* Darker background for nested items */
        padding-left: 1rem;
        border-left: 2px solid var(--primary-color);
        margin: 0.5rem 0 1rem 0;
        border-radius: 0;
        padding-top: 0;
        padding-bottom: 0;
        min-width: auto;
    }

    .dropdown.open .dropdown-menu {
        display: block;
        /* Show when toggled via JS */
        animation: fadeIn 0.3s ease;
    }

    /* Mobile Submenu (Level 3) */
    .submenu {
        display: none;
        /* Hidden by default on mobile */
        position: static;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        padding-left: 1.5rem;
        /* Deep indentation */
        min-width: auto;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        padding-top: 0;
        padding-bottom: 0.5rem;
    }

    .has-submenu.open .submenu {
        display: block;
        /* Show when opened via JS */
        animation: fadeIn 0.3s ease;
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

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

    .submenu li a {
        color: rgba(255, 255, 255, 0.7) !important;
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .submenu li a:hover {
        padding-left: 1rem;
        /* Disable hover movement on mobile */
        color: var(--white) !important;
        background: transparent;
    }

    .nav-center .dropdown-menu li a {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        color: rgba(255, 255, 255, 0.8);
        /* Liht text for dark menu */
    }

    .nav-center .dropdown-menu li a:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--white);
    }

    .nav-center.active {
        display: flex;
    }

    .nav-links {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        color: var(--text-main);
    }

    .hero-content {
        text-align: center;
    }

    .hero-buttons {
        justify-content: center;
    }

    .split-layout,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }
}


/* Service Detail Section Styles */
.rounded-img {
    border-radius: var(--radius-lg);
    width: 100%;
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
}

.detail-item h4 {
    font-size: 1.1rem;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.detail-item p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.mt-4 {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* Subpages Hero */
.hero-small {
    min-height: 400px;
    height: 50vh;
    margin-top: -80px;
    padding-top: 220px;
    /* Aumentamos padding superior para bajar el texto */
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Volvemos a center pero con más padding top */
    align-items: center;
    padding-bottom: 20px;
}

/* Clase para mantener el centrado original en páginas específicas (Aguas, Aceituna, Formación) */
.hero-center-v {
    padding-top: 110px !important;
    justify-content: center !important;
    flex-direction: column;
    align-items: center;
}

.hero-small .hero-content {
    text-align: center;
    max-width: 850px;
    width: 100%;
}

.hero-small h1 {
    white-space: nowrap;
    /* Forzar una sola línea */
    font-size: clamp(2rem, 4vw, 3.5rem);
    /* Responsive font size to fit */
    color: var(--white) !important;
}

.hero-small p,
.hero-small .hero-badge {
    color: var(--white) !important;
}

/* Responsive adjustment for very small screens */
@media (max-width: 480px) {
    .hero-small h1 {
        white-space: normal;
        /* Allow wrap on mobile if needed */
        font-size: 2rem;
    }
}



.hero-small .hero-text {
    width: 100%;
    text-align: center;
}

.doc-list li {
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--white);
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.doc-list li:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
    transform: translateX(5px);
}

.doc-list i {
    margin-right: 0.5rem;
    color: var(--primary-color);
}

.contact-card-small {
    border: 1px solid #e2e8f0;
    box-shadow: 10px 10px 20px -5px rgba(0, 0, 0, 0.3);
}

.mt-2 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.p-4 {
    padding: 2rem;
}

.mb-5 {
    margin-bottom: 3rem;
}


/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
    will-change: opacity, transform;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.delay-100 {
    transition-delay: 0.1s;
}

.delay-200 {
    transition-delay: 0.2s;
}

.delay-300 {
    transition-delay: 0.3s;
}

.fade-in {
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.fade-in.active {
    opacity: 1;
}

.slide-right {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s ease-out;
}

.slide-right.active {
    opacity: 1;
    transform: translateX(0);
}

.slide-left {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s ease-out;
}

.slide-left.active {
    opacity: 1;
    transform: translateX(0);
}

@media (prefers-reduced-motion: reduce) {

    .reveal,
    .slide-right,
    .slide-left,
    .fade-in {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* Utility Classes */
.bg-primary {
    background-color: var(--primary-color);
    color: var(--white);
}

.text-white {
    color: var(--white);
}

.text-center {
    text-align: center;
}

.p-5 {
    padding: 3rem;
}

.rounded {
    border-radius: var(--radius-lg);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: block;
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 600px;
    position: relative;
    transform: translateY(-20px);
    transition: transform 0.3s ease;
    animation: modalSlideIn 0.3s forwards;
}

@keyframes modalSlideIn {
    to {
        transform: translateY(0);
    }
}

.close-modal {
    color: var(--text-light);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 0.8;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1.5rem;
}

.modal-header h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.parameter-item {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.parameter-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.parameter-item h4 {
    font-size: 1.1rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.parameter-item h4 i {
    color: var(--primary-color);
}

.parameter-item p {
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.6;
}