/* ── Trigger ─────────────────────────────────────────────── */
.sme-trigger {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #111;
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.sme-trigger:hover  { background: #333; }
.sme-trigger:focus  { outline: none; background: #111; box-shadow: none; }
.sme-trigger:active { outline: none; background: #111; box-shadow: none; }
.sme-trigger:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sme-trigger-icon { display: flex; flex-direction: column; gap: 4px; }
.sme-trigger-icon span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 2px; }

/* ── Overlay ─────────────────────────────────────────────── */
.sme-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.sme-wrap.is-open .sme-overlay { opacity: 1; pointer-events: all; }

/* ── Drawer ──────────────────────────────────────────────── */
.sme-drawer {
  position: fixed;
  top: 0; left: 0;
  width: 320px;
  max-width: 90vw;
  height: 100vh;
  background: #fff;
  z-index: 100000;
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  overflow: hidden;
  transform: translateX(-100%);
  transition: transform 0.32s cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
}
.sme-wrap.is-open .sme-drawer { transform: translateX(0); }

/* ── Panels ──────────────────────────────────────────────── */
.sme-panel {
  display: none;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}
.sme-panel.is-active { display: flex; }

/* ── Panel head ──────────────────────────────────────────── */
.sme-panel__head {
  display: flex;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid #eee;
  min-height: 56px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.sme-panel__title { font-size: 15px; font-weight: 700; color: #111; }

.sme-close {
  margin-left: auto;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: #888;
  padding: 4px 8px;
  border-radius: 4px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.sme-close:hover { color: #111; background: #f5f5f5; }

.sme-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  cursor: pointer;
  padding: 4px 0;
  line-height: 1;
}
.sme-back:hover  { color: #555; background: transparent; }
.sme-back:focus  { outline: none; box-shadow: none; background: transparent; color: inherit; }
.sme-back:active { outline: none; box-shadow: none; background: transparent; color: inherit; }

/* ── List ────────────────────────────────────────────────── */
.sme-list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  overflow-y: auto;
  flex: 1;
  width: 100%;
  box-sizing: border-box;
}
.sme-list li { margin: 0; padding: 0; }

/* ── Items ───────────────────────────────────────────────── */
.sme-item {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;  /* always left-align */
  width: 100%;
  box-sizing: border-box;
  padding: 13px 20px;
  font-size: 15px;
  color: #222;
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.sme-item:hover  { background: #f9f9f9; }
.sme-item:focus  { outline: none; box-shadow: none; background: transparent; color: inherit; }
.sme-item:active { outline: none; box-shadow: none; background: #f0f0f0;    color: inherit; }
.sme-item--has-children:focus  { outline: none; box-shadow: none; background: transparent; color: inherit; }
.sme-item--has-children:active { outline: none; box-shadow: none; background: #f0f0f0;    color: inherit; }

/* Label fills remaining space — keeps chevron pinned to the right */
.sme-item-label { flex: 1; }

/* ── Chevron ─────────────────────────────────────────────── */
.sme-chevron { color: #bbb; font-size: 13px; flex-shrink: 0; margin-left: auto; }
.sme-chevron--left { color: #555; margin-left: 0; }

/* ── Icons ───────────────────────────────────────────────── */
.sme-icon {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  font-size: 15px;
  /*
   * For font icons (Font Awesome, Dashicons):
   *   color: #005cad;
   *
   * For uploaded image icons, color has no effect.
   * Use filter instead, e.g:
   *   filter: invert(30%) sepia(1) saturate(5) hue-rotate(190deg);
   */
}

/* ── Uploaded image icon ─────────────────────────────────── */
.sme-icon--img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

/* ── Image items ─────────────────────────────────────────── */
.sme-item--image {
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 8px 12px;
  border-bottom: 1px solid #f2f2f2;
}

.sme-image {
  display: block !important;
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 100% !important;
  object-fit: contain !important;
  flex-shrink: 0;
}
