/* =============================================================================
   WebMZ Mobile Header Off-Canvas Widgets
   ============================================================================= */

.webmz-mtrigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--webmz-color-primary-light, rgba(8, 120, 249, .1));
    color: var(--webmz-color-primary, #0878f9);
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, opacity .2s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.webmz-mtrigger:hover,
.webmz-mtrigger:focus-visible {
    background: color-mix(in srgb, var(--webmz-color-primary, #0878f9) 16%, #fff);
    color: var(--webmz-color-primary, #0878f9);
}

.webmz-mtrigger__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.webmz-mtrigger__icon svg {
    width: 100%;
    height: 100%;
}

.webmz-mtrigger__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--webmz-color-primary, #0878f9);
    color: #fff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
}

.webmz-mtrigger__badge--inline {
    position: static;
    top: auto;
    right: auto;
    pointer-events: auto;
}

.webmz-mmenu-trigger {
    background: var(--webmz-color-primary-light, rgba(8, 120, 249, .1));
    box-shadow: none;
    padding: 0;
}

.webmz-mmenu-trigger__bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.webmz-mmenu-trigger__bars span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: var(--webmz-color-primary, #0878f9);
    box-shadow: 0 0 0 4px var(--webmz-color-primary-light, rgba(8, 120, 249, .12));
}

.webmz-mmenu-trigger__bars span:nth-child(2) {
    width: 78%;
    margin-inline-start: auto;
}

/* Panel wrappers must not affect header layout */
.webmz-mcart-panel,
.webmz-hcart-panel,
.webmz-maccount-panel,
.webmz-mmenu-panel {
    display: contents;
}

/* Off-canvas shell — portaled to body */
.webmz-offcanvas {
    position: fixed;
    inset: 0;
    z-index: 99998;
    visibility: hidden;
    pointer-events: none;
}

/* Prevent FOUC / horizontal scroll before JS finishes booting (must not block .is-open) */
.webmz-offcanvas--boot:not(.is-open) {
    position: fixed !important;
    inset: 0 !important;
    width: 0 !important;
    height: 0 !important;
    overflow: hidden !important;
    visibility: hidden !important;
    pointer-events: none !important;
    z-index: -1 !important;
}

.webmz-offcanvas.is-open {
    visibility: visible;
    pointer-events: auto;
    z-index: 99998;
}

body > .webmz-offcanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100vw;
    overflow: hidden;
}

.webmz-offcanvas__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    transition: opacity .25s ease;
}

.webmz-offcanvas.is-open .webmz-offcanvas__overlay {
    opacity: 1;
}

.webmz-offcanvas__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: min(100%, 360px);
    max-width: 92vw;
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: 0 0 40px rgba(15, 23, 42, .16);
    transition: transform .28s ease;
    overflow: hidden;
}

.webmz-offcanvas__panel--right {
    right: 0;
    left: auto;
    transform: translate3d(100%, 0, 0);
}

.webmz-offcanvas__panel--left {
    left: 0;
    right: auto;
    transform: translate3d(-100%, 0, 0);
}

.webmz-offcanvas.is-open .webmz-offcanvas__panel--right,
.webmz-offcanvas.is-open .webmz-offcanvas__panel--left {
    transform: translate3d(0, 0, 0);
}

html.webmz-offcanvas-open,
html.webmz-offcanvas-open body {
    overflow: hidden;
    max-width: 100%;
}

.webmz-offcanvas__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 0;
}

