/* ==========================================================================
   Nyco Responsive Fixes
   Breakpoints follow Elementor's: tablet <= 1024px, mobile <= 767px.
   IDs (.elementor-element-xxxx) refer to Elementor elements; page-scoped rules
   use the page wrapper (.elementor-<post id>) because several pages were
   duplicated and share element IDs.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Horizontal-overflow guard
   Entrance animations (slideInRight etc.) and slick/swiper carousels push
   content past the viewport while they run, which makes the whole page
   scroll sideways on phones. Clip horizontally only; vertical overflow
   (dropdowns, overlapping cards) stays visible.
   -------------------------------------------------------------------------- */
.elementor-section.elementor-top-section,
.e-con.e-parent {
    overflow-x: clip;
}

/* Long unbroken strings (e-mail addresses) must wrap inside narrow columns */
.elementor-widget-text-editor,
.elementor-heading-title,
.elementor-icon-box-title,
.elementor-icon-box-description,
.elementor-image-box-title,
.elementor-image-box-description,
.elementor-icon-list-text {
    overflow-wrap: anywhere;
}

/* --------------------------------------------------------------------------
   2a. Header overlap
   The header row has margin-bottom: -115px on tablet/mobile (0 on desktop).
   That is taller than the header itself (~92px), so the top of every page
   was hidden underneath it.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .elementor-12 .elementor-element.elementor-element-63f632a7 {
        margin-bottom: 0 !important;
    }

    /* Homepage hero padding only existed to clear that overlap */
    .elementor-2 .elementor-element.elementor-element-1206677a {
        padding-top: 0 !important;
    }
}

/* --------------------------------------------------------------------------
   2b. Header — hamburger menu on tablets
   Happy Addons only switches to its burger menu below 768px, so between
   768px and 1024px the six links + "Get A Quote" button wrap onto several
   rows. Reuse HA's own toggler (its click handler works at any width).
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
    .elementor-element-63f632a7 > .elementor-container {
        align-items: center;
    }

    .elementor-element-556f21c1 {
        width: 40% !important;
    }

    .elementor-element-35ce4b5e {
        width: 60% !important;
    }

    .elementor-element-debfab1 img {
        width: 190px !important;
        max-width: 100% !important;
    }

    /* The quote CTA is repeated in every page footer */
    .elementor-element-74d2a6e {
        display: none !important;
    }

    /* Let the dropdown span the header row instead of the narrow nav column */
    .elementor-element-35ce4b5e,
    .elementor-element-35ce4b5e > .elementor-widget-wrap,
    .elementor-element-ffc44d2,
    .elementor-element-ffc44d2 .ha-navigation-menu-wrapper {
        position: static !important;
    }

    .elementor-element-ffc44d2 .ha-navigation-menu-wrapper {
        justify-content: flex-end;
    }

    .elementor-element-ffc44d2 .ha-navigation-menu-wrapper .ha-nav-humberger-wrapper {
        display: flex !important;
        justify-content: flex-end;
    }

    .elementor-element-ffc44d2 .ha-menu-toggler {
        padding: 0 10px;
        border: 1px solid #ccc;
        border-radius: 5px;
        color: #7a7a7a;
        font-size: 22px;
        line-height: 1.6;
        cursor: pointer;
    }

    .elementor-element-ffc44d2 .ha-menu-toggler svg {
        width: auto;
        height: 1em;
        fill: currentColor;
        vertical-align: middle;
    }

    .elementor-element-ffc44d2 .ha-menu-open-icon {
        display: inline-block !important;
    }

    .elementor-element-ffc44d2 .ha-menu-open-icon.hide-icon,
    .elementor-element-ffc44d2 .ha-menu-close-icon {
        display: none !important;
    }

    .elementor-element-ffc44d2 .ha-menu-close-icon.show-icon:not(.hide-icon) {
        display: inline-block !important;
    }

    /* Closed by default; HA's toggler slides it open */
    .elementor-element-ffc44d2 .ha-navigation-menu-wrapper ul.menu {
        display: none;
    }
}

/* Dropdown panel, tablet + phone: span the whole header row. HA's own phone
   dropdown (width:100vw; right:0 inside the padded column) sat ~20px too far
   left and clipped the start of each link. */
@media (max-width: 1024px) {
    /* (the header container stays position:relative — making it static lets
       the section's background overlay paint over the menu button) */
    .elementor-element-35ce4b5e,
    .elementor-element-35ce4b5e > .elementor-widget-wrap,
    .elementor-element-ffc44d2,
    .elementor-element-ffc44d2 .ha-nav-menu {
        position: static !important;
    }

    .elementor-element-ffc44d2 ul.menu {
        /* the header container is centred, so this spans the viewport */
        position: absolute !important;
        top: 100%;
        left: 50% !important;
        right: auto !important;
        width: 100vw !important;
        transform: translateX(-50%);
        z-index: 99999;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff;
        box-shadow: 0 12px 24px rgba(0, 0, 0, .1);
        text-align: left;
    }

    .elementor-element-ffc44d2 ul.menu > li {
        display: flex !important;
        flex-wrap: wrap;
        align-items: center;
        margin: 0 !important;
        padding: 0 24px !important;
        border-bottom: 1px solid #e6e6e6;
    }

    .elementor-element-ffc44d2 ul.menu > li > a {
        flex: 1 1 0 !important;
        min-width: 0;
        margin-right: 0 !important;
        padding: 14px 0 !important;
    }

    .elementor-element-ffc44d2 ul.menu > li > .ha-submenu-indicator-wrap {
        flex: 0 0 auto !important;
        margin-left: auto;
        padding: 14px 4px;
    }

    .elementor-element-ffc44d2 ul.menu > li > .nyco-mm-panel {
        flex: 0 0 100%;
    }
}

