/* ==========================================================================
   DHEMA BUILDER: Frontend Styles (Isolated)
   ========================================================================== */

/* Utilidades Base del Constructor */
.db-content-wrap {
    width: 100%;
    overflow: hidden;
}

.db-container {
    width: 100%;
    padding-left: 4%;
    padding-right: 4%;
    margin: 0 auto;
}

.db-section-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    font-weight: 600;
    letter-spacing: -1.5px;
    margin: 0;
}

/* ==========================================================================
   1. HERO
   ========================================================================== */
.db-hero {
    position: relative;
    width: 100%;
    min-height: 80vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
    padding-bottom: 6rem;
}

.db-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.db-hero-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
    width: 100%;
}

.db-hero-title {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -1px;
    max-width: 800px;
    margin: 0;
}

.db-hero-desc {
    font-size: 1.2rem;
    margin-top: 1rem;
    max-width: 600px;
    color: rgba(255, 255, 255, 0.9);
}

/* ==========================================================================
   2. PROYECTOS
   ========================================================================== */
.db-projects-section {
    padding: 8rem 0;
    background-color: #ffffff;
}

.db-projects-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 5rem;
    gap: 4rem;
}

.db-projects-header .db-section-title {
    flex-shrink: 0;
}

.db-projects-desc {
    max-width: 600px;
    font-size: 1.1rem;
    line-height: 1.6;
}

.db-projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4rem 2rem;
}

.db-project-card {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.db-project-thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #f0f0f0;
}

.db-project-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.db-project-card:hover .db-project-thumb img {
    transform: scale(1.04);
}

.db-thumb-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
}

.db-project-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.db-project-title {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: -0.3px;
    margin: 0;
}

.db-project-title a {
    text-decoration: none;
    color: #111111;
}

.db-project-terms {
    font-size: 0.85rem;
    color: #666666;
    font-weight: 400;
}

/* ==========================================================================
   3. SERVICIOS (Acordeón)
   ========================================================================== */
.db-services {
    padding: 6rem 0;
    background: #ffffff;
}

.db-services-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.db-service-item {
    border-bottom: 1px solid #eaeaea;
}

.db-service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    cursor: pointer;
}

.db-service-name {
    font-size: 1.25rem;
    font-weight: 500;
    margin: 0;
}

