/* ==========================================================================
   1. GRILLA DE BLOG (HOMEPAGE)
   ========================================================================== */
.dr-castro-blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    max-width: 1050px;
    margin: 0 auto;
}

.dr-blog-card {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.dr-blog-card-media {
    flex: 1;
    min-height: 185px;
    border-radius: 16px;
    overflow: hidden;
}

.dr-blog-card-media img {
    width: 100%;
    height: 100%;
    min-height: 185px;
    display: block;
    object-fit: cover;
}

.dr-blog-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 9px;
}

.dr-blog-card-text {
    background-color: #20334e;
    color: #ffffff;
    padding: 18px;
    border-radius: 16px;
    flex-grow: 1;
}

.dr-blog-card-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
}

.dr-blog-card-title a {
    color: #ffffff !important;
    text-decoration: none;
}

.dr-blog-card-excerpt {
    margin: 0;
    font-size: 0.8rem;
    color: #cfd8e3;
    line-height: 1.4;
}

.dr-blog-card-button {
    display: flex;
    align-items: center;
    text-decoration: none !important;
    border-radius: 11px;
    overflow: hidden;
}

.dr-blog-card-button .btn-text {
    background-color: #20334e;
    color: #ffffff;
    padding: 9px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    flex-grow: 1;
}

