/* مودال النجاح */
:root{ --green:#00ab61; }
.success-modal{ background: linear-gradient(180deg,#fff,#f9fafb); border-radius:18px; }
.success-hero{ width:96px; height:96px; display:grid; place-items:center; border-radius:50%;
  background: radial-gradient(closest-side, #eafff4, #ffffff); }
.success-svg{ width:78px; height:78px; }
.success-svg .ring{ fill:none; stroke: rgba(0,171,97,.15); stroke-width:8; }
.success-svg .tick{
  fill:none; stroke:var(--green); stroke-width:8; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:120; stroke-dashoffset:120; animation: draw 700ms 120ms ease forwards;
  filter: drop-shadow(0 3px 6px rgba(0,171,97,.35));
}
@keyframes draw{ to{ stroke-dashoffset:0; } }
.success-progress{ height:4px; background:#eef2f7; overflow:hidden; border-radius:0 0 18px 18px; }
.success-progress span{ display:block; height:100%; width:0%; background:linear-gradient(90deg,#22c55e,#16a34a,#22c55e); transition:width linear; }

/* Order modal: fixed shell, scrollable body */
#customerModal .modal-content{
  max-height: 90vh;
}
#customerModal .modal-body{
  overflow-y: auto;
}
.address-preview{
  min-height: 48px;
  padding: .65rem .8rem;
  border: 1px dashed #c8d3df;
  border-radius: 12px;
  background: #f8fbff;
  color: #1f3346;
  font-size: .93rem;
  line-height: 1.45;
  word-break: break-word;
}
html.order-modal-open #customerModal,
body.order-modal-open #customerModal{
  z-index: 2147483646;
}
html.order-modal-open .modal-backdrop,
body.order-modal-open .modal-backdrop{
  z-index: 2147483645;
}
html.location-picker-open #locationPickerModal,
body.location-picker-open #locationPickerModal{
  z-index: 2147483646;
}
html.location-picker-open .modal-backdrop,
body.location-picker-open .modal-backdrop{
  z-index: 2147483645;
}

/* Address picker modal */
.location-picker-modal{
  border-radius: 24px;
  overflow: hidden;
  --lp-accent: var(--warm-1, #f6a623);
  --lp-accent-2: var(--warm-2, #f59e1b);
  --lp-ink: var(--brand-2, #244b68);
  --lp-ink-soft: rgba(36, 75, 104, .24);
}
.location-picker-modal .modal-body{
  display: flex;
  flex-direction: column;
  min-height: min(86vh, 760px);
  overflow: hidden;
  background: #eef1f4;
}
.location-tools{
  background: #fff;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 190px;
  overflow: hidden;
  margin-top: -18px;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 28px rgba(18, 35, 54, .12);
}
.location-map-wrap{
  position: relative;
  flex: 0 0 48%;
  min-height: 280px;
  transition: min-height .2s ease, flex-basis .2s ease;
}
.location-sheet-title{
  margin: 0;
  font-weight: 800;
  color: var(--lp-ink);
  font-size: clamp(1.05rem, .95vw + .8rem, 1.32rem);
}
.location-gps-btn{
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 510;
  border: 0;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .96);
  color: #1f3346;
  font-weight: 700;
  font-size: 1.2rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(20, 41, 61, .18);
  backdrop-filter: blur(2px);
  transition: transform .16s ease, box-shadow .16s ease;
}
.location-gps-btn:hover{
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(20, 41, 61, .2);
}
.location-gps-btn:disabled{
  opacity: .7;
}
#location-picker-map{
  width: 100%;
  min-height: 280px;
  height: 48vh;
  background: #f3f5f7;
  transition: height .2s ease, min-height .2s ease;
}
.location-tools .input-group{
  border: 2px solid rgba(245, 166, 35, .42);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.location-tools .input-group:focus-within{
  border-color: var(--lp-accent);
  box-shadow: 0 0 0 4px rgba(245, 166, 35, .15);
}
.location-search-stack{
  position: relative;
  z-index: 1;
}
.location-tools .input-group .input-group-text{
  border: 0;
  background: transparent;
  color: var(--lp-ink);
  padding-inline: .95rem .4rem;
}
.location-tools .input-group .form-control{
  border: 0;
  min-height: 52px;
  font-size: 1rem;
}
.location-tools .input-group .form-control:focus{
  box-shadow: none;
}
.location-tools .input-group .btn{
  border: 0;
  background: transparent;
  color: var(--lp-ink);
  padding-inline: .8rem;
}
.location-search-results{
  position: relative;
  margin-top: 8px;
  min-height: 0;
  max-height: min(34vh, 260px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(36, 75, 104, .16);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 16px rgba(24, 38, 55, .08);
}
.location-picker-modal.search-active .location-map-wrap{
  flex-basis: 34%;
  min-height: 180px;
}
.location-picker-modal.search-active #location-picker-map{
  height: 33vh;
  min-height: 180px;
}
.location-picker-modal.search-active .location-search-results{
  max-height: min(44vh, 360px);
}
.location-result-item{
  width: 100%;
  border: 0;
  background: transparent;
  text-align: start;
  padding: .62rem .7rem;
  color: #2f3742;
  border-bottom: 1px solid #eef1f4;
}
.location-result-item:hover{
  background: #fff8eb;
}
.location-result-item:last-child{
  border-bottom: 0;
}
.location-result-row{
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.location-result-pin{
  flex: 0 0 auto;
  font-size: .98rem;
  line-height: 1.2;
  margin-top: 2px;
}
.location-result-text{
  flex: 1 1 auto;
  min-width: 0;
}
.location-result-title{
  display: block;
  font-weight: 700;
  margin-bottom: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.25;
  max-height: 2.5em;
}
.location-result-sub{
  display: block;
  font-size: .86rem;
  color: #66707b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  line-height: 1.25;
  max-height: 2.5em;
}
.location-result-city{
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 24px;
  padding: 0 .45rem;
  border-radius: 999px;
  border: 1px solid #f2c167;
  background: #fff3dc;
  color: #6b4300;
  font-size: .74rem;
  font-weight: 700;
  line-height: 1;
}
.location-empty{
  padding: .75rem;
  color: #6f7a86;
  font-size: .9rem;
  text-align: center;
}
.location-picked-label{
  min-height: 40px;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: #3b4a58;
  line-height: 1.4;
  font-size: .92rem;
}
.location-confirm-btn{
  border: 0;
  border-radius: 16px;
  min-height: 54px;
  font-weight: 800;
  font-size: 1.08rem;
  background: linear-gradient(90deg, var(--lp-accent), var(--lp-accent-2));
  box-shadow: 0 12px 24px rgba(245, 166, 35, .28);
  color: #3b2500;
}
.location-confirm-btn:hover{
  filter: brightness(1.03);
  box-shadow: 0 16px 28px rgba(245, 166, 35, .34);
  color: #3b2500;
}
.location-confirm-btn:disabled{
  background: #f2d9a3;
  box-shadow: none;
  color: #7b6740;
}

/* City selector */
.city-section{ margin-top: 6px; }
.city-strip{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.city-strip::-webkit-scrollbar{ display:none; }
.city-input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.city-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-direction: column;
  gap: 2px;
  min-height: 46px;
  padding: .5rem .95rem;
  border-radius: 16px;
  border: 2px solid #d6d6d6;
  font-weight: 700;
  color: #333;
  background: #fff;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease, color .12s ease;
  user-select: none;
  white-space: nowrap;
}
.city-price{
  font-size: 12px;
  font-weight: 600;
  opacity: .85;
}
.city-strip .city-chip{
  background: #e1e1e1;
  border-color: #e1e1e1;
  color: #555;
}
.city-input:checked + .city-chip{
  background: var(--warm-1, #f6a623);
  border-color: var(--warm-1, #f6a623);
  color: #fff;
  box-shadow: 0 8px 18px rgba(245,166,35,.28);
}
.city-input:focus + .city-chip{
  outline: 2px solid rgba(245,166,35,.35);
  outline-offset: 2px;
}

/* Pickup slot selector (checkout modal) */
.pickup-section{
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}
.pickup-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-bottom: 6px;
  color: #222;
}
.pickup-icon{ font-size: 1.05rem; }
.pickup-block{ margin-top: 10px; }
.pickup-subtitle{
  font-size: .9rem;
  font-weight: 700;
  color: #444;
  margin-bottom: 8px;
}
.pickup-strip{
  display:flex;
  gap:10px;
  overflow-x:auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.pickup-strip::-webkit-scrollbar{ display:none; }
.pickup-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.pickup-input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}
.pickup-chip{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height: 46px;
  padding: .5rem .95rem;
  border-radius: 16px;
  border: 2px solid #d6d6d6;
  font-weight: 700;
  color: #333;
  background: #fff;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, border-color .12s ease, color .12s ease;
  user-select: none;
  white-space: nowrap;
}
.pickup-strip .pickup-chip{
  background: #e1e1e1;
  border-color: #e1e1e1;
  color: #555;
}
.pickup-strip .pickup-input:checked + .pickup-chip{
  background: var(--warm-1, #f6a623);
  border-color: var(--warm-1, #f6a623);
  color: #fff;
  box-shadow: 0 8px 18px rgba(245,166,35,.28);
}
.pickup-grid .pickup-chip{
  background: #fff;
  border-color: #d7d7d7;
}
.pickup-grid .pickup-input:checked + .pickup-chip{
  background: #ffe3b3;
  border-color: var(--warm-1, #f6a623);
  color: #3b2500;
}
.pickup-input:focus + .pickup-chip{
  outline: 2px solid rgba(245,166,35,.35);
  outline-offset: 2px;
}
@media (max-width: 360px){
  .pickup-grid{ grid-template-columns: 1fr; }
}
@media (max-width: 575.98px){
  .location-picker-modal .modal-body{
    min-height: 100vh;
  }
  .location-tools{
    margin-top: -14px;
    border-radius: 22px 22px 0 0;
  }
  #location-picker-map{
    height: 45vh;
    min-height: 240px;
  }
  .location-picker-modal.search-active #location-picker-map{
    height: 28vh;
    min-height: 160px;
  }
  .location-gps-btn{
    right: 10px;
    bottom: 10px;
    width: 42px;
    height: 42px;
    font-size: 1.05rem;
  }
  .location-search-results{ max-height: min(30vh, 250px); }
  .location-picker-modal.search-active .location-search-results{
    max-height: min(40vh, 320px);
  }
}
