/* HDM Discount Popup - redesign to match the approved mockup.
   Full-bleed banner (forms the rounded top edge), icon + heading + subtext row,
   image on the right, action area (buttons / form / success), trust footer.
   Colours: banner blue lives in the image; heading blue #2F61E3, green #37B44A,
   close-red #E0322B, pause-pink #FDE9E9, footer #EAF1FB. */

/* The [hidden] attribute drives the state machine and icon/banner swaps.
   Author display rules outrank the UA [hidden] rule, so force it. */
.hdm-dpop [hidden] {
    display: none !important;
}

.hdm-dpop {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Generous overlay margin so it is easy to tap outside to close. */
    padding: 44px 22px;
    background: rgba(11, 18, 32, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility .22s ease;
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

.hdm-dpop.is-open {
    opacity: 1;
    visibility: visible;
}

.hdm-dpop__backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
}

.hdm-dpop__shell {
    position: relative;
    width: 600px;
    max-width: 100%;
    margin: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(11, 18, 32, 0.4);
    transform: translateY(14px) scale(.985);
    transition: transform .24s ease;
}

.hdm-dpop.is-open .hdm-dpop__shell {
    transform: none;
}

/* Clear red close button, sitting outside the popup at the top-right corner */
.hdm-dpop__close {
    position: absolute;
    top: -20px;
    right: -16px;
    z-index: 6;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #E0322B;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
    padding: 0;
}

.hdm-dpop__close:hover {
    background: #c52a23;
}

/* Full-bleed banner -> clips to the popup's rounded top corners */
.hdm-dpop__banner {
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    overflow: hidden;
    line-height: 0;
    /* Tuck the white content slightly under the banner's bottom edge. */
    margin-bottom: -6px;
}

.hdm-dpop__banner-img {
    display: block;
    width: 100%;
    height: auto;
}

.hdm-dpop__banner-slot--mobile {
    display: none;
}

/* Content area */
.hdm-dpop__content {
    position: relative;
    background: #fff;
    padding: 16px 22px 14px;
}

/* Intro row: text left, image right. Bottom-aligned so the lady's cut-off
   sits on the separation line instead of floating mid-air. */
.hdm-dpop__intro {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.hdm-dpop__intro-text {
    flex: 1 1 56%;
    min-width: 0;
    /* keep text vertically centred while the image hugs the bottom line */
    align-self: center;
}

.hdm-dpop__intro-img {
    flex: 0 0 42%;
    align-self: flex-end;
    text-align: right;
    line-height: 0;
}

.hdm-dpop__feature {
    display: block;
    width: 178px;
    max-width: 100%;
    height: auto;
    margin: 0 0 0 auto;
}

/* Icon chip */
.hdm-dpop__icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-bottom: 10px;
}

/* Slide 1: brand-green gradient chip (matches header icons) + white icon */
.hdm-dpop__icon--tag {
    background: linear-gradient(135deg, #5BC56E 0%, #1F8E08 100%);
    color: #fff;
}

/* Slide 2: soft chip so the green-gradient envelope reads clearly */
.hdm-dpop__icon--mail {
    background: #E9F7EC;
}

.hdm-dpop__icon .hdm-dpop-svg {
    display: block;
}

/* Gear-bordered percent badge sits on the chip's top-right corner */
.hdm-dpop__icon-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    line-height: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Heading */
.hdm-dpop__heading {
    margin: 0;
    line-height: 1.15;
}

.hdm-dpop__heading-1,
.hdm-dpop__heading-2 {
    display: block;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: .2px;
}

.hdm-dpop__heading-1 {
    color: #11224A;
}

.hdm-dpop__heading-2 {
    color: #2F61E3;
}

.hdm-dpop__heading-2::after {
    content: "";
    display: block;
    width: 46px;
    height: 3px;
    border-radius: 3px;
    background: #37B44A;
    margin-top: 7px;
}

.hdm-dpop__sub {
    margin: 10px 0 0;
    font-size: 13.5px;
    line-height: 1.45;
    color: #5B6473;
}

/* Divider rule - no top gap so the lady's cut sits right on the line */
.hdm-dpop__rule {
    border-top: 1px dashed #D8DEE8;
    margin: 0 0 14px;
}

/* Buttons (shared) - uniform height, single line of text */
.hdm-dpop__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-sizing: border-box;
    min-height: 52px;
    border: none;
    border-radius: 9px;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
    padding: 12px 14px;
    font-size: 14px;
    letter-spacing: .3px;
    white-space: nowrap;
    transition: filter .15s ease, background .15s ease, transform .05s ease;
}

.hdm-dpop__btn:active {
    transform: translateY(1px);
}

.hdm-dpop__btn-ico {
    flex: 0 0 auto;
}

.hdm-dpop__btn--get,
.hdm-dpop__btn--submit {
    width: 100%;
    background: #37B44A;
    color: #fff;
    font-size: 15px;
    text-transform: uppercase;
}

.hdm-dpop__btn--get:hover,
.hdm-dpop__btn--submit:hover {
    background: #2e9e40;
}

.hdm-dpop__btn--close {
    background: #fff;
    color: #E0322B;
    border: 1.5px solid #F0B7B4;
    text-transform: uppercase;
}

.hdm-dpop__btn--close:hover {
    background: #FFF5F4;
}

.hdm-dpop__btn--pause {
    background: #FDE9E9;
    color: #E0322B;
    text-transform: uppercase;
}

.hdm-dpop__btn--pause:hover {
    background: #fbdcdc;
}

/* Action layout */
.hdm-dpop__step {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hdm-dpop__btn-row {
    display: flex;
    gap: 10px;
}

.hdm-dpop__btn-row .hdm-dpop__btn {
    flex: 1 1 50%;
    min-width: 0;
    padding: 12px 8px;
    font-size: 12.5px;
    letter-spacing: .2px;
    gap: 6px;
}

.hdm-dpop__btn-row .hdm-dpop__btn-ico {
    width: 15px;
    height: 15px;
}

/* Form */
.hdm-dpop__form {
    gap: 10px;
}

.hdm-dpop__field {
    position: relative;
    display: flex;
    align-items: center;
}

.hdm-dpop__field-ico {
    position: absolute;
    left: 14px;
    z-index: 2;
    color: #9AA4B2;
    pointer-events: none;
}

/* Force the left padding past the icon - the parent theme styles inputs and
   would otherwise override it, dropping the text on top of the icon. */
.hdm-dpop__input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 14px !important;
    padding-left: 44px !important;
    border: 1px solid #D8DEE8;
    border-radius: 9px;
    font-size: 14px;
    color: #181818;
    background: #fff;
    margin: 0;
}

.hdm-dpop__input:focus {
    outline: none;
    border-color: #2F61E3;
    box-shadow: 0 0 0 3px rgba(47, 97, 227, 0.15);
}

.hdm-dpop__input.has-error {
    border-color: #E0322B;
}

.hdm-dpop__hp {
    position: absolute;
    left: -9999px;
    height: 0;
    width: 0;
    opacity: 0;
}

.hdm-dpop__error {
    margin: 0;
    color: #E0322B;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
}

.hdm-dpop__btn--submit:disabled {
    opacity: .65;
    cursor: default;
}

/* Success */
.hdm-dpop__success {
    align-items: center;
    text-align: center;
}

.hdm-dpop__check {
    color: #37B44A;
    line-height: 0;
}

.hdm-dpop__success-title {
    margin: 4px 0 6px;
    font-size: 20px;
    font-weight: 800;
    color: #11224A;
}

.hdm-dpop__success-body {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #5B6473;
}

.hdm-dpop__code {
    display: inline-block;
    border: 2px dashed #37B44A;
    background: #F4FBF5;
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: .05em;
    color: #11224A;
}

.hdm-dpop__success-note {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: #5B6473;
}

/* Footer reviews - centered group with breathing room at the sides */
.hdm-dpop__reviews {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: #EAF1FB;
    padding: 14px 22px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
}

.hdm-dpop__reviews-shield {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #2F61E3;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hdm-dpop__reviews-text {
    flex: 0 1 auto;
    font-size: 14px;
    font-weight: 700;
    color: #11224A;
    line-height: 1.25;
}

.hdm-dpop__reviews-badge {
    flex: 0 0 auto;
    line-height: 0;
}

.hdm-dpop__reviews-img {
    width: 118px;
    max-width: 100%;
    height: auto;
}

/* Body scroll lock */
body.hdm-dpop-open {
    overflow: hidden;
}

/* ----------------------------- Mobile ----------------------------- */
@media (max-width: 768px) {
    .hdm-dpop {
        /* Keep clear space on every side for easy tap-to-close. */
        padding: 40px 16px;
        align-items: center;
    }

    .hdm-dpop__banner-slot--desktop {
        display: none;
    }

    .hdm-dpop__banner-slot--mobile {
        display: block;
    }

    .hdm-dpop__close {
        top: -18px;
        right: -8px;
    }

    .hdm-dpop__heading-1,
    .hdm-dpop__heading-2 {
        font-size: 17px;
        letter-spacing: 0;
    }

    /* Give the heading room so "ON THIS PRODUCT" stays on one line */
    .hdm-dpop__intro-text {
        flex: 1 1 60%;
    }

    .hdm-dpop__intro-img {
        flex: 0 0 40%;
    }

    .hdm-dpop__feature {
        width: 124px;
    }

    .hdm-dpop__icon {
        width: 42px;
        height: 42px;
        margin-bottom: 8px;
    }

    .hdm-dpop__content {
        padding: 14px 16px 12px;
    }

    .hdm-dpop__sub {
        font-size: 12.5px;
    }

    .hdm-dpop__reviews {
        padding: 12px 14px;
        gap: 8px;
    }

    .hdm-dpop__reviews-text {
        font-size: 12.5px;
    }

    .hdm-dpop__reviews-img {
        width: 96px;
    }
}

/* Very narrow phones - let the intro stack so nothing crowds */
@media (max-width: 380px) {
    .hdm-dpop__intro {
        gap: 8px;
    }
    .hdm-dpop__intro-img {
        flex-basis: 34%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hdm-dpop,
    .hdm-dpop__shell {
        transition: none;
    }
}
