/* Copyright (c) almtwer. All rights reserved. */

:root {
  --ecp-shell: #262d33;
  --ecp-shell-2: #171a1d;
  --ecp-border: rgba(73, 120, 248, 0.42);
  --ecp-card: #313953;
  --ecp-card-2: #2b3248;
  --ecp-field: #2c3550;
  --ecp-field-border: rgba(111, 133, 203, 0.46);
  --ecp-text: #ffffff;
  --ecp-muted: #aeb8d1;
  --ecp-yellow: #f1c91b;
  --ecp-green: #26cf75;
  --ecp-shadow: 0 32px 80px rgba(0, 0, 0, 0.62);
}

.ecp-floating-launcher,
.ecp-modal,
.ecp-overlay,
.ecp-image-lightbox {
  font-family: "Cairo", "Tajawal", Tahoma, Arial, sans-serif;
}

.ecp-floating-launcher,
.ecp-floating-launcher *,
.ecp-modal,
.ecp-modal *,
.ecp-image-lightbox,
.ecp-image-lightbox * {
  box-sizing: border-box;
}

.ecp-floating-launcher button,
.ecp-modal button,
.ecp-modal input,
.ecp-modal select {
  font: inherit;
}

.ecp-floating-launcher {
  position: fixed;
  left: 8px;
  bottom: 70px;
  z-index: 999998;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  direction: ltr;
  cursor: pointer;
  user-select: none;
  isolation: isolate;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .12));
  transition: transform .18s ease, filter .18s ease;
  will-change: transform;
}

.ecp-floating-launcher:hover,
.ecp-floating-launcher:focus-visible {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 13px 16px rgba(0, 0, 0, .16));
}

.ecp-floating-trigger__pill {
  position: relative;
  min-width: 108px;
  min-height: 39px;
  padding: 7px 15px 7px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, #b655db 0%, #8e43bf 100%);
  color: #fff;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 10px 18px rgba(126, 65, 166, .34),
    inset 0 1px 0 rgba(255, 255, 255, .24);
  transform-origin: 100% 50%;
  animation: ecp-pill-nudge 3.2s ease-in-out infinite;
}

.ecp-floating-trigger__pill::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translateY(-50%) rotate(45deg);
  background: #9646c3;
  border-radius: 4px 0 0 4px;
  box-shadow: -2px 2px 3px rgba(126, 65, 166, .12);
}

.ecp-floating-trigger__text {
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -.2px;
  color: #fff !important;
  text-shadow: 0 1px 0 rgba(0,0,0,.12);
}

.ecp-floating-trigger__sub {
  margin-top: 4px;
  font-size: 9px;
  line-height: 1;
  font-weight: 800;
  color: #fff8ff;
  opacity: .96;
}

.ecp-floating-trigger__icon-box {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffdc3f 0%, #f3c617 100%);
  border: 4px solid rgba(255, 255, 255, .98);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, .20),
    inset 0 1px 0 rgba(255, 255, 255, .34);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-4deg);
  transform-origin: 50% 78%;
  animation: ecp-icon-wiggle 2.45s ease-in-out infinite;
  will-change: transform;
}

.ecp-floating-trigger__icon-box::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 18px;
  border: 2px solid rgba(255, 216, 63, .28);
  opacity: 0;
  animation: ecp-icon-pulse 2.45s ease-out infinite;
  pointer-events: none;
}

.ecp-floating-trigger__face,
.ecp-floating-trigger__face svg {
  width: 30px;
  height: 30px;
  display: block;
}

.ecp-floating-trigger__face svg * {
  vector-effect: non-scaling-stroke;
}