.dr-blog-card-button .btn-icon {
    background-color: #6495ed;
    color: #ffffff;
    padding: 14px 14px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ==========================================================================
   2. CARRUSEL DE TESTIMONIOS (REPLICANDO LA IMAGEN)
   ========================================================================== */
.dr-testimonios-section {
    margin: 60px auto;
}

.dr-testimonios-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.dr-testimonios-title {
    font-size: 4.8rem;
    color: #172b4d;
    margin: 0;
    font-family: "Helvetica", Sans-serif;
    line-height: 3.8rem;
}

/* Botones de navegación superior derecho */
.dr-swiper-navigation {
    display: flex;
    gap: 10px;
}

.dr-swiper-button-prev,
.dr-swiper-button-next {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 0;
}

.dr-swiper-button-prev {
    background-color: #eaf0f8;
    color: #3b506e;
}

.dr-swiper-button-next {
    background-color: #6495ed;
    color: #ffffff;
}

.dr-swiper-button-prev:hover { background-color: #dbe4f3; }
.dr-swiper-button-next:hover { background-color: #4f82e0; }

/* Tarjetas */
.dr-testimonios-swiper .swiper-slide {
    height: auto; /* Para que todas las tarjetas tengan el mismo alto */
}

.dr-testimonio-card {
    border: 1px solid #172b4d;
    border-radius: 36px;
    padding: 36px 28px 28px 28px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    box-sizing: border-box;
}

/* Primera tarjeta / Tarjeta destacada con fondo azul ténue */
.dr-testimonios-swiper .swiper-slide-active .dr-testimonio-card {
    background-color: #edf2fc;
    border-color: transparent;
}

.dr-testimonio-text p {
    color: #61718a;
    font-size: 0.95rem;
    line-height: 1.5;
    margin: 0 0 24px 0;
}

/* Pastilla de Autor */
.dr-testimonio-author {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #ffffff;
    padding: 6px 18px 6px 6px;
    border-radius: 12px;
    width: fit-content;
    margin-bottom: 24px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.dr-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
}

.dr-author-info {
    display: flex;
    flex-direction: column;
}

.dr-author-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #172b4d;
    line-height: 1.2;
}

.dr-author-spec {
    font-size: 0.75rem;
    color: #7d8ea5;
    font-style: italic;
}

/* Botones inferiores de la tarjeta */
.dr-testimonio-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dr-btn-modal {
    background: none;
    border: none;
    padding: 0;
    color: #6495ed;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.dr-btn-modal:hover {
    color: #20334e;
    text-decoration: underline;
}


/* ==========================================================================
   3. POPUP / MODAL
   ========================================================================== */
.dr-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999999;
}

.dr-modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.dr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.dr-modal-content {
    position: relative;
    background: #ffffff;
    width: 90%;
    max-width: 650px;
    padding: 36px;
    border-radius: 28px;
    z-index: 2;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.dr-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dr-modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.dr-modal-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.dr-modal-header h4 {
    margin: 0;
    font-size: 1.2rem;
    color: #172b4d;
    font-weight: 700;
}

.dr-modal-header span {
    font-size: 0.85rem;
    color: #64748b;
    font-style: italic;
}

.dr-modal-body {
    font-size: 1rem;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 20px;
}

.dr-modal-video {
    margin-top: 15px;
}

.dr-modal-video iframe,
.dr-modal-video video {
    width: 100%;
    height: 330px;
    border-radius: 16px;
}


/* ========================================================================== 
   4. SERVICIOS
   ========================================================================== */
.dr-services {
    --dr-navy: #183a5b;
    --dr-blue: #315b86;
    --dr-pale: #edf3ff;
    margin: 0;
    color: var(--dr-navy);
    overflow: hidden;
    isolation: isolate;
    font-family: "Helvetica", Sans-serif;
    line-height: normal;
}

/* Reset local: protege el componente de estilos globales del tema/Elementor. */
.dr-services,
.dr-services *,
.dr-services *::before,
.dr-services *::after {
    box-sizing: border-box;
}

.dr-services [hidden] {
    display: none !important;
}

.dr-services button.dr-service-tab,
.dr-services button.dr-subservice-tab,
.dr-services button.dr-service-next,
.dr-services button.dr-gallery-prev,
.dr-services button.dr-gallery-next,
.dr-services button.dr-video-button,
.dr-services button.dr-service-video-overlay,
.dr-services button.dr-service-video-close {
    min-width: 0;
    min-height: 0;
    margin: 0;
    font-family: inherit;
    text-align: center;
    text-decoration: none;
    text-transform: none;
    letter-spacing: normal;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

.dr-services button:focus-visible {
    outline: 3px solid #79a8f5;
    outline-offset: 3px;
}

.dr-services img {
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
}

.dr-services .dr-service-description > :first-child,
.dr-services .dr-subservice-copy > :first-child,
.dr-services .dr-subservice-copy > div > :first-child {
    margin-top: 0;
}

.dr-services .dr-service-description > :last-child,
.dr-services .dr-subservice-copy > :last-child,
.dr-services .dr-subservice-copy > div > :last-child {
    margin-bottom: 0;
}

.dr-services .dr-service-description p{
    text-align: justify;
    font-size: 17px;
    line-height: 20px;
}

.dr-services .dr-service-description ul li{
    color: white;
}

.dr-services-title {
    max-width: 1200px;
    margin: 0 auto 30px;
    font-size: clamp(2.2rem, 5vw, 4.8rem);
    line-height: 1;
}

.dr-services-hero {
    background: transparent;
}

.dr-services-tabs-shell,
.dr-subservices-tabs-shell {
    display: flex;
    align-items: center;
    gap: 12px;
    width: calc(100% - 64px);
    margin: 0 auto;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.75);
    border-radius: 32px;
    box-sizing: border-box;
}

.dr-services-tabs-shell {
    position: relative;
    top: 10px;
    z-index: 3;
    border-color: #ffffff6e;
    background: #ffffff59;
}

.dr-tabs-mark {
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 8px solid #fff;
    border-radius: 50%;
    box-sizing: border-box;
    background: var(--dr-blue);
    color: #fff;
    font-size: 8px;
}

.dr-services-tabs,
.dr-subservices-tabs {
    display: flex;
    flex: 1;
    gap: 4px;
    overflow-x: auto;
    padding: 0;
    scrollbar-width: thin;
}

.dr-services button.dr-service-tab,
.dr-services button.dr-subservice-tab {
    flex: 0 0 auto;
    border: 0;
    border-radius: 24px !important;
    background: #ffffff0d;
    color: #ffffffa6;
    cursor: pointer;
    font-weight: 500;
    padding: 9px 24px;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.dr-services button.dr-subservice-tab {
    background: #1f527f17;
    color: #1f527f;
}

.dr-services button.dr-service-tab:hover,
.dr-services button.dr-service-tab.is-active,
.dr-services button.dr-subservice-tab:hover,
.dr-services button.dr-subservice-tab.is-active {
    background: #fff;
    color: var(--dr-navy);
}

.dr-service-panel {
    position: relative;
    padding-top: 38px;
    background: transparent;
}

.dr-service-hero-content {
    display: grid;
    grid-template-columns: minmax(280px, .85fr) minmax(0, 1.15fr) 52px;
    gap: clamp(28px, 5vw, 90px);
    align-items: center;
    max-width: 999px;
    min-height: 400px;
    margin: 0 auto;
    padding: 0px 30px 62px;
    box-sizing: content-box;
}

.dr-service-image img {
    display: block;
    width: 100%;
    border-radius: 18px !important;
    object-fit: cover;
}

.dr-service-description h3,
.dr-subservice-copy h4 {
    margin-top: 0;
}

.dr-service-description h3 {
    color: white;
    font-size: 38px;
    line-height: 41px;
    font-weight: bold;
    font-family: "Helvetica", Sans-serif;
}

.dr-service-description {
    max-height: max(220px, var(--dr-service-image-height, 40vh));
    padding-right: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .75) rgba(255, 255, 255, .15);
    color: white;
    font-size: 1rem;
    line-height: 1.3;
}

.dr-service-description::-webkit-scrollbar {
    width: 8px;
}

.dr-service-description::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(255, 255, 255, .15);
}

.dr-service-description::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(255, 255, 255, .75);
    background-clip: padding-box;
}