.db-icon {
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.db-service-item.active .db-icon {
    transform: rotate(45deg);
}

.db-service-content {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

.db-service-item.active .db-service-content {
    max-height: 500px;
    opacity: 1;
    padding-bottom: 1.5rem;
}

.db-btn-small {
    display: inline-block;
    padding: 0.8rem 2rem;
    border: 1px solid #111111;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 2rem;
    text-decoration: none;
    color: #111111;
    transition: all 0.3s ease;
}

.db-btn-small:hover {
    background: #111111;
    color: #ffffff;
}

/* ==========================================================================
   4. TESTIMONIOS
   ========================================================================== */
.db-testimonials {
    padding: 8rem 0;
    background: #f7f7f7;
    text-align: center;
}

.db-test-item {
    max-width: 900px;
    margin: 0 auto;
    display: none;
}

.db-test-item.active {
    display: block;
    animation: fadeIn 0.8s ease;
}

.db-test-quote {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.3;
    font-weight: 500;
    margin-bottom: 2rem;
}

.db-test-author {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888888;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ==========================================================================
   5. ABOUT / MÉTRICAS (Estructura Overlap)
   ========================================================================== */
.db-about {
    position: relative;
    min-height: 600px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    background: #ffffff;
    padding: 4rem 0;
}

.db-about-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 65%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
}

.db-about-card {
    position: relative;
    z-index: 2;
    background: #ffffff;
    padding: 3rem;
    width: 50%;
    box-shadow: 0 20px 50px rgba(0,0,0,0.05);
    margin-right: 4%;
}

.db-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
}

.db-stat-item {
    border-top: 1px solid #eeeeee;
    padding-top: 1.5rem;
}

.db-stat-num {
    font-size: 1.8rem;
    font-weight: 700;
    display: block;
}

.db-stat-label {
    font-size: 0.85rem;
    color: #888888;
}

/* ==========================================================================
   6. CTA
   ========================================================================== */
.db-cta {
    padding: 6rem 0;
    text-align: center;
    background: #f7f7f7;
}

.db-cta-title {
    font-size: clamp(2.5rem, 4vw, 3.5rem);
    margin-bottom: 1rem;
}

.db-cta-sub {
    font-size: 1.2rem;
    color: #666666;
    margin-bottom: 2.5rem;
}

.db-btn-outline {
    display: inline-block;
    padding: 1.2rem 3.5rem;
    border: 2px solid #111111;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    color: #111111;
    transition: all 0.3s ease;
}

.db-btn-outline:hover {
    background: #111111;
    color: #ffffff;
}

/* ==========================================================================
   MEDIA QUERIES (Ajuste exacto al diseño original)
   ========================================================================== */
@media (max-width: 992px) {
    /* Proyectos */
    .db-projects-header {
        flex-direction: column;
        gap: 2rem;
        margin-bottom: 3rem;
    }

    /* Servicios */
    .db-services-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* About / Métricas - Efecto Overlap en Móvil */
    .db-about {
        padding: 4rem 1rem;
        justify-content: center;
    }

    .db-about-img {
        width: 100%;
        height: 100%;
    }

    .db-about-card {
        width: 92%;
        margin: 0 auto;
        padding: 2.5rem 1.5rem;
        border-radius: 4px;
    }
}

@media (max-width: 768px) {
    /* Reducción global de paddings */
    .db-projects-section,
    .db-testimonials,
    .db-services,
    .db-cta {
        padding: 4rem 0;
    }

    /* Hero */
    .db-hero {
        padding-bottom: 3rem;
        min-height: 70vh;
    }

    .db-hero-title {
        font-size: clamp(2rem, 8vw, 2.5rem);
    }

    /* Proyectos Grid Móvil */
    .db-projects-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    /* Testimonios */
    .db-test-quote {
        font-size: clamp(1.2rem, 5vw, 1.8rem);
    }

    /* Quiénes somos (Métricas en columna única) */
    .db-stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .db-stat-item {
        border: 1px solid #eaeaea;
        border-radius: 6px;
        padding: 1.2rem;
        text-align: center;
        border-top: 1px solid #eaeaea;
    }

    .db-stat-num {
        font-size: 1.5rem;
    }

    /* CTA */
    .db-cta-title {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   7. CONTACTO (FORMULARIO Y TEXTOS)
   ========================================================================== */
.db-contact-hero {
    background-color: #000b29; /* Azul marino profundo */
    color: #ffffff;
    padding: 8rem 0;
    width: 100%;
}

.db-contact-grid {
    max-width: 1200px;
    width: 90%; 
    margin: 0 auto;
    display: grid;
    grid-template-columns: 4fr 5fr;
    gap: 8rem;
    align-items: start;
}

.db-contact-massive-title {
    font-size: clamp(3.5rem, 6vw, 5rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #ffffff;
    letter-spacing: -2px;
}

.db-contact-desc {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 3rem;
}

/* Nueva Info de Contacto y Redes */
.db-contact-direct-info,
.db-contact-social {
    margin-bottom: 3rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.db-social-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.5px;
}

.db-social-links {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.db-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s ease, transform 0.3s ease;
    width: fit-content;
}

.db-contact-item svg {
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.db-contact-item:hover {
    color: #ffffff;
    transform: translateX(5px);
}

.db-contact-item:hover svg {
    transform: scale(1.1);
}

/* Nota: Los estilos del formulario los hereda automáticamente 
   el shortcode [dhema_form] en su "Modo Oscuro" */

/* ==========================================================================
   8. CONTACTO (BANNER PROYECTOS)
   ========================================================================== */
.db-contact-banner {
    position: relative;
    padding: 8rem 0;
    text-align: center;
    background-color: #000b29;
    width: 100%;
}

.db-banner-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; 
    background-position: center;
    z-index: 1;
}

.db-banner-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 11, 41, 0.7); 
    z-index: 2;
}

.db-banner-content {
    position: relative;
    z-index: 3;
    max-width: 1200px;
    width: 90%; 
    margin: 0 auto;
}

.db-banner-content h2 {
    font-size: clamp(2.5rem, 4vw, 4rem);
    color: #ffffff;
    margin-bottom: 2.5rem;
    letter-spacing: -1px;
}

.db-btn-outline-white {
    display: inline-block;
    padding: 1rem 3rem;
    border: 1px solid #ffffff;
    border-radius: 30px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
}

.db-btn-outline-white:hover {
    background: #ffffff;
    color: #000b29;
}

/* ==========================================================================
   MEDIA QUERIES PARA LOS NUEVOS BLOQUES DE CONTACTO
   ========================================================================== */
@media (max-width: 992px) {
    .db-contact-grid { gap: 4rem; }
}

@media (max-width: 768px) {
    .db-contact-grid { 
        grid-template-columns: 1fr; 
        gap: 3rem; 
    }
    /* Aumentamos el padding superior para librar el menú fijo, conservando el inferior ajustado */
    .db-contact-hero { padding: calc(var(--header-height, 80px) + 3rem) 0 4rem 0; }
    .db-contact-banner { padding: 5rem 0; }
}