.ecp-floating-trigger__badge {
  position: absolute;
  top: -8px;
  right: -7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(180deg, #ff594e 0%, #e63d39 100%);
  color: #fff;
  border: 3px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  font-weight: 900;
  box-shadow: 0 4px 8px rgba(0, 0, 0, .18);
  animation: ecp-badge-pop 2.45s ease-in-out infinite;
  z-index: 2;
}

@keyframes ecp-pill-nudge {
  0%, 56%, 100% { transform: translate3d(0, 0, 0) rotate(0deg); }
  62% { transform: translate3d(-2px, 0, 0) rotate(-1.2deg); }
  68% { transform: translate3d(1px, 0, 0) rotate(.8deg); }
  74% { transform: translate3d(0, 0, 0) rotate(0deg); }
}

@keyframes ecp-icon-wiggle {
  0%, 54%, 100% { transform: translate3d(0, 0, 0) rotate(-4deg) scale(1); }
  60% { transform: translate3d(0, -2px, 0) rotate(-10deg) scale(1.03); }
  66% { transform: translate3d(1px, 0, 0) rotate(6deg) scale(1.02); }
  72% { transform: translate3d(-1px, 0, 0) rotate(-8deg) scale(1.02); }
  78% { transform: translate3d(0, -1px, 0) rotate(3deg) scale(1.01); }
  84% { transform: translate3d(0, 0, 0) rotate(-4deg) scale(1); }
}

@keyframes ecp-icon-pulse {
  0%, 58%, 100% { opacity: 0; transform: scale(.92); }
  68% { opacity: .8; transform: scale(1); }
  90% { opacity: 0; transform: scale(1.12); }
}

@keyframes ecp-badge-pop {
  0%, 55%, 100% { transform: scale(1); }
  64% { transform: scale(1.22); }
  75% { transform: scale(.96); }
  85% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .ecp-floating-trigger__pill,
  .ecp-floating-trigger__icon-box,
  .ecp-floating-trigger__icon-box::after,
  .ecp-floating-trigger__badge {
    animation: none !important;
  }
}

.ecp-overlay {
  position: fixed;
  inset: 0;
  z-index: 999998;
  background: rgba(0, 0, 0, .58);
  backdrop-filter: blur(3px);
}

.ecp-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(590px, calc(100vw - 26px));
  max-height: calc(100vh - 26px);
  overflow: visible;
  z-index: 999999;
  direction: rtl;
}

.ecp-modal__inner {
  position: relative;
  overflow: hidden;
  padding: 18px 14px 14px;
  border-radius: 24px;
  border: 1.5px solid var(--ecp-border);
  background:
    radial-gradient(circle at 50% -10%, rgba(82, 109, 180, .25), transparent 38%),
    linear-gradient(180deg, var(--ecp-shell) 0%, var(--ecp-shell-2) 100%);
  box-shadow: var(--ecp-shadow), inset 0 1px 0 rgba(255, 255, 255, .05);
  color: var(--ecp-text);
}

.ecp-close {
  position: absolute;
  top: -18px;
  left: -18px;
  z-index: 12;
  width: 68px;
  height: 38px;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.98);
  border-radius: 999px;
  background: linear-gradient(180deg, #f5664f 0%, #eb533e 100%);
  color: transparent !important;
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
  appearance: none;
  overflow: visible;
}

.ecp-close::before,
.ecp-close::after {
  content: '';
  position: absolute;
  width: 14px;
  height: 3px;
  border-radius: 999px;
  background: #ffffff;
  top: 50%;
  left: 50%;
  transform-origin: center;
}

.ecp-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.ecp-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.ecp-close:hover,
.ecp-close:focus-visible {
  transform: translateY(-1px);
}
.ecp-title {
  margin: 0 38px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff !important;
  font-size: 19px;
  line-height: 1.2;
  font-weight: 900;
}

.ecp-title__icon {
  font-size: 18px;
  opacity: .9;
}

.ecp-tabs {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  direction: ltr;
  padding: 4px 0 12px;
  margin-bottom: 10px;
}

.ecp-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0 0 0 -8px;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transition: transform .16s ease, filter .16s ease;
}

.ecp-tab:first-child { margin-left: 0; }
.ecp-tab:nth-child(odd) { transform: rotate(-4deg); }
.ecp-tab:nth-child(even) { transform: rotate(3deg); }
.ecp-tab:hover { filter: brightness(1.03); }
.ecp-tab.is-active { z-index: 4; }

.ecp-tab__shell {
  min-width: 122px;
  height: 48px;
  padding: 6px 12px;
  border-radius: 13px;
  border: 2px solid rgba(255,255,255,.14);
  background: var(--ecp-tab-color, #a95dd7);
  box-shadow: inset 0 -7px 0 rgba(0,0,0,.18), 0 10px 18px rgba(0,0,0,.26);
  color: #fff !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  filter: saturate(.94) brightness(.96);
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, filter .16s ease;
}

.ecp-tab__icon { font-size: 16px; line-height: 1; }
.ecp-tab__label { font-size: 14px; line-height: 1; font-weight: 900; }

.ecp-tab.is-active .ecp-tab__shell {
  transform: translateY(-6px);
  border-color: rgba(255,255,255,.95);
  box-shadow: inset 0 -7px 0 rgba(0,0,0,.14), 0 16px 28px rgba(0,0,0,.34);
  filter: none;
}

.ecp-intro {
  margin: 0 10px 10px;
  padding: 9px 12px;
  border-radius: 4px;
  border: 1px dashed #d7a60f;
  background: rgba(239, 192, 18, .03);
  color: #f4c53a !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
}

.ecp-panels {
  margin: 0 -14px;
  padding: 0 14px 12px;
  border-top: 1px solid rgba(255,255,255,.06);
  border-bottom: 1px solid rgba(255,255,255,.06);
  max-height: 350px;
  overflow: hidden;
}

.ecp-panel {
  display: none;
  max-height: 246px;
  overflow-y: auto;
  padding: 12px 10px 0 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.65) transparent;
}

