/*
Theme Name: DAMAR ENT LLC (IOS Style)
Theme URI: https://damarent.com
Author: Enterprise Digital Agency Architecture E-Suite
Description: Premium, accessible, and high-credibility corporate WordPress theme tailored for DAMAR ENT LLC. Built with modern UI/UX workflows, clean semantic markup, and optimal SEO infrastructure.
Version: 1.0.9
License: GNU General Public License v2 or later
Text Domain: damar-theme-new
*/

/* --- 1. CSS VARIABLES & CORE DESIGN SYSTEM --- */
:root {
    --primary-color: #1877F2;     /* Facebook/Google Premium Corporate Blue */
    --secondary-color: #0A2540;   /* Deep Trust Navy */
    --accent-color: #34A853;      /* Growth/SBA Success Green */
    --text-main: #2C3E50;         /* Slate Main Body Text */
    --text-muted: #627D98;        /* Accessibility Subtext */
    --bg-light: #F4F6F9;          /* Premium Section Background */
    --bg-white: #FFFFFF;
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    --max-width: 1200px;
    --transition: all 0.3s ease-in-out;
}

/* --- 2. RESET & ACCESSIBILITY DEFAULTS --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--secondary-color);
    font-weight: 700;
    line-height: 1.25;
}

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

a:hover, a:focus {
    color: var(--secondary-color);
    outline: 2px dashed var(--primary-color);
}

/* --- 3. STRUCTURE & LAYOUT UTILITIES --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

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

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

.flex-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

/* --- 4. BUTTONS --- */
.btn {
    display: inline-block;
    padding: 14px 28px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    text-align: center;
    border: none;
    font-family: var(--font-heading);
}

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

.btn-primary:hover {
    background-color: #145dbf;
    color: var(--bg-white);
}

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

.btn-secondary:hover {
    background-color: #051424;
    color: var(--bg-white);
}

/* --- 5. ADAPTABLE MULTI-LEVEL HEADER SYSTEM --- */
.site-header {
    background: #ffffff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 9999;
    width: 100%;
}

.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.top-compliance-bar {
    background: var(--secondary-color);
    color: #ffffff;
    font-size: 11px;
    padding: 8px 0;
    text-align: center;
    font-weight: 500;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.header-navigation-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    position: relative;
}

.brand-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--secondary-color);
    font-family: var(--font-heading);
    text-decoration: none;
}

.brand-accent {
    color: var(--primary-color);
}

.brand-tagline {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin: 0;
}

/* --- VISTA ESCRITORIO: MENÚ NATIVO MULTINIVEL (>= 992px) --- */
@media (min-width: 992px) {
    .main-navigation {
        display: flex;
        align-items: center;
        gap: 25px;
    }

    /* Nivel 1 - Raíz */
    .nav-menu {
        display: flex;
        list-style: none;
        gap: 6px;
        margin: 0;
        padding: 0;
        font-weight: 500;
        align-items: center;
    }

    .nav-menu li {
        position: relative;
    }

    .nav-menu a {
        display: block;
        color: var(--secondary-color);
        text-decoration: none;
        font-size: 15px;
        padding: 10px 14px;
        transition: color 0.2s ease;
    }

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

    /* Indicador visual de submenú (Flecha hacia abajo en Nivel 1) */
    .nav-menu .menu-item-has-children > a::after {
        content: '▾';
        margin-left: 6px;
        font-size: 11px;
        display: inline-block;
        vertical-align: middle;
    }

    /* Nivel 2 - Primer Submenú Desplegable */
    .nav-menu .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--bg-white);
        box-shadow: 0 8px 24px rgba(10,37,64,0.1);
        border: 1px solid #e2e8f0;
        border-radius: 6px;
        padding: 8px 0;
        min-width: 230px;
        flex-direction: column;
        gap: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(10px);
        transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
        display: flex !important;
        list-style: none;
        z-index: 10000;
    }

    .nav-menu .sub-menu a {
        padding: 10px 20px;
        font-size: 14px;
        color: var(--text-main);
        font-weight: 500;
    }

    .nav-menu .sub-menu a:hover {
        background: var(--bg-light);
        color: var(--primary-color);
    }

    /* Indicador visual en submenú (Flecha hacia la derecha en Nivel 2) */
    .nav-menu .sub-menu .menu-item-has-children > a::after {
        content: '▸';
        float: right;
        margin-top: 3px;
    }

    /* Nivel 3 - Sub-submenú (Abre hacia el lateral derecho) */
    .nav-menu .sub-menu .sub-menu {
        top: 0;
        left: 100%;
        margin-left: 1px;
    }

    /* Mostrar submenús con transiciones suaves al hacer Hover */
    .nav-menu li:hover > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.btn-header-primary {
    background: var(--primary-color);
    color: #ffffff !important;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s ease;
    display: inline-block;
    white-space: nowrap;
}

