/* ── Slide Menu Widget v2.0 ── */

/* ── Wrapper ── */
.smw-wrapper {
    display: inline-block;
    position: relative;
}

/* ── Trigger Button ── */
.smw-open-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    background-color: #F28C28;
    color: #fff;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
    line-height: 1;
    vertical-align: middle;
}

/* FIX: btn icon wrapper – ensures consistent sizing for both FA & SVG */
.smw-open-btn .smw-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;      /* default, overridden by Elementor selector */
    line-height: 1;
    flex-shrink: 0;
}
/* FIX: SVG icons inside button inherit size from wrapper */
.smw-open-btn .smw-btn-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
}
.smw-open-btn .smw-btn-icon i {
    font-size: inherit;
    line-height: 1;
}
.smw-btn-text {
    line-height: 1;
}

/* ── Overlay ── */
.smw-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}
.smw-overlay.active { display: block; }

/* ── Panel ── */
.smw-panel {
    position: fixed;
    top: 0;
    height: 100%;
    width: 300px;
    background: #fff;
    z-index: 9999;
    overflow-y: auto;
    transition: transform 320ms cubic-bezier(.4,0,.2,1);
    box-shadow: 2px 0 24px rgba(0,0,0,0.13);
    padding-bottom: 40px;
}
.smw-from-left  { left: 0;  transform: translateX(-110%); }
.smw-from-right { right: 0; transform: translateX(110%);  }
.smw-from-left.active,
.smw-from-right.active { transform: translateX(0); }

/* ── Close Button ── */
.smw-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: rgba(0,0,0,0.07);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 14px;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2;
    flex-shrink: 0;
}
.smw-close-btn:hover { background: rgba(0,0,0,0.15); }

/* ── Header ── */
.smw-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 18px;
    text-decoration: none;
    background: #F28C28;
    color: #fff;
}
.smw-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    /* FIX: ensure SVG inside avatar inherits color */
    color: #fff;
}
.smw-avatar svg { fill: currentColor; display: block; }

.smw-greeting { font-size: 17px; font-weight: 600; line-height: 1.3; color: #fff; }
.smw-sub      { font-size: 14px; opacity: .9; margin-top: 2px; color: rgba(255,255,255,0.85); }

/* ── Menu Box ── */
.smw-menu-box {
    background: #f7f7f7;
    margin: 14px 14px 0;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
}

.smw-menu-item {
    border-bottom: 1px solid #eee;
    position: relative;
}
.smw-menu-item:last-child { border-bottom: none; }

.smw-menu-item > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    transition: background-color 180ms, color 180ms, transform 180ms, padding-left 180ms, border-left-color 180ms;
    position: relative;
    overflow: hidden;
    border-left: 3px solid transparent;
    cursor: pointer;
}

/* ── Hover Animations ── */

/* slide-right */
[data-hover-anim="slide-right"] .smw-menu-item > a:hover {
    padding-left: 22px;
}

/* scale-up */
[data-hover-anim="scale-up"] .smw-menu-item > a:hover {
    transform: scale(1.02);
}

/* border-left */
[data-hover-anim="border-left"] .smw-menu-item > a:hover {
    border-left-color: #F28C28;
}

/* ── Shared Item Parts ── */
.smw-item-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;   /* default – overridden by Elementor selector */
    width: 18px;
    text-align: center;
    flex-shrink: 0;
    line-height: 1;
}
/* FIX: SVG icons inside menu items scale with font-size of wrapper */
.smw-item-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
}
.smw-item-icon i { font-size: inherit; }

.smw-item-label {
    flex: 1;
    min-width: 0;
}

/* FIX: arrow – clean consistent sizing, no conflict with sub-toggle */
.smw-arrow {
    margin-left: auto;
    font-size: 20px;
    color: #aaa;
    line-height: 1;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

/* sub-toggle arrow rotation */
.smw-sub-toggle {
    transition: transform 250ms cubic-bezier(.4,0,.2,1), color 180ms;
    transform: rotate(0deg);
}
.smw-has-sub.smw-sub-open > a .smw-sub-toggle {
    transform: rotate(90deg);
}

/* Badge */
.smw-badge {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    background: #e74c3c;
    border-radius: 20px;
    padding: 2px 7px;
    margin-left: 4px;
    flex-shrink: 0;
}

/* ── Sub Menu ── */
/* FIX: use max-height animation instead of display:none/block so
   closing also animates. display:none breaks animations entirely. */
.smw-sub-menu {
    max-height: 0;
    overflow: hidden;
    background: #f0f0f0;
    transition: max-height 280ms cubic-bezier(.4,0,.2,1),
                opacity 220ms ease;
    opacity: 0;
}
.smw-sub-menu.smw-sub-visible {
    max-height: 600px;   /* large enough for any sub menu */
    opacity: 1;
}

.smw-sub-item {
    border-bottom: 1px solid #e0e0e0;
}
.smw-sub-item:last-child { border-bottom: none; }
.smw-sub-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 10px 32px;
    text-decoration: none;
    color: #555;
    font-size: 14px;
    transition: background-color 150ms, color 150ms;
}
.smw-sub-item a:hover {
    background: #e8e8e8;
    color: #F28C28;
}

/* FIX: sub-icon sizing mirrors item-icon */
.smw-sub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    line-height: 1;
}
.smw-sub-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
}
.smw-sub-icon i { font-size: inherit; }

/* ── Quick Links Section ── */
.smw-quick-links-section { margin: 18px 14px 0; }

.smw-section-title {
    font-size: 15px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
    border-left: 3px solid #F28C28;
    padding-left: 10px;
}

.smw-quick-box {
    background: #f7f7f7;
    border-radius: 10px;
    border: 1px solid #eee;
    overflow: hidden;
}

.smw-ql-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    border-bottom: 1px solid #eee;
    transition: background-color 160ms, color 160ms;
}
.smw-ql-item:last-child { border-bottom: none; }
.smw-ql-item:hover { background: #fff3e6; color: #F28C28; }

/* FIX: ql-icon wrapper – properly constrains FA and SVG icon sizes */
.smw-ql-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;   /* default – overridden by Elementor selector */
    width: 20px;
    flex-shrink: 0;
    line-height: 1;
}
.smw-ql-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
}
.smw-ql-icon i { font-size: inherit; }
