/*
 * Deedpoll shared layout + responsive compatibility layer.
 * Keeps visual section backgrounds full width while standardising the inner
 * content grid to the same 1400px maximum used by the site header.
 * Loaded after individual widget styles so existing Elementor pages also
 * receive the corrected grid and breakpoint behaviour.
 */

:root {
    --deedpoll-site-content-width: 1400px;
    --deedpoll-site-gutter-desktop: 20px;
    --deedpoll-site-gutter-tablet: 16px;
    --deedpoll-site-gutter-mobile: 14px;
}

/* Never let an Elementor Deedpoll widget itself create page-level overflow. */
[class*="elementor-widget-deedpoll_"] {
    min-width: 0;
    max-width: 100%;
}

[class*="elementor-widget-deedpoll_"] > .elementor-widget-container {
    min-width: 0;
    max-width: 100%;
}

/*
 * Elementor renders Font Awesome icons as SVG on newer installs. Some theme/
 * Elementor global SVG rules can otherwise leave the SVG path dark even when
 * the Deedpoll icon container is set to white. Make every Elementor icon in
 * this plugin inherit its own widget/container colour. This preserves dark
 * icons on light backgrounds and guarantees white icons on navy/blue circles.
 */
[class*="elementor-widget-deedpoll_"] [class*="icon"] .e-font-icon-svg,
[class*="deedpoll-"][class*="icon"] .e-font-icon-svg,
[class*="dp-"][class*="icon"] .e-font-icon-svg {
    color: inherit !important;
    fill: currentColor !important;
}

/*
 * Shared inner grid. Only inner content wrappers are listed here; section
 * roots/background layers are intentionally untouched.
 */
.deedpoll-trustbar__inner,
.deedpoll-header__inner,
.deedpoll-ai-hero__inner,
.deedpoll-pricing__inner,
.deedpoll-application-process__inner,
.deedpoll-assurance__container,
.deedpoll-assurance__grid,
.deedpoll-audience__inner,
.deedpoll-behind-scenes__inner,
.deedpoll-better-way-focus__inner,
.deedpoll-better-way__inner,
.deedpoll-category-browser__inner,
.dp-commonq__inner,
.deedpoll-contact-help__inner,
.dp-contact-support__inner,
.deedpoll-faq-app-cta__inner,
.deedpoll-faq-categories__inner,
.deedpoll-faq-choice__inner,
.deedpoll-faq-hero__inner,
.deedpoll-footer__container,
.deedpoll-four-easy__inner,
.deedpoll-guided-support__inner,
.dp-message-center__inner,
.dp-account-access__inner,
.dp-newsletter__inner,
.deedpoll-our-story__inner,
.deedpoll-popular-articles__inner,
.deedpoll-process__inner,
.deedpoll-process__cards,
.deedpoll-reach-us__inner,
.deedpoll-resources__top,
.deedpoll-resources__cards,
.deedpoll-simple-clear__inner,
.deedpoll-start-minutes__inner,
.deedpoll-still-help__inner,
.deedpoll-trust-signals__inner,
.dp-trust-standards__inner,
.deedpoll-useful-resources__inner,
.deedpoll-values__inner,
.deedpoll-about-application__inner,
.deedpoll-all-articles__inner,
.deedpoll-ai-support__inner,
.dp-customer-dashboard__inner {
    box-sizing: border-box;
    max-width: var(--deedpoll-site-content-width) !important;
    margin-left: auto;
    margin-right: auto;
}

