/*
 * Free Diagnosis page — approved reference composition.
 *
 * These rules are opt-in via Elementor prefix classes added by
 * Free_Diagnosis_Page_Controls. Existing classic widget output remains intact.
 */

/* --------------------------------------------------------------------------
 * Actual Free Diagnosis hero: Contact Hero -> diagnosis template
 * -------------------------------------------------------------------------- */
.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference {
    position: relative;
    align-self: stretch;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference > .elementor-widget-container,
.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference .acw-contact-hero--diagnosis {
    width: 100%;
    max-width: none;
}

/*
 * The hero height and the media height are intentionally independent in the
 * approved diagnosis composition. The row may grow, while the image frame keeps
 * the responsive value from the widget's existing "diagnosis_image_height" control.
 */
.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference.acfd-contact-media-independent-yes .acw-contact-hero--diagnosis .acw-contact-hero__diagnosis-media {
    align-self: center !important;
    min-height: 0 !important;
}

.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference.acfd-contact-media-independent-yes .acw-contact-hero--diagnosis .acw-contact-hero__diagnosis-media-frame {
    flex: 0 0 auto;
    width: 100%;
    height: var(--acw-dh-media-height, 390px);
    min-height: 0 !important;
}

.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference.acfd-contact-media-independent-yes .acw-contact-hero--diagnosis .acw-contact-hero__diagnosis-image {
    height: 100%;
    min-height: 0 !important;
}

/* Optional, explicit under-header mode for this exact hero. */
.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference.acfd-contact-under-header-yes .acw-contact-hero--diagnosis {
    margin-top: calc(-1 * var(--acfd-contact-header-overlap, 0px));
}

.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference.acfd-contact-under-header-yes .acw-contact-hero--diagnosis .acw-contact-hero__diagnosis-inner {
    padding-block-start: calc(
        var(--acfd-contact-reference-top-padding, 42px) +
        var(--acfd-contact-header-safe, 0px)
    ) !important;
}

/* Prevent sub-pixel full-bleed rounding from creating a horizontal scrollbar. */
body:has(.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference) {
    overflow-x: hidden;
}

@supports (overflow: clip) {
    body:has(.elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference) {
        overflow-x: clip;
    }
}

/* --------------------------------------------------------------------------
 * Legacy Doctor Hero reference support
 * -------------------------------------------------------------------------- */
.elementor-widget-aliclick_doctor_hero.acfd-hero-template-reference {
    position: relative;
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.elementor-widget-aliclick_doctor_hero.acfd-hero-template-reference .acdh-hero {
    width: 100%;
    max-width: 100%;
}

/* The wrapper already performs the full-viewport breakout in reference mode. */
.elementor-widget-aliclick_doctor_hero.acfd-hero-template-reference .acdh-hero.acdh-horizontal-bleed {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

/* --------------------------------------------------------------------------
 * Diagnosis cards + privacy strip
 * -------------------------------------------------------------------------- */
.acfd-forms-template-reference {
    --acfd-diagnosis-rail-width: 650px;
    --acfd-diagnosis-image-height: 158px;
    --acfd-diagnosis-card-gap: 22px;
    --acfd-diagnosis-privacy-gap: 30px;
}

.acfd-forms-template-reference .acw-diagnosis-forms {
    width: 100%;
    padding: 42px 28px 30px;
    border: 0;
    border-radius: 22px;
    background: #ffffff;
    box-shadow: none;
    overflow: visible;
}

.acfd-forms-template-reference .acw-diagnosis-forms__inner {
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
}

.acfd-forms-template-reference .acw-diagnosis-forms__title {
    display: block;
    width: min(100%, var(--acfd-diagnosis-rail-width));
    margin-block: 0 30px;
    margin-inline-start: 0;
    margin-inline-end: auto;
    padding-bottom: 12px;
    color: #111827;
    font-size: clamp(27px, 2.15vw, 36px);
    font-weight: 800;
    line-height: 1.45;
    text-align: start;
}

.acfd-forms-template-reference .acw-diagnosis-forms__title::after {
    inset-inline-start: 0;
    inset-inline-end: auto;
    width: 40px;
    height: 3px;
    background: #2f70df;
    transform: none;
}

.acfd-forms-template-reference .acw-diagnosis-forms__grid {
    width: min(100%, var(--acfd-diagnosis-rail-width));
    margin-inline-start: 0;
    margin-inline-end: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: var(--acfd-diagnosis-card-gap);
    row-gap: var(--acfd-diagnosis-card-gap);
}

/* Logical alignment remains correct in both Arabic/RTL and English/LTR. */
.acfd-forms-template-reference.acfd-forms-align-center .acw-diagnosis-forms__title,
.acfd-forms-template-reference.acfd-forms-align-center .acw-diagnosis-forms__grid {
    margin-inline-start: auto;
    margin-inline-end: auto;
}

.acfd-forms-template-reference.acfd-forms-align-end .acw-diagnosis-forms__title,
.acfd-forms-template-reference.acfd-forms-align-end .acw-diagnosis-forms__grid {
    margin-inline-start: auto;
    margin-inline-end: 0;
}

.acfd-forms-template-reference .acw-diagnosis-forms__card {
    min-width: 0;
    border: 1px solid #dfe6ef;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(39, 66, 103, .055);
    overflow: hidden;
    transform: none;
}

.acfd-forms-template-reference .acw-diagnosis-forms__card:hover {
    border-color: #bfd2ef;
    box-shadow: 0 13px 30px rgba(39, 66, 103, .09);
    transform: translateY(-2px);
}

.acfd-forms-template-reference .acw-diagnosis-forms__image-wrap {
    height: var(--acfd-diagnosis-image-height);
    background: #eef3f9;
}

.acfd-forms-template-reference .acw-diagnosis-forms__image {
    object-fit: cover;
    object-position: center;
}

.acfd-forms-template-reference .acw-diagnosis-forms__card-body {
    align-items: stretch;
    min-height: 182px;
    padding: 17px 16px 15px;
    text-align: center;
}

.acfd-forms-template-reference .acw-diagnosis-forms__card-title {
    margin: 0 0 7px;
    color: #1d2738;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.65;
}

.acfd-forms-template-reference .acw-diagnosis-forms__card-description {
    min-height: 48px;
    margin-bottom: 15px;
    color: #788398;
    font-size: 12.5px;
    line-height: 1.9;
}

.acfd-forms-template-reference .acw-diagnosis-forms__button {
    min-height: 40px;
    margin-top: auto;
    padding: 8px 14px;
    border: 1px solid #89b5fa;
    border-radius: 8px;
    color: #276bda;
    background: #fff;
    font-size: 13.5px;
    font-weight: 800;
}

.acfd-forms-template-reference .acw-diagnosis-forms__button:hover,
.acfd-forms-template-reference .acw-diagnosis-forms__button:focus-visible {
    border-color: #276bda;
    color: #fff;
    background: #276bda;
}

.acfd-forms-template-reference .acw-diagnosis-forms__privacy {
    width: 100%;
    max-width: 100%;
    min-height: 96px;
    margin: var(--acfd-diagnosis-privacy-gap) auto 0;
    padding: 16px 28px;
    border: 1px solid #d7e5f8;
    border-radius: 12px;
    background: #eaf3ff;
    box-shadow: none;
    text-align: center;
}

.acfd-forms-template-reference .acw-diagnosis-forms__privacy-icon {
    color: #2b70df;
    font-size: 58px;
}

.acfd-forms-template-reference .acw-diagnosis-forms__privacy-title {
    margin-bottom: 3px;
    color: #286bd8;
    font-size: 17px;
    font-weight: 800;
}

.acfd-forms-template-reference .acw-diagnosis-forms__privacy-description {
    color: #66758b;
    font-size: 13px;
    line-height: 1.85;
}

/* --------------------------------------------------------------------------
 * Benefits
 * -------------------------------------------------------------------------- */
.acfd-benefits-template-reference {
    --acfd-benefit-card-min-height: 108px;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits {
    width: 100%;
    padding: 30px 24px 32px;
    border: 0;
    border-radius: 20px;
    background: #f5f9fe;
    box-shadow: none;
    overflow: hidden;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__inner {
    width: 100%;
    max-width: 1320px;
    margin-inline: auto;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__title {
    display: block;
    width: 100%;
    margin: 0 0 28px;
    padding-bottom: 11px;
    color: #111827;
    font-size: clamp(25px, 2vw, 33px);
    font-weight: 800;
    line-height: 1.5;
    text-align: start;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__title::after {
    inset-inline-start: 0;
    inset-inline-end: auto;
    width: 44px;
    height: 3px;
    background: #2f70df;
    transform: none;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 26px;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__card {
    min-height: var(--acfd-benefit-card-min-height);
    padding: 18px 22px;
    border: 1px solid #e6edf6;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(39, 66, 103, .05);
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__card:hover {
    border-color: #cbdcf2;
    box-shadow: 0 12px 28px rgba(39, 66, 103, .08);
    transform: translateY(-2px);
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__card-inner {
    width: 100%;
    min-height: calc(var(--acfd-benefit-card-min-height) - 36px);
    justify-content: flex-start;
    gap: 16px;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__icon {
    color: #2f70df;
    font-size: 24px;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__content {
    flex: 1 1 auto;
    min-width: 0;
    text-align: center;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__card-title {
    margin-bottom: 5px;
    color: #202838;
    font-size: 15px;
    font-weight: 800;
}

.acfd-benefits-template-reference .acw-diagnosis-benefits__description {
    color: #748095;
    font-size: 12.5px;
    line-height: 1.85;
}

@media (max-width: 1024px) {
    .acfd-forms-template-reference .acw-diagnosis-forms {
        padding-inline: 22px;
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__title,
    .acfd-forms-template-reference .acw-diagnosis-forms__grid {
        width: min(100%, var(--acfd-diagnosis-rail-width));
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits__grid {
        gap: 16px;
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits__card {
        padding: 17px 15px;
    }
}

@media (max-width: 767px) {
    .elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference,
    .elementor-widget-aliclick_doctor_hero.acfd-hero-template-reference {
        width: 100vw;
        max-width: 100vw;
    }

    .elementor-widget-aliclick_contact_hero.acfd-contact-hero-template-reference.acfd-contact-media-independent-yes .acw-contact-hero--diagnosis .acw-contact-hero__diagnosis-media {
        width: 100%;
        align-self: stretch !important;
    }

    .acfd-forms-template-reference .acw-diagnosis-forms {
        padding: 28px 14px 22px;
        border-radius: 16px;
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__title {
        width: 100%;
        margin-bottom: 24px;
        font-size: clamp(24px, 7vw, 31px);
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__grid {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) !important;
        gap: var(--acfd-diagnosis-card-gap);
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__card {
        display: flex;
        flex-direction: column;
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__image-wrap {
        height: var(--acfd-diagnosis-image-height);
        min-height: 0;
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__card-body {
        min-height: 0;
        padding: 15px;
        text-align: center;
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__privacy {
        flex-direction: column;
        gap: 10px;
        min-height: 0;
        margin-top: var(--acfd-diagnosis-privacy-gap);
        padding: 18px 15px;
    }

    .acfd-forms-template-reference .acw-diagnosis-forms__privacy-icon {
        font-size: 50px;
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits {
        padding: 24px 14px;
        border-radius: 16px;
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits__title {
        margin-bottom: 22px;
        font-size: clamp(23px, 7vw, 30px);
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits__grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 14px;
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits__card {
        min-height: var(--acfd-benefit-card-min-height);
        padding: 15px 16px;
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits__card-inner {
        min-height: calc(var(--acfd-benefit-card-min-height) - 30px);
        justify-content: flex-start;
    }

    .acfd-benefits-template-reference .acw-diagnosis-benefits__content {
        text-align: start;
    }
}
