/**
 * HyperMarket M3 — SmartBar
 * assets/css/smartbar.css
 */

/* ── container ── */
.hm-smartbar {
  position: fixed;
  bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  z-index: 990;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 12px 4px;
  pointer-events: none;
}

/* ── bar پایه ── */
.hm-smartbar__bar {
  width: 100%;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,.13);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: all;
  /* انیمیشن ورود */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .3s cubic-bezier(.2,.8,.4,1),
              transform .3s cubic-bezier(.2,.8,.4,1);
}
.hm-smartbar__bar--visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── رنگ هر bar ── */
.hm-smartbar__bar--delivery {
  background: rgba(22,163,74,.92);
  color: #fff;
}
.hm-smartbar__bar--register {
  background: rgba(26,26,46,.92);
  color: #fff;
}
.hm-smartbar__bar--custom {
  background: rgba(255,193,7,.95);
  color: #1a1a2e;
}

/* ── دکمه بستن ── */
.hm-smartbar__close {
  position: absolute;
  top: 8px; left: 8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: inherit;
  padding: 0;
}
.hm-smartbar__close .material-symbols-rounded { font-size: 14px; }

/* ── بار ارسال رایگان ── */
.hm-smartbar__delivery-done {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
}
.hm-smartbar__delivery-done .material-symbols-rounded { font-size: 20px; }

.hm-smartbar__delivery-progress {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.hm-smartbar__delivery-text {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
}
.hm-smartbar__delivery-text .material-symbols-rounded { font-size: 18px; opacity: .9; }
.hm-smartbar__delivery-text strong { font-weight: 800; }
.hm-smartbar__delivery-pct {
  margin-right: auto;       /* چپ در RTL = آخر ردیف */
  font-size: 12px;
  opacity: .75;
  font-weight: 700;
  font-feature-settings: "tnum";
}

/* نوار پیشرفت */
.hm-smartbar__progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.25);
  border-radius: 999px;
  overflow: hidden;
}
.hm-smartbar__progress-fill {
  height: 100%;
  border-radius: 999px;
  background: #fff;
  transition: width .5s cubic-bezier(.4,0,.2,1);
  min-width: 4px;
}

/* ── بار ثبت‌نام ── */
.hm-smartbar__register {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 28px;    /* فضا برای دکمه بستن */
}
.hm-smartbar__register-ico {
  font-size: 22px;
  color: #FFC107;
  flex-shrink: 0;
}
.hm-smartbar__register-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.hm-smartbar__register-text strong {
  font-size: 13px;
  font-weight: 800;
}
.hm-smartbar__register-text span {
  font-size: 11.5px;
  opacity: .7;
}
.hm-smartbar__register-btn {
  flex-shrink: 0;
  background: #FFC107;
  color: #1a1a2e;
  font-size: 12.5px;
  font-weight: 800;
  padding: 7px 16px;
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .15s;
}
.hm-smartbar__register-btn:hover { opacity: .88; }

/* ── بار سفارشی ── */
.hm-smartbar__custom {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 28px;
}
.hm-smartbar__custom .material-symbols-rounded {
  font-size: 20px;
  flex-shrink: 0;
}
.hm-smartbar__custom-text {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
}
.hm-smartbar__custom-link {
  font-size: 12px;
  font-weight: 800;
  color: inherit;
  text-decoration: underline;
  white-space: nowrap;
}

/* ── مخفی کردن SmartBar در صفحات خاص ── */
body.page-template-blank .hm-smartbar { display: none; }