.dr-service-description::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, .95);
    background-clip: padding-box;
}

.dr-services button.dr-service-next,
.dr-services button.dr-gallery-prev,
.dr-services button.dr-gallery-next {
    display: grid;
    width: 35px;
    height: 45px;
    padding: 0;
    place-items: center;
    border: 0px solid currentColor;
    border-radius: 9px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.dr-services button.dr-service-next {
    color: white;
    border: solid 1px #ffffff4a;
}

.dr-service-subtitle {
    margin: 0 0 22px;
    color: var(--dr-navy);
    font-size: clamp(2.3rem, 4vw, 3.3rem);
    font-weight: 700;
    line-height: 1;
}

.dr-subservices {
    position: relative;
    background: var(--dr-pale);
    padding: 0 0 54px;
}

.dr-subservices-tabs-shell {
    position: relative;
    z-index: 2;
    top: -27px;
    border-color: var(--dr-blue);
    background: var(--dr-pale);
    color: #617e9f;
}

.dr-services button.dr-subservice-tab.is-active,
.dr-services button.dr-subservice-tab:hover {
    background: #1f527f;
    color: #fff;
}

.dr-subservice-panel {
    max-width: 990px;
    margin: 0 auto;
    padding: 10px 32px 0;
}

.dr-subservice-copy {
    display: grid;
    grid-template-columns: minmax(250px, .7fr) minmax(0, 1.5fr);
    gap: 50px;
    align-items: start;
    color: var(--dr-navy);
    line-height: 1.35;
}

.dr-subservice-copy h4 {
    font-family: "Helvetica", Sans-serif;
    max-width: 320px;
    font-size: 38px;
    margin-bottom: 10px;
    line-height: 40px;
}

.dr-subservice-copy p {
    margin: 0;
    font-size: 17px;
    line-height: 20px;
}

.dr-gallery-wrap {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
    margin-top: 50px;
}

.dr-gallery-navigation {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    margin: auto 0 0;
    padding: 0;
}

.dr-gallery-tools {
    display: flex;
    width: 170px;
    height: 335px;
    min-height: 335px;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    margin: 0;
    padding: 0;
}

.dr-services button.dr-video-button {
    display: inline-flex;
    width: 100%;
    min-height: 45px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    border: 1px solid #6495ed;
    border-radius: 14px;
    background: transparent;
    color: #6495ed;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 18px;
}

.dr-services button.dr-video-button:hover {
    background: #6495ed;
    color: #fff;
}

.dr-services button.dr-gallery-prev,
.dr-services button.dr-gallery-next {
    color: var(--dr-blue);
    background: #fff;
}

.dr-services button.dr-gallery-next {
    background: #6495ed;
    color: #fff;
}

.dr-subservice-gallery {
    display: flex;
    width: 100%;
    height: 335px;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.dr-subservice-gallery::-webkit-scrollbar { display: none; }

.dr-subservice-gallery img {
    flex: 0 0 clamp(235px, 30%, 275px);
    display: block;
    width: clamp(235px, 30%, 275px);
    min-width: 0;
    height: 335px;
    border-radius: 16px !important;
    object-fit: cover;
    scroll-snap-align: start;
}

.dr-service-video-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.dr-service-video-modal.is-active { display: flex; }

.dr-services button.dr-service-video-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(8, 23, 39, .82);
    cursor: pointer;
}

.dr-service-video-dialog {
    position: relative;
    z-index: 1;
    width: min(960px, 94vw);
    border-radius: 18px;
    background: #071625;
    box-shadow: 0 24px 70px rgba(0,0,0,.4);
}

.dr-services button.dr-service-video-close {
    position: absolute;
    z-index: 2;
    top: -16px;
    right: -16px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--dr-navy);
    cursor: pointer;
    font-size: 1.8rem;
}