/* --------------------------------------------------------------------------
   3. Homepage hero (Slider Revolution) — the slides only have a desktop
   layout, so the scaled-down headline covers the feature list.
   -------------------------------------------------------------------------- */
@media (min-width: 768px) and (max-width: 1024px) {
    sr7-module [id^="SR7_2_1-"][id$="-9"] {
        font-size: 36px !important;
        line-height: 40px !important;
    }

    sr7-module [id^="SR7_2_1-"][id$="-10"] {
        margin-top: 14px !important;
        font-size: 40px !important;
        line-height: 46px !important;
    }
}

@media (max-width: 767px) {
    /* Green product label ("COLIMINDER") */
    sr7-module [id^="SR7_2_1-"][id$="-9"] {
        font-size: 24px !important;
        line-height: 28px !important;
    }

    /* Headline: smaller and nudged below the label */
    sr7-module [id^="SR7_2_1-"][id$="-10"] {
        margin-top: 24px !important;
        font-size: 24px !important;
        line-height: 29px !important;
    }

    /* Feature list, its icons and separator lines don't fit a phone */
    #SR7_2_1-36-11, #SR7_2_1-36-12, #SR7_2_1-36-13, #SR7_2_1-36-14,
    #SR7_2_1-36-15, #SR7_2_1-36-16, #SR7_2_1-36-17, #SR7_2_1-36-18,
    #SR7_2_1-36-20, #SR7_2_1-36-21, #SR7_2_1-36-22 {
        visibility: hidden !important;
    }
}

/* --------------------------------------------------------------------------
   4. Section titles built as  [divider] [heading] [divider]
   Keep the three columns on one row ("—— Title ——") instead of stacking
   them into a ~250px tall block on phones or squeezing the title on tablets.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .elementor-top-section:has(> .elementor-container > .elementor-column:nth-child(1):not(:last-child) > .elementor-widget-wrap > .elementor-widget-divider:only-child):has(> .elementor-container > .elementor-column:nth-child(2) > .elementor-widget-wrap > .elementor-widget-heading:only-child):has(> .elementor-container > .elementor-column:nth-child(3):last-child > .elementor-widget-wrap > .elementor-widget-divider:only-child) > .elementor-container {
        flex-wrap: nowrap !important;
        align-items: center;
    }

    .elementor-top-section:has(> .elementor-container > .elementor-column:nth-child(1):not(:last-child) > .elementor-widget-wrap > .elementor-widget-divider:only-child):has(> .elementor-container > .elementor-column:nth-child(2) > .elementor-widget-wrap > .elementor-widget-heading:only-child):has(> .elementor-container > .elementor-column:nth-child(3):last-child > .elementor-widget-wrap > .elementor-widget-divider:only-child) > .elementor-container > .elementor-column {
        width: auto !important;
        flex: 1 1 24px;
        min-width: 24px;
    }

    .elementor-top-section:has(> .elementor-container > .elementor-column:nth-child(1):not(:last-child) > .elementor-widget-wrap > .elementor-widget-divider:only-child):has(> .elementor-container > .elementor-column:nth-child(2) > .elementor-widget-wrap > .elementor-widget-heading:only-child):has(> .elementor-container > .elementor-column:nth-child(3):last-child > .elementor-widget-wrap > .elementor-widget-divider:only-child) > .elementor-container > .elementor-column:nth-child(2) {
        flex: 0 1 auto;
        max-width: calc(100% - 64px);
    }

    .elementor-top-section:has(> .elementor-container > .elementor-column:nth-child(1):not(:last-child) > .elementor-widget-wrap > .elementor-widget-divider:only-child):has(> .elementor-container > .elementor-column:nth-child(2) > .elementor-widget-wrap > .elementor-widget-heading:only-child):has(> .elementor-container > .elementor-column:nth-child(3):last-child > .elementor-widget-wrap > .elementor-widget-divider:only-child) .elementor-divider {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* Phones: long titles wrap and leave stub lines, so show the title alone */