.ecp-panel.is-active { display: block; }
.ecp-panel::-webkit-scrollbar { width: 8px; }
.ecp-panel::-webkit-scrollbar-track { background: transparent; }
.ecp-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,.65); border-radius: 999px; }

.ecp-products {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 12px;
}

.ecp-product-card {
  direction: ltr;
  display: grid;
  grid-template-columns: 100px 1fr 76px;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(103,127,201,.22);
  background: linear-gradient(180deg, var(--ecp-card) 0%, var(--ecp-card-2) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.ecp-product-card.has-qty {
  border-color: rgba(247,206,58,.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04), 0 0 0 1px rgba(247,206,58,.12);
}

.ecp-qty-box {
  width: 92px;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 14px;
  border: 1px solid rgba(106,121,179,.18);
  background: #0c1018;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.ecp-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  background: #36405d;
  color: #fff !important;
  font-size: 21px;
  line-height: 1;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  appearance: none;
  padding: 0;
}

.ecp-qty-count {
  min-width: 16px;
  color: #fff !important;
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
  text-align: center;
}

.ecp-product-content {
  min-width: 0;
  direction: rtl;
  text-align: right;
}

.ecp-product-title {
  margin: 0 0 4px;
  color: #fff !important;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 900;
}

.ecp-product-subtitle {
  margin: 0 0 6px;
  color: var(--ecp-muted) !important;
  font-size: 11px;
  line-height: 1.3;
}

.ecp-product-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--ecp-yellow);
  color: #151100 !important;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
}

.ecp-product-thumb {
  position: relative;
  width: 64px;
  height: 64px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 12px;
  background: #65552f;
  cursor: pointer;
  appearance: none;
}

.ecp-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ecp-zoom {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.96);
  background: #9154ca;
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
}

.ecp-form-row {
  direction: ltr;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.ecp-field { position: relative; }

.ecp-input {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  border: 1px solid var(--ecp-field-border);
  background: var(--ecp-field) !important;
  color: #fff !important;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  padding: 0 14px;
  font-size: 14px;
}

.ecp-input::placeholder { color: #96a4c6; }
.ecp-field--name .ecp-input,
.ecp-field--select .ecp-input { direction: rtl; text-align: right; }
.ecp-field--select .ecp-input { padding-right: 28px; padding-left: 26px; appearance: none; cursor: pointer; }

.ecp-field--select::after {
  content: "▾";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-52%);
  color: #a4b0cc;
  font-size: 12px;
  line-height: 1;
  pointer-events: none;
}

.ecp-field__icon--pin {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-52%);
  pointer-events: none;
  font-size: 13px;
}

.ecp-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 10px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(180deg, #29d275 0%, #1eb86a 100%);
  color: #fff !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 24px rgba(31,190,105,.24);
  font-size: 16px;
  line-height: 1.1;
  font-weight: 900;
  cursor: pointer;
  appearance: none;
}

.ecp-submit__wa,
.ecp-submit__wa svg {
  width: 27px;
  height: 27px;
  display: block;
}

.ecp-footer-note {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ecp-footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #cfd7ea !important;
  font-size: 11px;
  line-height: 1;
}

.ecp-empty {
  padding: 18px;
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  color: #d3dcef !important;
  text-align: center;
}

.ecp-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000000;
  background: rgba(0, 0, 0, .84);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.ecp-image-lightbox img {
  max-width: min(760px, 100%);
  max-height: calc(100vh - 50px);
  border-radius: 16px;
  display: block;
}

.ecp-image-lightbox__close {
  position: absolute;
  top: 18px;
  left: 18px;
  width: 54px;
  height: 54px;
  padding: 0;
  border: 2px solid rgba(255,255,255,.98);
  border-radius: 50%;
  background: linear-gradient(180deg, #f5664f 0%, #eb533e 100%);
  color: transparent !important;
  font-size: 0;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  appearance: none;
  box-shadow: 0 10px 18px rgba(0,0,0,.22);
}

.ecp-image-lightbox__close::before,
.ecp-image-lightbox__close::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: #fff;
  transform-origin: center;
}

.ecp-image-lightbox__close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.ecp-image-lightbox__close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

body.ecp-no-scroll { overflow: hidden; }
[hidden] { display: none !important; }

