/* ============================================
   HM & ASOCIADOS - Estilos Profesionales
   Paleta exacta del logo corporativo
   Verde Oliva Oscuro + Dorado Ocre
   ============================================ */

/* Variables CSS - Colores EXACTOS del Logo */
:root {
    --primary-color: #4a5240;       /* Verde oliva oscuro exacto del logo */
    --primary-light: #5a6350;
    --primary-dark: #3a4230;
    --secondary-color: #606b52;     /* Verde grisáceo del subtítulo */
    --accent-color: #c4a35a;        /* Dorado ocre exacto de las líneas */
    --accent-light: #d4b36a;
    --accent-dark: #b4934a;
    --text-dark: #2d3436;
    --text-medium: #636e72;
    --text-light: #b2bec3;
    --bg-light: #f8f8f6;
    --bg-white: #ffffff;
    --border-color: #e2e4de;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --menu-width: 220px;
}

/* Reset y Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   MENÚ LATERAL COMPACTO
   ============================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--menu-width);
    height: 100vh;
    background: var(--primary-dark);
    z-index: 1000;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

/* Header con fondo blanco para el logo */
.sidebar-header {
    padding: 15px;
    text-align: center;
    background: #ffffff;
    border-bottom: 3px solid var(--accent-color);
}

.sidebar-logo {
    width: 120px;
    height: auto;
    margin-bottom: 8px;
}

.company-name {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.company-tagline {
    color: var(--secondary-color);
    font-size: 0.85rem;
    margin-top: 3px;
    letter-spacing: 0.3px;
}

/* Navegación del Menú */
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary-color) 100%);
}

.nav-menu {
    list-style: none;
}

.nav-item {
    margin: 2px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 11px 14px;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    border-radius: 8px;
    transition: var(--transition-fast);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--accent-color);
    border-radius: 0 3px 3px 0;
    transition: var(--transition-fast);
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255,255,255,0.12);
    color: #ffffff;
}

.nav-link:hover::before,
.nav-link.active::before {
    height: 60%;
}

.nav-icon {
    width: 20px;
    margin-right: 10px;
    font-size: 1rem;
}

/* Submenú desplegable */
.nav-item.has-submenu {
    position: relative;
}

.nav-item.has-submenu > .nav-link::after {
    content: '▾';
    margin-left: auto;
    font-size: 0.7rem;
    transition: var(--transition-fast);
}

.nav-item.has-submenu:hover > .nav-link::after,
.nav-item.has-submenu.open > .nav-link::after {
    transform: rotate(180deg);
}

.submenu {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
    margin: 5px 0 5px 28px;
}

.nav-item.has-submenu:hover .submenu,
.nav-item.has-submenu.open .submenu {
    max-height: 300px;
    padding: 8px 0;
}

.submenu li {
    margin: 0;
}

.submenu a {
    display: block;
    padding: 9px 15px;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.88rem;
    transition: var(--transition-fast);
    border-radius: 4px;
    margin: 2px 8px;
}

.submenu a:hover,
.submenu a.active {
    background: rgba(255,255,255,0.1);
    color: #ffffff;
}

.submenu a.active {
    border-left: 2px solid var(--accent-color);
}

/* Footer del Sidebar */
.sidebar-footer {
    padding: 14px;
    border-top: 1px solid rgba(255,255,255,0.1);
    background: var(--primary-dark);
}

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

.contact-info p {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
    margin: 4px 0;
}

.contact-info a {
    color: var(--accent-light);
    text-decoration: none;
    transition: var(--transition-fast);
}

.contact-info a:hover {
    color: #ffffff;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.main-content {
    margin-left: var(--menu-width);
    min-height: 100vh;
    transition: var(--transition-normal);
}

/* Header Superior Compacto */
.top-header {
    background: var(--bg-white);
    padding: 12px 25px;
    box-shadow: var(--shadow-sm);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid var(--primary-color);
}

.page-title {
    font-size: 1.25rem;
    color: var(--primary-color);
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 9px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: var(--primary-light);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

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

/* ============================================
   SECCIÓN HERO COMPACTA
   ============================================ */

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    padding: 45px 30px;
    color: white;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(196,163,90,0.1) 0%, transparent 60%);
}