@media (max-width: 767px) {
    .elementor-top-section:has(> .elementor-container > .elementor-column:nth-child(1):not(:last-child) > .elementor-widget-wrap > .elementor-widget-divider:only-child):has(> .elementor-container > .elementor-column:nth-child(2) > .elementor-widget-wrap > .elementor-widget-heading:only-child):has(> .elementor-container > .elementor-column:nth-child(3):last-child > .elementor-widget-wrap > .elementor-widget-divider:only-child) > .elementor-container > .elementor-column:not(:nth-child(2)) {
        display: none !important;
    }

    .elementor-top-section:has(> .elementor-container > .elementor-column:nth-child(1):not(:last-child) > .elementor-widget-wrap > .elementor-widget-divider:only-child):has(> .elementor-container > .elementor-column:nth-child(2) > .elementor-widget-wrap > .elementor-widget-heading:only-child):has(> .elementor-container > .elementor-column:nth-child(3):last-child > .elementor-widget-wrap > .elementor-widget-divider:only-child) > .elementor-container > .elementor-column:nth-child(2) {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* --------------------------------------------------------------------------
   5. Page banners — the desktop design puts the title on the left and a
   picture on the right of the same background. On narrow screens the
   picture ends up behind the text, so show it as a band above the text.
   The band's ::before inherits the element's own background-image, so the
   image stays editable in Elementor.
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    /* About Us, Events, Careers: picture is on the hero column */
    .elementor-2205 .elementor-element-f1d2c46 > .elementor-widget-wrap,
    .elementor-2365 .elementor-element-f1d2c46 > .elementor-widget-wrap,
    .elementor-2456 .elementor-element-f1d2c46 > .elementor-widget-wrap,
    /* Products, Contact Us, Special Chemistry: picture is on the section */
    .elementor-231 .elementor-element-2db45530,
    .elementor-56 .elementor-element-2aed4db6,
    .elementor-3127 .elementor-element-19379ff {
        position: relative;
        /* band height follows the ~16:7 banner images (% padding = % of width) */
        padding-top: calc(43.75% + 24px) !important;
        background-size: 0 0 !important;
        background-color: transparent !important;
    }

    .elementor-2205 .elementor-element-f1d2c46 > .elementor-widget-wrap::before,
    .elementor-2365 .elementor-element-f1d2c46 > .elementor-widget-wrap::before,
    .elementor-2456 .elementor-element-f1d2c46 > .elementor-widget-wrap::before,
    .elementor-231 .elementor-element-2db45530::before,
    .elementor-56 .elementor-element-2aed4db6::before,
    .elementor-3127 .elementor-element-19379ff::before {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        aspect-ratio: 16 / 7;
        background-image: inherit;
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    .elementor-231 .elementor-element-2db45530 > .elementor-container,
    .elementor-56 .elementor-element-2aed4db6 > .elementor-container,
    .elementor-3127 .elementor-element-19379ff > .elementor-container {
        min-height: 0 !important;
    }

    /* About Us hero text is indented 150px to clear the desktop picture */
    .elementor-2205 .elementor-element-9b5b8f5 > .elementor-widget-container,
    .elementor-2205 .elementor-element-24b546e > .elementor-widget-container {
        margin-left: 0 !important;
    }
}

/* --------------------------------------------------------------------------
   6. Stacked icon rows — the vertical dividers between items only make
   sense side by side (About Us, Events, Careers feature rows; About Us
   "Why Choose" columns).
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .elementor-element-7a94545 > .elementor-widget-container,
    .elementor-element-9021d6c > .elementor-widget-container,
    .elementor-element-53bbd38 > .elementor-widget-container,
    .elementor-element-7a9aaec > .elementor-widget-wrap,
    .elementor-element-afacb44 > .elementor-widget-wrap,
    .elementor-element-420fa74 > .elementor-widget-wrap,
    .elementor-element-2432527 > .elementor-widget-wrap,
    .elementor-element-cce15f1 > .elementor-widget-wrap {
        border-left-width: 0 !important;
        border-right-width: 0 !important;
    }
}

/* --------------------------------------------------------------------------
   7. About Us "Our History" timeline — the desktop layout is a zig-zag
   (row 2 runs right-to-left), so once stacked the years come out of order
   and the arrows point sideways. Stack chronologically without arrows.
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .elementor-2205 .elementor-element-0fcef3f > .elementor-container {
        flex-direction: column-reverse;
    }

    .elementor-2205 .elementor-element-10537aa,
    .elementor-2205 .elementor-element-a7befbe,
    .elementor-2205 .elementor-element-87f4cd6,
    .elementor-2205 .elementor-element-c86ac7c,
    .elementor-2205 .elementor-element-773e336,
    .elementor-2205 .elementor-element-bacd4c6,
    .elementor-2205 .elementor-element-e3f3d70 .elementor-column:not(.elementor-element-0e7c33e) {
        display: none !important;
    }

    .elementor-2205 .elementor-element-2a35ac4 .elementor-column,
    .elementor-2205 .elementor-element-0fcef3f .elementor-column,
    .elementor-2205 .elementor-element-0e7c33e {
        margin-bottom: 28px;
    }
}

/* --------------------------------------------------------------------------
   8. Small polish
   -------------------------------------------------------------------------- */
/* Buttons shouldn't break their label over two lines */
.elementor-button .elementor-button-text {
    white-space: nowrap;
}
