:root {
    --primary-color: #0f172a; /* Slate 900 - Modern Dark Blue */
    --secondary-color: #dc2626; /* Red 600 - Kalor Red */
    --text-color: #334155; /* Slate 700 */
    --light-bg: #f1f5f9; /* Slate 100 */
    --white: #ffffff;
    --footer-bg: #0f172a;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--light-bg);
}

.container {
    max-width: 1400px; /* Increased for the new layout */
    margin: 0 auto;
    padding: 0 20px;
}

/* Layout y navegación lateral */
.page-layout {
    display: flex;
    min-height: 100vh;
}

header {
    background: var(--white);
    box-shadow: 2px 0 5px rgba(0,0,0,0.05);
    z-index: 100;
}

.sidebar {
    width: 260px;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.sidebar-logo {
    margin-bottom: 1.5rem;
    text-align: center;
    width: 100%;
}

.sidebar-logo-img {
    max-width: 150px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.hamburger {
    display: block;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.hamburger:hover {
    background-color: rgba(0,0,0,0.05);
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    animation: fadeIn 0.3s ease;
}

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

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

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s;
    display: block;
    padding: 0.8rem 1rem;
    border-radius: 6px;
    text-align: center;
}

.nav-links a:hover {
    color: var(--secondary-color);
    background-color: rgba(0,0,0,0.03);
}

.nav-links a.active {
    color: var(--white);
    background-color: var(--primary-color);
    font-weight: 600;
}

/* New Horizontal Navigation */
.main-navigation {
    width: 100%;
    background: #e2e8f0; /* Slate 200 - Light Gray */
    padding: 1.5rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.nav-links-horizontal {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 3rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links-horizontal a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-links-horizontal a:hover {
    color: var(--secondary-color);
    background-color: rgba(220, 38, 38, 0.1);
}

.nav-links-horizontal a.active {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
}


/* Main Content Area */
.content-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 1rem;
    width: 100%;
}

main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Hero Section */
.hero {
    background: #555;
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://images.unsplash.com/photo-1541888946425-d81bb19240f5?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: var(--white);
    display: flex;
    align-items: center;
    text-align: center;
    padding: 6rem 1rem;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
    width: 100%;
}

.hero-logo-wrapper {
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.hero-logo {
    max-width: 100%;
    max-height: 250px;
    height: auto;
    display: block;
}

.hero p {
    font-size: 1.5rem;
    font-weight: 300;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
}

.section-padding {
    padding: 5rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--secondary-color);
    border-radius: 2px;
}

/* Custom Grid Layout: Img - 4 Divs - Img */
.projects-grid-custom {
    display: grid;
    grid-template-columns: 1fr 1.5fr 1fr; /* Image - Services - Image */
    gap: 2rem;
    align-items: stretch;
}

.large-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.services-grid-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 1.5rem;
}

.service-card.mini {
    padding: 1.5rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    text-align: center;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.service-card.mini:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}

.service-card.mini i {
    font-size: 2rem;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.service-card.mini .icon-blue {
    color: #3b82f6; /* Blue */
}

.service-card.mini .icon-black {
    color: #0f172a; /* Black/Slate 900 */
}

.service-card.mini svg {
    margin-bottom: 0.5rem;
}

.service-card.mini h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.service-card.mini p {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Contact Page Layout */
.contact-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
}

.contact-info {
    flex: 1;
    min-width: 400px;
    max-width: 600px;
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2rem;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-right: 1rem;
    width: 25px;
    text-align: center;
    margin-top: 3px;
}

.info-item p {
    font-size: 1rem;
    color: var(--text-color);
    margin: 0;
}

/* Contact Form */
.contact-form {
    flex: 2;
    min-width: 300px;
    max-width: 600px;
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--primary-color);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--secondary-color);
    outline: none;
}

.form-group textarea {
    height: 150px;
    resize: vertical;
}

.submit-btn {
    background: var(--secondary-color);
    color: var(--white);
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    width: 100%;
    transition: background 0.3s, transform 0.2s;
}

.submit-btn:hover {
    background: #b91c1c;
    transform: scale(1.02);
}

.submit-btn.disabled {
    background: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
    transform: none;
}

.captcha {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.captcha-error {
    display: none;
    color: #dc2626;
    margin-top: 0.5rem;
    font-weight: 500;
}

.error-message {
    color: #ef4444;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: block;
}

/* Legal Content */
.legal-content {
    background: var(--white);
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    max-width: 900px;
    margin: 0 auto;
}

.legal-content h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
    border-left: 4px solid var(--secondary-color);
    padding-left: 1rem;
}

.legal-content p {
    color: var(--text-color);
    margin-bottom: 1.5rem;
    text-align: justify;
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
    margin-top: auto;
}

.footer-links {
    margin-top: 1.5rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--secondary-color);
}

.footer-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.footer-left {
    text-align: left;
}

.footer-right {
    text-align: right;
    color: #cbd5e1;
}

.footer-right p {
    margin: 0;
    line-height: 1.4;
}

.footer-center {
    text-align: center;
    flex: 1;
}

/* Responsive */
@media (max-width: 1024px) {
    .projects-grid-custom {
        grid-template-columns: 1fr;
    }
    .large-img {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .contact-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .contact-info, .contact-form {
        width: 100%;
        max-width: 100%;
    }

    .footer-flex {
        flex-direction: column;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-left, .footer-right {
        text-align: center;
    }

    .page-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        padding: 1rem;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
    }

    .sidebar-logo {
        width: auto;
        margin-bottom: 0;
    }
    
    .sidebar-logo-img {
        max-width: 100px;
    }

    .hamburger {
        margin-bottom: 0;
        font-size: 1.8rem;
    }
    
    .nav-links {
        width: 100%;
        margin-top: 1rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
}