/* Prevent long labels/addresses/account values from forcing a horizontal page scroll. */
.deedpoll-header__login,
.deedpoll-footer__description,
.deedpoll-footer__company-card,
.dp-account-access,
.dp-message-center,
.dp-contact-support,
.dp-customer-dashboard,
.dp-customer-dashboard__inner,
.dp-customer-dashboard__main,
.dp-customer-dashboard__right {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Common media/form containment across all plugin views. */
[class*="deedpoll-"] img,
[class*="dp-"] img,
[class*="deedpoll-"] video,
[class*="dp-"] video,
[class*="deedpoll-"] iframe,
[class*="dp-"] iframe {
    max-width: 100%;
}

[class*="deedpoll-"] input,
[class*="deedpoll-"] select,
[class*="deedpoll-"] textarea,
[class*="dp-"] input,
[class*="dp-"] select,
[class*="dp-"] textarea {
    max-width: 100%;
    box-sizing: border-box;
}

/*
 * Some older saved Elementor instances set a literal 1300px width rather
 * than only a max-width. On desktop/laptop, allow those inner wrappers to
 * occupy the shared grid without altering the full-width section background.
 */
@media (min-width: 1025px) {
    .deedpoll-about-application__inner,
    .deedpoll-audience__inner,
    .deedpoll-behind-scenes__inner,
    .deedpoll-better-way-focus__inner,
    .deedpoll-better-way__inner,
    .deedpoll-four-easy__inner,
    .deedpoll-guided-support__inner,
    .deedpoll-our-story__inner,
    .deedpoll-reach-us__inner,
    .deedpoll-simple-clear__inner,
    .deedpoll-start-minutes__inner,
    .deedpoll-still-help__inner,
    .deedpoll-values__inner,
    .dp-commonq__inner {
        width: 100% !important;
    }
}

/* Large / small laptop compatibility. */
@media (max-width: 1300px) {
    .deedpoll-footer__grid {
        grid-template-columns: minmax(250px, 1.45fr) repeat(3, minmax(125px, 1fr));
        column-gap: clamp(24px, 3vw, 48px);
    }

    .deedpoll-footer__description,
    .deedpoll-footer__badges {
        width: 100%;
        max-width: 370px;
    }

    .deedpoll-application-process__inner {
        column-gap: clamp(45px, 6vw, 85px);
    }
}

/* Small laptop / landscape tablet transition: keep the desktop header on one line. */
@media (max-width: 1180px) and (min-width: 1025px) {
    .deedpoll-header__logo img {
        width: 136px;
    }

    .deedpoll-header__nav {
        gap: 13px;
    }

    .deedpoll-header__nav-link,
    .deedpoll-header__login {
        font-size: 13px;
    }

    .deedpoll-header__actions {
        gap: 14px;
    }

    .deedpoll-header__cta {
        min-width: 170px;
        padding-left: 18px;
        padding-right: 18px;
        font-size: 13px;
    }
}

/* Tablet: the navigation becomes a touch-scrollable second row instead of disappearing. */
@media (max-width: 1024px) {
    .deedpoll-trustbar {
        height: 36px;
    }

    .deedpoll-trustbar__inner {
        justify-content: flex-start;
        gap: 28px;
        padding-left: var(--deedpoll-site-gutter-tablet) !important;
        padding-right: var(--deedpoll-site-gutter-tablet) !important;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .deedpoll-trustbar__inner::-webkit-scrollbar,
    .deedpoll-header__nav::-webkit-scrollbar {
        display: none;
    }

    .deedpoll-header {
        height: auto !important;
        min-height: 72px;
    }

    .deedpoll-header__inner {
        height: auto !important;
        min-height: 72px;
        flex-wrap: wrap;
        align-content: center;
        row-gap: 0;
        padding-left: var(--deedpoll-site-gutter-tablet) !important;
        padding-right: var(--deedpoll-site-gutter-tablet) !important;
    }

    .deedpoll-header__brand,
    .deedpoll-header__actions {
        min-height: 72px;
    }

    .deedpoll-header__brand {
        order: 1;
    }

    .deedpoll-header__actions {
        order: 2;
        margin-left: auto;
    }

    .deedpoll-header__nav {
        order: 3;
        display: flex !important;
        flex: 0 0 100%;
        width: 100%;
        min-width: 0;
        justify-content: flex-start;
        gap: 22px;
        padding: 10px 0 12px;
        border-top: 1px solid rgba(14, 47, 36, .08);
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .deedpoll-header__nav-link {
        flex: 0 0 auto;
    }

    .deedpoll-footer__grid {
        grid-template-columns: minmax(240px, 1.35fr) repeat(3, minmax(110px, 1fr));
        gap: 24px;
    }

    .dp-customer-dashboard__table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dp-customer-dashboard table {
        max-width: none;
    }
}

/* Phones and portrait tablets. */
@media (max-width: 767px) {
    .deedpoll-trustbar__inner {
        gap: 22px;
        padding-left: var(--deedpoll-site-gutter-mobile) !important;
        padding-right: var(--deedpoll-site-gutter-mobile) !important;
    }

    .deedpoll-trustbar__label {
        font-size: 12px;
    }

    .deedpoll-header__inner {
        padding-left: var(--deedpoll-site-gutter-mobile) !important;
        padding-right: var(--deedpoll-site-gutter-mobile) !important;
    }

    /* Overrides the original mobile rule that hid all navigation links. */
    .deedpoll-header__nav {
        display: flex !important;
        width: 100% !important;
        gap: 20px !important;
        padding-top: 9px;
        padding-bottom: 11px;
    }

    .deedpoll-header__login {
        display: none !important;
    }

    .deedpoll-header__logo img {
        width: 124px;
    }

    .deedpoll-header__cta {
        min-width: 0 !important;
        height: 40px;
        padding-left: 14px !important;
        padding-right: 14px !important;
        font-size: 12px;
        white-space: nowrap;
    }

    .deedpoll-footer,
    .deedpoll-footer__container,
    .deedpoll-footer__main,
    .deedpoll-footer__grid,
    .deedpoll-footer__bottom {
        min-width: 0;
        max-width: 100%;
    }

    .dp-customer-dashboard__table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .dp-account-access__shell,
    .dp-message-center__inner,
    .dp-contact-support__inner {
        max-width: 100%;
    }
}

/* Narrow phones. */
@media (max-width: 480px) {
    .deedpoll-header__logo img {
        width: 112px;
    }

    .deedpoll-header__cta {
        padding-left: 10px !important;
        padding-right: 10px !important;
        font-size: 11px;
    }

    .deedpoll-header__nav {
        gap: 18px !important;
    }

    .deedpoll-header__nav-link {
        font-size: 12px;
    }

    .deedpoll-trustbar__label {
        font-size: 11px;
    }

    .dp-account-access__shell,
    .dp-message-center__inner {
        border-radius: 18px;
    }
}