.hero-content {
    max-width: 700px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.25;
}

.hero-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 20px;
    line-height: 1.6;
}

.hero-stats {
    display: flex;
    gap: 35px;
    margin-top: 25px;
}

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

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.85;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   SECCIÓN DE SERVICIOS - PRINCIPAL
   ============================================ */

.services-section {
    padding: 50px 25px 45px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-color) 140px, var(--bg-light) 140px);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: var(--bg-white);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-top: 4px solid var(--accent-color);
}

.section-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

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

.section-subtitle {
    color: var(--text-medium);
    font-size: 1rem;
    max-width: 480px;
    margin: 18px auto 0;
    line-height: 1.6;
}

/* Grid de Servicios Compacto */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 18px;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background: var(--bg-white);
    border-radius: 10px;
    padding: 22px 18px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition-normal);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-icon {
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 1.4rem;
    color: white;
    transition: var(--transition-normal);
}

.service-card:hover .service-icon {
    transform: scale(1.08);
    background: var(--accent-color);
}

.service-title {
    font-size: 1.15rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
}

.service-description {
    color: var(--text-medium);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.service-features {
    list-style: none;
    margin-bottom: 15px;
}

.service-features li {
    padding: 5px 0;
    color: var(--text-medium);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.service-features li::before {
    content: '✓';
    color: var(--primary-color);
    font-weight: bold;
    font-size: 0.85rem;
}

.service-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition-fast);
}

.service-link:hover {
    color: var(--accent-color);
    gap: 8px;
}

/* ============================================
   SECCIÓN CTA COMPACTA
   ============================================ */

.cta-section {
    background: var(--primary-color);
    padding: 45px 25px;
    text-align: center;
    position: relative;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-color);
}

.cta-content {
    max-width: 550px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta-title {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 12px;
}

.cta-text {
    color: rgba(255,255,255,0.85);
    font-size: 1rem;
    margin-bottom: 25px;
}

.cta-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-accent {
    background: var(--accent-color);
    color: var(--primary-dark);
    font-weight: 700;
}

.btn-accent:hover {
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-white:hover {
    background: var(--bg-light);
    transform: translateY(-2px);
}

/* ============================================
   FOOTER COMPACTO
   ============================================ */

.main-footer {
    background: var(--primary-dark);
    color: white;
    padding: 35px 25px 20px;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
}

.footer-section h3 {
    font-size: 1.05rem;
    margin-bottom: 12px;
    color: var(--accent-color);
}

.footer-section p,
.footer-section li {
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin: 5px 0;
}

.footer-section a {
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: var(--transition-fast);
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    margin-top: 25px;
    padding-top: 18px;
    text-align: center;
}

.footer-bottom p {
    color: rgba(255,255,255,0.45);
    font-size: 0.85rem;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    :root {
        --menu-width: 200px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: 240px;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex;
    }
    
    .top-header {
        padding: 10px 15px;
    }
    
    .hero-section {
        padding: 35px 15px;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 20px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .services-section {
        padding: 35px 15px;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .cta-section {
        padding: 35px 15px;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 240px;
        justify-content: center;
    }
}

/* Toggle del menú móvil */
.menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: var(--transition-fast);
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: var(--transition-fast);
}

.menu-toggle:hover {
    background: var(--primary-light);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
}

/* Overlay para móvil */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: var(--transition-normal);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeInUp 0.4s ease forwards;
}

.service-card:nth-child(1) { animation-delay: 0.05s; }
.service-card:nth-child(2) { animation-delay: 0.1s; }
.service-card:nth-child(3) { animation-delay: 0.15s; }
.service-card:nth-child(4) { animation-delay: 0.2s; }
.service-card:nth-child(5) { animation-delay: 0.25s; }
.service-card:nth-child(6) { animation-delay: 0.3s; }
.service-card:nth-child(7) { animation-delay: 0.35s; }
.service-card:nth-child(8) { animation-delay: 0.4s; }

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-light);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}