.dr-service-video-frame {
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 18px;
}

.dr-service-video-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

/* ========================================================================== 
   5. CARRUSEL DE YOUTUBE SHORTS
   ========================================================================== */
.dr-youtube-shorts {
    --dr-shorts-blue: #315b86;
    width: 100%;
    margin: 50px auto;
    color: #183a5b;
    isolation: isolate;
}

.dr-youtube-shorts,
.dr-youtube-shorts *,
.dr-youtube-shorts *::before,
.dr-youtube-shorts *::after { box-sizing: border-box; }

.dr-youtube-shorts-title {
    margin: 0 0 28px;
    color: #183a5b;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.05;
}

.dr-youtube-shorts-layout {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 18px;
    align-items: end;
}

.dr-youtube-shorts-controls {
    display: grid;
    gap: 8px;
}

.dr-youtube-shorts button.dr-youtube-shorts-prev,
.dr-youtube-shorts button.dr-youtube-shorts-next {
    display: grid;
    width: 35px;
    height: 45px;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    place-items: center;
    border: 0px solid var(--dr-shorts-blue);
    border-radius: 9px;
    background: #fff;
    color: var(--dr-shorts-blue);
    box-shadow: none;
    cursor: pointer;
    font: inherit;
    font-size: 2rem;
    line-height: 1;
    appearance: none;
}

.dr-youtube-shorts button.dr-youtube-shorts-next {
    background: #6495ed;
    color: #fff;
}

.dr-youtube-shorts-track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.dr-youtube-shorts-track::-webkit-scrollbar { display: none; }

.dr-youtube-short {
    flex: 0 0 clamp(230px, 20vw, 330px);
    overflow: hidden;
    aspect-ratio: 9 / 16;
    margin: 0;
    border-radius: 18px;
    background: #0b1725;
    scroll-snap-align: start;
}

.dr-youtube-short iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.dr-youtube-shorts button.dr-youtube-short-play {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: #0b1725;
    box-shadow: none;
    cursor: pointer;
    appearance: none;
}

.dr-youtube-shorts button.dr-youtube-short-play img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
}

.dr-youtube-shorts button.dr-youtube-short-play span {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    padding-left: 4px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255,255,255,.92);
    color: #315b86;
    font-size: 1.5rem;
    transition: transform .2s ease, background-color .2s ease;
}

.dr-youtube-shorts button.dr-youtube-short-play:hover span {
    transform: translate(-50%, -50%) scale(1.08);
    background: #fff;
}

/* ========================================================================== 
   6. RESPONSIVE
   ========================================================================== */
@media (max-width: 768px) {
    .dr-castro-blog-grid {
        grid-template-columns: 1fr;
    }
    
    .dr-blog-card {
        flex-direction: column;
    }
    
    .dr-testimonios-title {
        font-size: 2.5rem;
    }
    
    .dr-modal-content {
        padding: 24px;
    }

    .dr-services-tabs-shell,
    .dr-subservices-tabs-shell {
        width: calc(100% - 24px);
    }

    .dr-service-hero-content {
        grid-template-columns: 1fr;
        gap: 20px;
        min-height: 0;
        padding: 35px 20px 60px;
    }

    .dr-service-image img {
        height: min(420px, 75vw);
    }

    .dr-service-next {
        justify-self: end;
    }

    .dr-subservices {
        padding-bottom: 35px;
    }

    .dr-subservice-panel {
        padding: 0 20px;
    }

    .dr-subservice-copy {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .dr-gallery-wrap {
        grid-template-columns: 1fr;
        gap: 18px;
        margin-top: 28px;
    }

    .dr-gallery-navigation {
        display: flex;
        width: auto;
        margin: 0 0 0 auto;
    }

    .dr-gallery-tools {
        width: 100%;
        height: auto;
        min-height: 0;
        flex-direction: row;
        align-items: center;
        gap: 18px;
    }

    .dr-services button.dr-video-button {
        width: auto;
    }

    .dr-subservice-gallery {
        height: 360px;
    }

    .dr-subservice-gallery img {
        flex-basis: 82%;
        width: 82%;
        height: 360px;
    }

    .dr-youtube-shorts-layout {
        grid-template-columns: 1fr;
    }

    .dr-youtube-shorts-controls {
        display: flex;
        order: 2;
    }

    .dr-youtube-short {
        flex-basis: min(78vw, 300px);
    }
}