@media (min-width: 601px) and (max-width: 1024px) {
  .ecp-floating-launcher {
    left: max(12px, env(safe-area-inset-left));
    bottom: calc(88px + env(safe-area-inset-bottom));
    gap: 7px;
    max-width: calc(100vw - 24px);
  }

  .ecp-floating-trigger__pill {
    min-width: 100px;
    min-height: 37px;
    padding: 7px 13px 7px 16px;
    border-radius: 19px;
  }

  .ecp-floating-trigger__pill::before {
    left: -5px;
    width: 13px;
    height: 13px;
    border-radius: 3px 0 0 3px;
  }

  .ecp-floating-trigger__text {
    font-size: 11px;
    white-space: nowrap;
  }

  .ecp-floating-trigger__sub {
    margin-top: 3px;
    font-size: 8px;
    white-space: nowrap;
  }

  .ecp-floating-trigger__icon-box {
    width: 48px;
    height: 48px;
    border-radius: 13px;
  }

  .ecp-floating-trigger__icon-box::after {
    inset: -5px;
    border-radius: 17px;
  }

  .ecp-floating-trigger__face,
  .ecp-floating-trigger__face svg {
    width: 28px;
    height: 28px;
  }

  .ecp-floating-trigger__badge {
    top: -7px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-width: 2px;
    font-size: 9px;
  }
}

@media (max-width: 600px) {
  .ecp-floating-launcher {
    left: max(10px, env(safe-area-inset-left));
    bottom: calc(86px + env(safe-area-inset-bottom));
    gap: 6px;
    max-width: calc(100vw - 20px);
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .13));
  }

  .ecp-floating-trigger__pill {
    min-width: 94px;
    min-height: 35px;
    padding: 6px 11px 6px 14px;
    border-radius: 18px;
  }

  .ecp-floating-trigger__pill::before {
    left: -5px;
    width: 12px;
    height: 12px;
    border-radius: 3px 0 0 3px;
  }

  .ecp-floating-trigger__text {
    font-size: 10.8px;
    letter-spacing: -.15px;
    white-space: nowrap;
  }

  .ecp-floating-trigger__sub {
    margin-top: 3px;
    font-size: 7.8px;
    white-space: nowrap;
  }

  .ecp-floating-trigger__icon-box {
    width: 46px;
    height: 46px;
    border-width: 3px;
    border-radius: 13px;
  }

  .ecp-floating-trigger__icon-box::after {
    inset: -5px;
    border-radius: 16px;
  }

  .ecp-floating-trigger__face,
  .ecp-floating-trigger__face svg {
    width: 27px;
    height: 27px;
  }

  .ecp-floating-trigger__badge {
    top: -7px;
    right: -6px;
    width: 18px;
    height: 18px;
    border-width: 2px;
    font-size: 8.5px;
  }

  .ecp-modal { width: min(500px, calc(100vw - 18px)); max-height: calc(100vh - 18px); }
  .ecp-close { top: -12px; left: -2px; width: 58px; height: 34px; font-size: 22px; }
  .ecp-modal__inner { padding: 16px 10px 14px; border-radius: 22px; }
  .ecp-title { margin: 0 28px 12px; font-size: 17px; }
  .ecp-tabs { justify-content: flex-start; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
  .ecp-tabs::-webkit-scrollbar { display: none; }
  .ecp-tab__shell { min-width: 106px; height: 46px; }
  .ecp-panels { margin: 0 -10px; padding: 0 10px 12px; }
  .ecp-panel { max-height: 228px; }
  .ecp-product-card { grid-template-columns: 84px 1fr 64px; gap: 10px; padding: 8px; }
  .ecp-qty-box { width: 80px; padding: 8px; }
  .ecp-product-title { font-size: 15px; }
  .ecp-product-subtitle { font-size: 10px; }
  .ecp-product-thumb { width: 58px; height: 58px; }
  .ecp-form-row { grid-template-columns: 1fr; }
  .ecp-submit { min-height: 46px; font-size: 15px; }
  .ecp-footer-note { gap: 8px; }
}

@media (max-width: 380px) {
  .ecp-floating-launcher {
    left: max(8px, env(safe-area-inset-left));
    bottom: calc(82px + env(safe-area-inset-bottom));
    gap: 5px;
  }

  .ecp-floating-trigger__pill {
    min-width: 86px;
    min-height: 33px;
    padding: 6px 9px 6px 12px;
  }

  .ecp-floating-trigger__text { font-size: 9.8px; }
  .ecp-floating-trigger__sub { font-size: 7px; }

  .ecp-floating-trigger__icon-box {
    width: 43px;
    height: 43px;
    border-radius: 12px;
  }

  .ecp-floating-trigger__face,
  .ecp-floating-trigger__face svg {
    width: 25px;
    height: 25px;
  }

  .ecp-floating-trigger__badge {
    width: 17px;
    height: 17px;
    font-size: 8px;
  }
}

@media (hover: none) and (pointer: coarse) {
  .ecp-floating-launcher:hover,
  .ecp-floating-launcher:focus-visible {
    transform: none;
    filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .13));
  }
}