.webmz-offcanvas__head-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.webmz-offcanvas__head-main .webmz-hcart__header-total {
    font-size: 13px;
    font-weight: 700;
    color: var(--webmz-color-text-gray, #64748b);
}

.webmz-offcanvas__title {
    margin: 0;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.6;
    color: var(--webmz-color-text-dark, #111827);
}

.webmz-offcanvas__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff 0%, #f8fafc 100%);
    color: var(--webmz-color-text-dark, #111827);
    box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
    cursor: pointer;
    flex-shrink: 0;
    transition: color .2s ease, background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.webmz-offcanvas__close svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.webmz-offcanvas__close:hover,
.webmz-offcanvas__close:focus-visible {
    background: var(--webmz-color-primary-light, rgba(8, 120, 249, .1));
    color: var(--webmz-color-primary, #0878f9);
    box-shadow: 0 10px 28px rgba(8, 120, 249, .14);
    transform: translateY(-1px);
}

.webmz-offcanvas__close--floating {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
}

.webmz-offcanvas--no-head .webmz-offcanvas__body {
    padding-top: 52px;
}

.webmz-offcanvas__body {
    flex: 1 1 auto;
    overflow: auto;
    padding: 16px 18px 24px;
    -webkit-overflow-scrolling: touch;
}

html.webmz-offcanvas-open {
    overflow: hidden;
}

/* Mobile cart panel — reuse header cart styles */
.webmz-offcanvas [data-webmz-hcart-body],
.webmz-offcanvas .webmz-hcart__body {
    position: static !important;
    width: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    pointer-events: auto !important;
    padding: 0;
}

.webmz-mcart-panel .webmz-hcart__item,
.webmz-mcart-panel .webmz-hcart__footer,
.webmz-mcart-panel .webmz-hcart__empty {
    font-size: 14px;
}

[data-webmz-header-cart].is-updating .webmz-hcart__body,
.webmz-offcanvas.is-updating .webmz-hcart__body {
    opacity: .45 !important;
    pointer-events: none !important;
}

/* Mobile account panel */
.webmz-maccount-panel__menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 16px;
}

.webmz-maccount-panel__link {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--webmz-color-text-dark, #111827);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background .2s ease;
}

.webmz-maccount-panel__link:hover {
    background: #f8fafc;
}

.webmz-maccount-panel__logout {
    display: block;
    padding: 12px 14px;
    border-radius: 10px;
    background: #fff5f5;
    color: #b91c1c;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    text-align: center;
}

/* Mobile menu panel */
.webmz-mmenu-panel__logo {
    display: block;
    margin-bottom: 16px;
    text-align: center;
}

.webmz-mmenu-panel__logo img {
    display: inline-block;
    max-width: 180px;
    height: auto;
}

.webmz-msearch {
    position: relative;
    z-index: 5;
    margin-bottom: 16px;
}

.webmz-msearch__form {
    position: relative;
    margin-bottom: 0;
}

.webmz-msearch__input {
    width: 100%;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 10px 14px 10px 42px !important;
    border: 1px solid var(--webmz-wc-border, #e8edf5) !important;
    border-radius: 12px !important;
    background: #f8fafc !important;
    font-family: inherit !important;
    font-size: 14px !important;
    -webkit-appearance: none;
    appearance: none;
}

.webmz-msearch__input::-webkit-search-cancel-button,
.webmz-msearch__input::-webkit-search-decoration,
.webmz-msearch__input::-webkit-search-results-button,
.webmz-msearch__input::-webkit-search-results-decoration,
.webmz-msearch__input::-ms-clear,
.webmz-msearch__input::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
    appearance: none;
}

.webmz-msearch__box {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 0;
    z-index: 20;
    max-height: min(360px, 52vh);
    overflow: auto;
    margin-top: 0;
    padding: 36px 12px 12px;
    border: 1px solid var(--webmz-wc-border, #e8edf5);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(15, 23, 42, .12);
}

.webmz-msearch__box[hidden] {
    display: none !important;
}

.webmz-msearch__close {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: #f8fafc;
    color: var(--webmz-color-text-gray, #64748b);
    cursor: pointer;
    transition: color .2s ease, background .2s ease;
}

.webmz-msearch__close:hover,
.webmz-msearch__close:focus-visible {
    background: var(--webmz-color-primary-light, rgba(8, 120, 249, .1));
    color: var(--webmz-color-primary, #0878f9);
}

.webmz-msearch__close svg {
    display: block;
}

.webmz-msearch__submit {
    position: absolute;
    inset-inline-end: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--webmz-color-text-gray, #64748b);
    cursor: pointer;
}

.webmz-msearch.is-loading .webmz-msearch__input {
    border-color: var(--webmz-color-primary, #0878f9) !important;
    background: #fff !important;
}

.webmz-msearch.is-loading .webmz-msearch__submit {
    color: var(--webmz-color-primary, #0878f9);
    pointer-events: none;
}

.webmz-msearch.is-loading .webmz-msearch__submit svg {
    opacity: 0;
}

.webmz-msearch.is-loading .webmz-msearch__submit::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: webmz-msearch-spin .75s linear infinite;
}

@keyframes webmz-msearch-spin {
    to {
        transform: rotate(360deg);
    }
}

.webmz-msearch__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 12px;
    border-radius: 10px;
    background: #f2f7fc;
    color: var(--webmz-color-text-gray, #64748b);
    font-size: 13px;
    font-weight: 700;
}

.webmz-msearch__loading[hidden] {
    display: none !important;
}

.webmz-msearch__spinner {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2px solid var(--webmz-color-primary, #0878f9);
    border-top-color: transparent;
    border-radius: 50%;
    animation: webmz-msearch-spin .75s linear infinite;
}

.webmz-msearch__loading-text {
    line-height: 1.4;
}

.webmz-msearch__section {
    margin-top: 0;
}

.webmz-msearch__heading {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 800;
    color: var(--webmz-color-text-gray, #64748b);
}

.webmz-msearch__list {
    margin: 0;
    padding: 0;
    list-style: none;
    margin-bottom: 16px;
}

.webmz-msearch__list li + li {
    margin-top: 4px;
}

.webmz-msearch__list a {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--webmz-color-text-dark, #111827);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.6;
}

.webmz-msearch__list a:hover {
    background: #f8fafc;
}

.webmz-msearch__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.webmz-msearch__chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid var(--webmz-wc-border, #e8edf5);
    border-radius: 999px;
    background: #fff;
    color: var(--webmz-color-text-dark, #111827);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.webmz-msearch__empty,
.webmz-msearch__muted {
    font-size: 12px;
    color: var(--webmz-color-text-gray, #64748b);
}

.webmz-mmenu-panel__quick {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.webmz-mmenu-panel__quick-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid var(--webmz-wc-border, #e8edf5);
    border-radius: 12px;
    background: #fff;
    color: var(--webmz-color-text-dark, #111827);
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
}

.webmz-mmenu-panel__quick-main {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.webmz-mmenu-panel__quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    color: var(--webmz-color-primary, #0878f9);
}

.webmz-mmenu-panel__quick-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--webmz-color-text-gray, #94a3b8);
    line-height: 1;
    flex-shrink: 0;
}

.webmz-mmenu-panel__quick-arrow svg {
    display: block;
}

.webmz-mmenu-panel__nav {
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid color-mix(in srgb, var(--webmz-color-primary, #0878f9) 12%, #e8edf5);
    border-radius: 14px;
    background: color-mix(in srgb, var(--webmz-color-primary, #0878f9) 4%, #fff);
}

.webmz-mmenu-panel__nav .webmz-nav {
    margin: 0;
    padding: 0;
    list-style: none;
}

.webmz-mmenu-panel__nav .webmz-nav__item {
    position: relative;
    border-bottom: 1px solid var(--webmz-wc-border, #e8edf5);
}

.webmz-mmenu-panel__nav .webmz-nav__item:last-child {
    border-bottom: 0;
}

.webmz-mmenu-panel__nav .webmz-nav__item.has-children {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.webmz-mmenu-panel__nav .webmz-nav__link {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
    padding: 12px 10px;
    color: var(--webmz-color-text-dark, #111827);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}

.webmz-mmenu-panel__nav .webmz-nav__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--webmz-color-primary, #0878f9);
}

.webmz-mmenu-panel__nav .webmz-nav__icon svg,
.webmz-mmenu-panel__nav .webmz-nav__icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.webmz-mmenu-panel__nav .webmz-nav__toggle {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-inline-end: 4px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--webmz-color-text-gray, #64748b);
    cursor: pointer;
    flex-shrink: 0;
    transform: none;
}

.webmz-mmenu-panel__nav .webmz-nav__toggle svg {
    width: 16px;
    height: 16px;
    transition: transform .2s ease;
}

.webmz-mmenu-panel__nav .webmz-nav__item.is-submenu-open > .webmz-nav__toggle svg {
    transform: rotate(180deg);
}

.webmz-mmenu-panel__nav .webmz-nav__submenu {
    display: block;
    width: 100%;
    flex: 0 0 100%;
    margin: 0;
    padding: 0;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px);
    transition: max-height .28s ease, opacity .22s ease, transform .28s ease;
}

.webmz-mmenu-panel__nav .webmz-nav__item.is-submenu-open > .webmz-nav__submenu {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
}

.webmz-mmenu-panel__nav .webmz-nav__submenu .webmz-nav__link {
    padding-inline-start: 18px;
    font-size: 13px;
    font-weight: 600;
    color: var(--webmz-color-text-gray, #64748b);
}

.webmz-mmenu-panel__contact {
    margin-top: 8px;
}

.webmz-mmenu-panel__contact .tadris-contact-box-1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 14px;
    border: 1px solid var(--webmz-wc-border, #e8edf5);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    text-align: center;
}

.webmz-mmenu-panel__contact .tadris-contact-text {
    text-align: center;
}

.webmz-mmenu-panel__contact .tadris-contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--webmz-color-primary-light, rgba(8, 120, 249, .1));
    color: var(--webmz-color-primary, #0878f9);
}

.webmz-mmenu-panel__contact .tadris-contact-number {
    font-size: 14px;
    font-weight: 800;
    color: var(--webmz-color-primary, #0878f9);
}

.webmz-mmenu-panel__contact .tadris-contact-text > span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--webmz-color-text-gray, #64748b);
}

/* Elementor editor — keep off-canvas visible for live preview */
.elementor-editor-active .webmz-offcanvas.is-editor-preview {
    visibility: visible;
    pointer-events: auto;
    z-index: 99999;
}

.elementor-editor-active .webmz-offcanvas.is-editor-preview .webmz-offcanvas__overlay {
    opacity: 1;
}

.elementor-editor-active .webmz-offcanvas.is-editor-preview .webmz-offcanvas__panel {
    transform: translate3d(0, 0, 0);
}
