.m360-search-form,
.m360-search-form * { box-sizing: border-box; }

.m360-search-form { width: 100%; color: #202124; }

.elementor-widget-shortcode:has(.m360-search-form),
.elementor-widget.m360-search-widget {
    width: 100% !important;
    max-width: none !important;
    flex: 1 1 100% !important;
    align-self: stretch !important;
}

.elementor-widget-container:has(> .m360-search-form),
.elementor-widget-container.m360-search-widget__container {
    width: 100% !important;
    max-width: none !important;
}

.m360-search-form--hero {
    width: 100% !important;
    max-width: none !important;
    padding: clamp(10px, 1.4vw, 16px);
    border: 1px solid #eceff3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 9px 26px rgba(0,0,0,.08);
}

.m360-search-form__intro {
    max-width: 760px;
    margin: 0 auto 14px;
    text-align: center;
}

.m360-search-form__intro h2 {
    margin: 0 0 5px;
    font-size: clamp(26px, 3.2vw, 40px);
    line-height: 1.08;
}

.m360-search-form__intro p { margin: 0; color: #5f6368; font-size: 16px; }

.m360-search-form__form {
    display: block;
    width: min(860px, 100%);
    margin: 0 auto;
    position: relative;
}

.m360-search-form__label {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0,0,0,0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.m360-search-form__field {
    display: flex;
    align-items: center;
    min-width: 0;
    height: 56px;
    padding: 4px 5px 4px 17px;
    border: 1px solid #dfe1e5;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(60,64,67,.12);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.m360-search-form__field:focus-within {
    border-color: var(--m360-search-primary, #d71920);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--m360-search-primary, #d71920) 15%, transparent), 0 4px 12px rgba(60,64,67,.16);
}

.m360-search-form__icon {
    width: 21px;
    height: 21px;
    flex: 0 0 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    color: #72777d;
}

.m360-search-form__input {
    width: 100% !important;
    min-width: 0 !important;
    height: 46px !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #202124 !important;
    font: inherit !important;
    font-size: 16px !important;
}

.m360-search-form__input::-webkit-search-cancel-button { cursor: pointer; }

.m360-search-form__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 112px;
    height: 46px;
    padding: 0 20px;
    border: 0;
    border-radius: 999px;
    background: var(--m360-search-primary, #d71920);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s ease;
}

.m360-search-form__button .m360-search-form__icon { display: none; color: currentColor; }
.m360-search-form__button:hover { background: var(--m360-search-secondary, #111111); }
.m360-search-form__button:focus-visible { outline: 3px solid var(--m360-search-primary, #d71920); outline-offset: 2px; }
.m360-search-form__message { display: block; color: var(--m360-search-primary, #d71920); font-size: 14px; font-weight: 700; padding: 6px 18px 0; }
.m360-search-form--header { max-width: 760px; }
.m360-search-form--header .m360-search-form__field { height: 50px; }
.m360-search-form--header .m360-search-form__input { height: 42px !important; font-size: 15px !important; }
.m360-search-form--header .m360-search-form__button { height: 40px; min-width: 96px; padding: 0 16px; }
.m360-search-form--compact { max-width: 520px; }
.m360-search-form--compact .m360-search-form__field { height: 46px; padding-right: 3px; }
.m360-search-form--compact .m360-search-form__input { height: 38px !important; font-size: 14px !important; }
.m360-search-form--compact .m360-search-form__button { width: 38px; min-width: 38px; height: 38px; padding: 0; }
.m360-search-form--compact .m360-search-form__button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.m360-search-form--compact .m360-search-form__button .m360-search-form__icon { display: block; }
.m360-search-form.is-invalid .m360-search-form__field { border-color: var(--m360-search-primary, #d71920); box-shadow: 0 0 0 3px color-mix(in srgb, var(--m360-search-primary, #d71920) 15%, transparent); }

.m360-search-toggle {
    position: relative;
    display: flex;
    height: 100%;
    align-items: stretch;
    justify-content: flex-end;
}

.elementor-widget-shortcode:has(.m360-search-toggle),
.elementor-widget.m360-search-toggle-widget {
    width: auto !important;
    max-width: none !important;
    flex: 0 0 auto !important;
    align-self: stretch !important;
}

.elementor-widget.m360-search-toggle-widget > .elementor-widget-container {
    width: auto !important;
    height: 100%;
}

.m360-search-toggle__trigger {
    all: initial;
    box-sizing: border-box !important;
    display: grid !important;
    width: 62px !important;
    min-height: 58px !important;
    padding: 0 !important;
    place-items: center !important;
    border: 0 !important;
    background: var(--m360-search-primary, #d71920) !important;
    color: #fff !important;
    cursor: pointer !important;
    transition: background-color .18s ease !important;
}

.m360-search-toggle__trigger:hover,
.m360-search-toggle__trigger:focus-visible,
.m360-search-toggle__trigger[aria-expanded="true"] {
    background: var(--m360-search-secondary, #111111) !important;
}

.m360-search-toggle__trigger:focus-visible {
    outline: 3px solid rgba(255,255,255,.72) !important;
    outline-offset: -4px !important;
}

.m360-search-toggle__trigger .m360-search-form__icon {
    width: 25px !important;
    height: 25px !important;
    color: currentColor !important;
    stroke-width: 2.25 !important;
}

.m360-search-toggle__panel {
    box-sizing: border-box;
    position: fixed;
    z-index: 1000000;
    width: min(470px, calc(100vw - 24px));
    padding: 12px;
    border: 1px solid #e4e4e4;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 15px 36px rgba(0,0,0,.24);
    opacity: 0;
    transform: translateY(-7px) scale(.985);
    transform-origin: top right;
    transition: opacity .18s ease, transform .18s ease;
}

.m360-search-toggle__panel.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.m360-search-toggle__panel[hidden] { display: none !important; }
.m360-search-toggle__panel .m360-search-form { max-width: none; }
.m360-search-toggle__panel .m360-search-form__field { box-shadow: none; }

@media (max-width: 640px) {
    .m360-search-form--hero { padding: 10px; border-radius: 16px; }
    .m360-search-form__intro { margin-bottom: 14px; text-align: center; }
    .m360-search-form__intro p { max-width: 460px; margin-inline: auto; font-size: 15px; }
    .m360-search-form__field { height: 52px; padding-left: 14px; }
    .m360-search-form__input { height: 44px !important; font-size: 15px !important; }
    .m360-search-form__button { min-width: 48px; width: 48px; height: 42px; padding: 0; }
    .m360-search-form__button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
    .m360-search-form__button .m360-search-form__icon { display: block; }
    .m360-search-form__message { padding-left: 12px; text-align: center; }
    .m360-search-toggle__trigger { width: 54px !important; min-height: 54px !important; }
    .m360-search-toggle__panel { padding: 9px; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .m360-search-form__field,
    .m360-search-form__button,
    .m360-search-toggle__trigger,
    .m360-search-toggle__panel { transition: none !important; }
}
