/* Respect Divi's original desktop composition. Fix only compact layouts. */
#main-content :is(.et_pb_column, .et_pb_module) { min-width: 0; }
#main-content :is(p, li, h1, h2, h3, h4, h5, h6) { overflow-wrap: break-word; }
#main-content :is(img, iframe, video, input, textarea, select) { max-width: 100%; }
#main-content .et_pb_button { max-width: 100%; white-space: normal; }
#main-content a:focus-visible, #main-header [role="button"]:focus-visible {
    outline: 3px solid #005450; outline-offset: 4px;
}

@media (min-width: 981px) {
    /* The photo extends 10vw into the row. Reserve that space for every text block. */
    body.home #main-content :is(.et_pb_row_9, .et_pb_row_10) > .et_pb_column:first-child {
        box-sizing: border-box;
        padding-right: max(0px, calc(10vw - 24px)) !important;
    }
}

@media (max-width: 980px) {
    /* Use Divi's existing stacked hero, retaining its shapes and typography. */
    body.home #main-content .et_pb_image_0 { max-width: 420px; margin-inline: auto !important; }
    body.home #main-content .et_pb_image_0 .et_pb_image_wrap { box-shadow: 24px 24px 48px rgba(66, 66, 66, .18); }
    body.home #main-content .et_pb_image_0.et_animated { animation: none !important; opacity: 1 !important; transform: none !important; }

    /* Keep each detail panel beside its service when Divi wraps the columns. */
    body.home #main-content .et_pb_row_6 .et_pb_toggle { margin: 20px 0 0 !important; text-align: left; }
    body.home #main-content .et_pb_row_7.lorena-toggles-moved { display: none; }

    /* Negative desktop margins and sticky positioning cannot follow a stacked row. */
    body.home #main-content .et_pb_row_10 { display: block; }
    body.home #main-content :is(.et_pb_image_8, .et_pb_image_9) {
        position: relative !important; inset: auto !important;
        width: 100% !important; max-width: 100% !important;
        margin: 0 !important; transform: none !important;
    }
    body.home #main-content :is(.et_pb_image_8, .et_pb_image_9) .et_pb_image_wrap { display: block; width: 100%; }
    body.home #main-content :is(.et_pb_image_8, .et_pb_image_9) img { width: 100%; height: auto; display: block; }

    /* Reserve space for arrows within the existing testimonial block. */
    body.home #main-content .et_pb_row_11 { width: 90% !important; }
    body.home #main-content .et_pb_slider_0 .et_pb_slide { padding-inline: 30px; }
    body.home #main-content .et_pb_slider_0 .et_pb_slide_description { padding-inline: 0 !important; }
    body.home #main-content .et_pb_slider_0 .et-pb-arrow-prev { left: 0 !important; }
    body.home #main-content .et_pb_slider_0 .et-pb-arrow-next { right: 0 !important; }

    /* Retain the native header height, logo size and menu breakpoint. */
    #main-header .et_mobile_menu { max-height: calc(100dvh - 100px); overflow-y: auto; }
    #main-header .et_mobile_menu li a { min-height: 44px; }
    #main-content :is(input, textarea, select) { font-size: 16px; box-sizing: border-box; }
    body.home #main-content .et_pb_section_9 .et_pb_blurb_description { overflow-wrap: anywhere; }
}

@media (min-width: 981px) and (max-width: 1200px) {
    /* Keep the original split layout; constrain only the two overflowing images. */
    body.home #main-content :is(.et_pb_image_8, .et_pb_image_9) { margin-right: 0 !important; }
}

@media (max-width: 600px) {
    body.home #main-content .et_pb_button_0 { padding-inline: 18px !important; }
    body.home #main-content .et_pb_section_9 .et_pb_blurb_description { font-size: 14px; }
    .lorena-whatsapp {
        right: max(12px, env(safe-area-inset-right));
        bottom: max(12px, env(safe-area-inset-bottom));
        width: 48px; height: 48px; min-height: 48px; padding: 0;
        display: flex; justify-content: center; align-items: center;
    }
    .lorena-whatsapp span { display: none; }
    .lorena-whatsapp svg { width: 24px; height: 24px; flex-shrink: 0; }
    #footer-bottom { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
    body.page-id-133 #lc-servicios :is(.lc-button, .lc-nav a) { max-width: 100%; white-space: normal; }
}

@media (prefers-reduced-motion: reduce) {
    body.home #main-content .et_animated { animation: none !important; opacity: 1 !important; transform: none !important; }
    body.home #main-content .et_pb_slide_description { animation: none !important; }
}