.btn-header-primary:hover {
    background: #115cd4;
}

/* Botón Hamburguesa */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 10001;
}

.menu-toggle .bar {
    width: 100%;
    height: 2px;
    background-color: var(--secondary-color);
    transition: all 0.3s ease;
}

/* --- 6. CORPORATE FORMS --- */
.corporate-form {
    background: var(--bg-white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    max-width: 700px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--secondary-color);
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #CCD0D5;
    border-radius: 4px;
    font-family: var(--font-body);
}

.form-control:focus {
    outline: 2px solid var(--primary-color);
}

/* --- 7. GLOBAL RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 991px) {
    .section-padding { 
        padding: 50px 0; 
    }
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }

    .top-compliance-bar {
        font-size: 10px;
        padding: 6px 10px;
    }

    /* Mostrar botón de menú móvil */
    .menu-toggle {
        display: flex;
    }

    /* Transformación del Botón Hamburguesa a una (X) */
    .menu-toggle.is-active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.is-active .bar:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Contenedor de Navegación Móvil */
    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #ffffff;
        box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        display: none; 
        flex-direction: column;
        padding: 20px;
        gap: 20px;
        max-height: calc(100vh - 120px);
        overflow-y: auto; /* Habilita scroll interno si los 3 niveles son muy extensos */
    }

    .main-navigation.is-active {
        display: flex;
    }

    /* Estructura de Listas en Móvil */
    .nav-menu {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        list-style: none;
        margin: 0;
        padding: 0;
        gap: 5px;
        width: 100%;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a {
        display: block;
        padding: 12px 10px;
        color: var(--secondary-color);
        font-size: 16px;
        font-weight: 600;
        border-radius: 4px;
        width: 100%; 
        box-sizing: border-box;
    }

    .nav-menu a:hover {
        background: var(--bg-light);
    }

    /* Ocultamiento y Despliegue de Submenús en Móvil (Tipo Acordeón) */
    .nav-menu .sub-menu {
   /*     display: none !important;  Mantiene oculto los niveles 2 y 3 por defecto */
        position: static;
        box-shadow: none;
        border-radius: 0;
        padding-left: 15px;
        margin: 5px 0;
        border-left: 2px solid #e2e8f0;
        opacity: 1;
        visibility: visible;
        width: 100%;
        list-style: none;
    }

    .nav-menu .sub-menu a {
        font-size: 14px;
        color: var(--text-main);
        font-weight: 500;
    }

    /* Regla que activa la visualización mediante JS (.open-submenu) */
    .nav-menu .menu-item-has-children.open-submenu > .sub-menu {
        display: flex !important;
    }

    /* Estilos de flecha interactiva en Móvil */
    .nav-menu .menu-item-has-children > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    .nav-menu .menu-item-has-children > a::after {
        content: '▾';
        font-size: 12px;
        transition: transform 0.2s ease;
    }

    .nav-menu .menu-item-has-children.open-submenu > a::after {
        transform: rotate(180deg);
        color: var(--primary-color);
    }

    /* Envolvedor y botón CTA final en móvil */
    .nav-btn-wrapper {
        width: 100%;
        padding-top: 15px;
        border-top: 1px solid #f0f4f8;
        list-style: none;
    }

    .btn-header-primary {
        display: block;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }
}