/* --- GENERAL STYLES --- */
:root {
    --primary-color: #f77b00;
    --primary-color-darker: #d66a00;
    --dark-gray: #222222;
    --medium-gray: #444444;
    --light-gray: #f5f5f5;
    --border-gray: #e0e0e0;
    --font-family: 'Poppins', sans-serif;
}

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

body {
    font-family: var(--font-family);
    color: var(--medium-gray);
    background-color: #fff;
    line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--dark-gray);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color-darker);
}

.btn-main {
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 30px;
    border-radius: 50px;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: inline-block;
    border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-main:hover {
    background-color: var(--primary-color-darker);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-main:focus-visible {
    outline: 2px solid var(--primary-color-darker);
    outline-offset: 2px;
}

.section-title {
    text-align: center;
    padding-bottom: 40px;
}

.section-title h2 {
    font-size: 32px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 10px;
    padding-bottom: 10px;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    display: block;
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.section-title p {
    margin-bottom: 0;
    color: #6c757d;
    font-size: 1.1rem;
}

/* --- ANIMATIONS ON SCROLL --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

/* Delay for hero elements */
.hero-section h1 { transition-delay: 0.2s; }
.hero-section h2 { transition-delay: 0.4s; }
.hero-section .btn-main { transition-delay: 0.6s; }


/* --- HEADER --- */
#header {
    background: var(--dark-gray);
    padding: 15px 0;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
}

#header.scrolled {
    background: rgba(34, 34, 34, 0.95);
    backdrop-filter: blur(5px);
    padding: 10px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

#header .logo {
    color: #fff; /* Fallback for text */
    transition: 0.3s;
    line-height: 1; /* Ensures image aligns well */
    text-decoration: none;
}
#header .logo:hover {
    color: #fff;
}
#header .logo span {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
}
#header .logo-img {
    max-height: 50px;
    transition: max-height 0.3s ease-in-out;
}
#header.scrolled .logo-img {
    max-height: 40px;
}


/* --- NAVIGATION MENU --- */
.navbar { padding: 0; }
.navbar ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    align-items: center;
}
.navbar li { position: relative; }
.navbar a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    transition: 0.3s;
}
.navbar a:hover, .navbar .active {
    color: var(--primary-color);
}
.mobile-nav-toggle {
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: none;
    background: none;
    border: none;
}

/* --- HERO SECTION --- */
.hero-section {
    width: 100%;
    height: 100vh;
    background: url('assets/images/hero-section.jpg') no-repeat center center;
    background-size: cover;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-section .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
}
.hero-section .container {
    position: relative;
    z-index: 2;
}
.hero-section h1 {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
.hero-section h2 {
    font-size: 24px;
    font-weight: 300;
    color: #eee;
    margin-bottom: 40px;
}

/* --- ABOUT SECTION --- */
.about-section ul { list-style: none; padding: 0; }
.about-section ul li {
    padding-left: 28px;
    position: relative;
    margin-bottom: 10px;
}
.about-section ul li::before {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    top: 1px;
    color: var(--primary-color);
}

/* --- SERVICES SECTION --- */
.services-section { background-color: var(--light-gray); }
.service-card {
    background: #fff;
    padding: 30px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    border-bottom: 3px solid transparent;
}
.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-bottom-color: var(--primary-color);
}
.service-card .icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}
.service-card:hover .icon {
    transform: scale(1.1);
}
.service-card h4 {
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 20px;
}
.service-card p {
    font-size: 15px;
    color: #6c757d;
}

/* --- PROJECTS SECTION --- */
.project-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
}
.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.project-item:hover .project-image {
    transform: scale(1.1);
}
.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(247, 123, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 36px;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.project-item:hover .project-overlay {
    opacity: 1;
}
.swiper-button-next, .swiper-button-prev {
    color: #fff;
    background-color: rgba(0, 0, 0, 0.4);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    transition: background-color 0.3s;
}
.swiper-button-next:hover, .swiper-button-prev:hover {
    background-color: var(--primary-color);
}
.swiper-button-next::after, .swiper-button-prev::after {
    font-size: 20px;
}
.swiper-pagination-bullet-active {
    background: var(--primary-color);
}

/* --- CONTACT SECTION --- */
.contact-section .form-control {
    border-radius: 8px;
    padding: 12px 15px;
    border: 1px solid var(--border-gray);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.contact-section .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(247, 123, 0, 0.25);
}
#form-status { text-align: center; font-weight: 600; }
.form-success { color: #198754; }
.form-error { color: #dc3545; }

/* --- FOOTER --- */
#footer { background: var(--dark-gray); color: #fff; font-size: 14px; }
#footer h3 { font-size: 24px; color: #fff; }
#footer h4 {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    position: relative;
    padding-bottom: 12px;
}
#footer .footer-links, #footer .legal-links { list-style: none; padding: 0; }
#footer .footer-links li, #footer .legal-links li { padding: 8px 0; }
#footer .footer-links a, #footer .legal-links a { color: #ccc; transition: 0.3s; }
#footer .footer-links a:hover, #footer .legal-links a:hover { color: var(--primary-color); }
#footer .social-links a {
    font-size: 18px;
    display: inline-block;
    background: var(--medium-gray);
    color: #fff;
    line-height: 1;
    padding: 8px 0;
    margin-right: 4px;
    border-radius: 50%;
    text-align: center;
    width: 36px;
    height: 36px;
    transition: 0.3s;
}
#footer .social-links a:hover { background: var(--primary-color); color: #fff; transform: translateY(-2px); }
#footer .footer-bottom { background: #111; padding: 15px 0; font-size: 13px; text-align: center; }

/* --- AVISO LEGAL & 404 PAGE --- */
.footer-logo .logo-img {
    max-height: 60px;
    margin-bottom: 15px;
}
.footer-info p {
    margin-top: 15px;
}
.legal-page {
    padding-top: 120px;
    padding-bottom: 60px;
    min-height: 80vh;
}
.legal-page h2 {
    color: var(--primary-color);
    margin-top: 30px;
    margin-bottom: 15px;
}

.error-page-wrapper {
    background-color: #222;
    background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
    background-size: 20px 20px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.error-page-content {
    background: #fff;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.error-page-content h1 {
    font-size: 72px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0;
    line-height: 1;
}
.error-page-content h2 {
    font-size: 28px;
    margin-bottom: 20px;
}
.error-page-content p {
    font-size: 18px;
    color: var(--medium-gray);
    margin-bottom: 30px;
}

/* --- RESPONSIVE DESIGN --- */
@media (max-width: 991px) {
    /* Mobile Menu */
    .mobile-nav-toggle { display: block; }
    .navbar ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        right: 15px;
        background: rgba(34, 34, 34, 0.98);
        padding: 10px 0;
        border-radius: 8px;
        box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.2);
        z-index: 99;
    }
    .navbar.nav-open ul { display: flex; }
    .navbar a { padding: 10px 20px; }

    /* Hero section */
    .hero-section h1 { font-size: 32px; }
    .hero-section h2 { font-size: 18px; }

    /* Sections */
    .section-title h2 { font-size: 28px; }
    .about-section, .services-section, .projects-section, .contact-section, .legal-page { padding-top: 60px; padding-bottom: 60px; }
    #footer .footer-info, #footer .footer-links { margin-bottom: 30px; }
}