:root {
    --bg-primary: #121212;
    --bg-secondary: #1a1a1a;
    --accent: #e27322;
    --text-primary: #f0f0f0;
    --text-secondary: #b0b0b0;
    --header-bg: rgba(18, 18, 18, 0.8);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Typography */
h1,
h2,
h3 {
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
    border-left: 4px solid var(--accent);
    padding-left: 1rem;
}

p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 65ch;
}

/* Layout */
section {
    padding: 150px 5%;
    min-height: 80vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}

.bg-panel {
    background-color: var(--bg-secondary);
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, padding 0.3s ease, backdrop-filter 0.3s ease;
    border-bottom: 1px solid transparent;
}

header.scrolled {
    background-color: var(--header-bg);
    backdrop-filter: blur(10px);
    padding: 0.8rem 5%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    min-height: 80px;
    /* Asegura espacio para el logo según el cambio del usuario */
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-img {
    height: 80px;
    /* Ajustado para coincidir con el estilo inline del usuario */
    width: auto;
    object-fit: contain;
    transition: height 0.3s ease;
}

header.scrolled .logo-img {
    height: 60px;
    /* Reducción sutil al hacer scroll para mejor diseño */
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
    /* ALINEACIÓN VERTICAL ARREGLADA */
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: var(--transition);
}

nav a:hover {
    color: var(--accent);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--accent);
    color: white;
}

.btn-primary:hover {
    background-color: #f38a3d;
    transform: translateY(-2px);
}

.btn-secondary {
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 1rem;
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Hero Section */
#inicio {
    padding-top: 150px;
}

#inicio .chips {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
}

.chip {
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-radius: 100px;
}

/* Lists */
.feature-list {
    list-style: none;
    margin-top: 1rem;
}

.feature-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.feature-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin-top: 3rem;
}

.product-card {
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 2.5rem;
    border-radius: 8px;
    transition: var(--transition);
    text-decoration: none;
}

.product-card:hover {
    border-color: var(--accent);
    background: rgba(226, 115, 34, 0.03);
    transform: translateY(-5px);
}

.product-card h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.product-card p {
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.product-link {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* Contact Form */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    margin-top: 3rem;
}

.contact-form {
    display: grid;
    gap: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-radius: 4px;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* Contact Form Enhancements */
.hp {
    position: absolute;
    left: -9999px;
    top: -9999px;
    height: 0;
    width: 0;
    overflow: hidden;
    visibility: hidden;
}

#formStatus {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 4px;
    font-weight: 500;
    display: none;
    font-size: 0.95rem;
}

#formStatus.success {
    display: block;
    background: rgba(46, 213, 115, 0.1);
    color: #2ed573;
    border: 1px solid rgba(46, 213, 115, 0.2);
}

#formStatus.error {
    display: block;
    background: rgba(255, 71, 87, 0.1);
    color: #ff4757;
    border: 1px solid rgba(255, 71, 87, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.form-group label.required::after {
    content: " *";
    color: var(--accent);
    font-weight: 600;
}

/* Footer */
footer {
    padding: 50px 5%;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--accent);
}

.copy {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.3);
}

/* Motif decoration */
.motif-bg {
    position: absolute;
    top: 50%;
    right: -10%;
    width: 600px;
    height: 600px;
    opacity: 0.05;
    pointer-events: none;
    z-index: -1;
}

.motif-bg img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Clients Section */
.clients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
    align-items: center;
    justify-items: center;
}

.client-logo {
    width: 100%;
    max-width: 180px;
    height: auto;
    opacity: 0.6;
    filter: grayscale(100%);
    transition: all 0.4s ease;
    cursor: pointer;
    border-radius: 8px;
}

.client-logo:hover {
    opacity: 1;
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Responsive */
@media (max-width: 1100px) {
    h1 {
        font-size: 2rem;
        line-height: 1.3;
    }

    h2 {
        font-size: 1.6rem;
    }

    p {
        font-size: 1rem;
    }

    section {
        padding: 60px 5%;
        min-height: auto;
    }

    #inicio {
        padding-top: 120px;
    }

    .products-grid,
    .contact-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Transform nav into mobile overlay */
    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background-color: var(--bg-secondary);
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        transition: right 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    nav.active {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        gap: 0;
        padding: 80px 0 20px 0;
        align-items: stretch;
    }

    nav li {
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    nav a {
        display: block;
        padding: 1.2rem 2rem;
        font-size: 1rem;
        text-transform: none;
        letter-spacing: normal;
    }

    nav a.btn {
        margin: 1rem 2rem;
        text-align: center;
        width: calc(100% - 4rem);
    }

    /* Fix button stacking on mobile */
    .btn-secondary {
        margin-left: 0;
        margin-top: 1rem;
    }

    #inicio div[style*="margin-top: 3rem"] {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /* Ensure chips wrap properly */
    #inicio .chips {
        flex-wrap: wrap;
    }

    /* Hide decorative motifs on mobile to prevent overflow */
    .motif-bg {
        display: none;
    }

    /* Adjust product cards padding */
    .product-card {
        padding: 1.5rem;
    }

    /* Footer adjustments */
    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        text-align: center;
    }

    /* Clients grid mobile adjustments */
    .clients-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 2rem;
    }

    .client-logo {
        max-width: 140px;
    }
}

/* Mobile menu backdrop */
.mobile-menu-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-backdrop.active {
    display: block;
    opacity: 1;
}