/* ============================================
   DAWRAK - دورك | استلم بدون انتظار
   Main Frontend Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');

:root {
  --dw-primary:    #FF6B35;
  --dw-primary-d:  #E55520;
  --dw-secondary:  #1A1A2E;
  --dw-accent:     #F7C59F;
  --dw-success:    #2ECC71;
  --dw-warning:    #F39C12;
  --dw-danger:     #E74C3C;
  --dw-bg:         #F8F9FA;
  --dw-card:       #FFFFFF;
  --dw-text:       #2C2C2C;
  --dw-muted:      #8D8D8D;
  --dw-border:     #EBEBEB;
  --dw-radius:     16px;
  --dw-shadow:     0 4px 24px rgba(0,0,0,0.08);
  --dw-shadow-lg:  0 8px 40px rgba(0,0,0,0.14);
  --dw-font:       'Tajawal', sans-serif;
}

* { box-sizing: border-box; }

.dawrak-wrap {
  font-family: var(--dw-font);
  direction: rtl;
  color: var(--dw-text);
  background: var(--dw-bg);
  min-height: 100vh;
  padding: 0;
  margin: 0;
}

/* ---- HERO HEADER ---- */
.dw-hero {
  background: linear-gradient(135deg, var(--dw-secondary) 0%, #16213E 60%, #0F3460 100%);
  padding: 60px 24px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.dw-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 50%, rgba(255,107,53,.25) 0%, transparent 60%);
}
.dw-hero-logo {
  font-size: 2.8rem;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.dw-hero-logo span { color: var(--dw-primary); }
.dw-hero-sub {
  color: rgba(255,255,255,.65);
  font-size: 1.05rem;
  font-weight: 400;
}

/* ---- CARDS ---- */
.dw-card {
  background: var(--dw-card);
  border-radius: var(--dw-radius);
  box-shadow: var(--dw-shadow);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--dw-border);
  transition: box-shadow .25s, transform .25s;
}
.dw-card:hover { box-shadow: var(--dw-shadow-lg); transform: translateY(-2px); }
.dw-card-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--dw-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dw-card-title::before {
  content: '';
  width: 4px; height: 22px;
  background: var(--dw-primary);
  border-radius: 4px;
  display: inline-block;
}

/* ---- FORM ELEMENTS ---- */
.dw-form-group { margin-bottom: 18px; }
.dw-label {
  display: block;
  font-size: .9rem;
  font-weight: 600;
  color: var(--dw-secondary);
  margin-bottom: 8px;
}
.dw-label span { color: var(--dw-primary); }
.dw-input, .dw-select, .dw-textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--dw-border);
  border-radius: 12px;
  font-family: var(--dw-font);
  font-size: .95rem;
  color: var(--dw-text);
  background: #FAFAFA;
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  direction: rtl;
}
.dw-input:focus, .dw-select:focus, .dw-textarea:focus {
  border-color: var(--dw-primary);
  box-shadow: 0 0 0 4px rgba(255,107,53,.12);
  background: #fff;
}

/* ---- BUTTONS ---- */
.dw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  font-family: var(--dw-font);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}
.dw-btn-primary {
  background: linear-gradient(135deg, var(--dw-primary) 0%, var(--dw-primary-d) 100%);
  color: #fff;
  box-shadow: 0 4px 16px rgba(255,107,53,.35);
}
.dw-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(255,107,53,.45);
}
.dw-btn-secondary {
  background: var(--dw-secondary);
  color: #fff;
}
.dw-btn-outline {
  background: transparent;
  border: 2px solid var(--dw-primary);
  color: var(--dw-primary);
}
.dw-btn-sm { padding: 9px 18px; font-size: .88rem; }
.dw-btn-full { width: 100%; }
.dw-btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ---- LOCATION PICKER ---- */
.dw-location-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-family: var(--dw-font);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  margin-bottom: 12px;
  transition: all .2s;
}
.dw-location-btn:hover { opacity: .9; transform: translateY(-1px); }
.dw-location-status {
  padding: 10px 16px;
  background: rgba(46,204,113,.1);
  border: 1px solid rgba(46,204,113,.3);
  border-radius: 10px;
  font-size: .9rem;
  color: #27ae60;
  display: none;
}

/* ---- STORE CARDS ---- */
.dw-stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  padding: 24px;
}
.dw-store-card {
  background: var(--dw-card);
  border-radius: var(--dw-radius);
  overflow: hidden;
  box-shadow: var(--dw-shadow);
  cursor: pointer;
  transition: all .25s;
  border: 2px solid transparent;
}
.dw-store-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--dw-shadow-lg);
  border-color: var(--dw-primary);
}
.dw-store-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--dw-secondary), #16213e);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dw-store-cover img { width: 100%; height: 100%; object-fit: cover; }
.dw-store-logo {
  width: 60px; height: 60px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #fff;
  position: absolute;
  bottom: -22px; right: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.dw-store-logo img { width: 100%; height: 100%; object-fit: cover; }
.dw-store-info { padding: 30px 20px 18px; }
.dw-store-name { font-size: 1.1rem; font-weight: 800; margin-bottom: 6px; }
.dw-store-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .82rem;
  color: var(--dw-muted);
}
.dw-distance-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,107,53,.1);
  color: var(--dw-primary);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
}
.dw-prep-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(46,204,113,.1);
  color: var(--dw-success);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 700;
}

/* ---- MENU ---- */
.dw-menu-wrap { padding: 0 20px 40px; }
.dw-cat-tabs {
  display: flex;
  gap: 10px;
  padding: 16px 0;
  overflow-x: auto;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.dw-cat-tabs::-webkit-scrollbar { display: none; }
.dw-cat-tab {
  white-space: nowrap;
  padding: 9px 20px;
  border-radius: 24px;
  border: 2px solid var(--dw-border);
  background: #fff;
  font-family: var(--dw-font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  color: var(--dw-muted);
}
.dw-cat-tab.active, .dw-cat-tab:hover {
  background: var(--dw-primary);
  border-color: var(--dw-primary);
  color: #fff;
}
.dw-menu-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.dw-item-card {
  background: var(--dw-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--dw-shadow);
  border: 2px solid transparent;
  transition: all .2s;
  cursor: pointer;
}
.dw-item-card:hover { border-color: var(--dw-primary); transform: translateY(-2px); }
.dw-item-img {
  height: 160px;
  background: #f5f5f5;
  position: relative;
  overflow: hidden;
}
.dw-item-img img { width: 100%; height: 100%; object-fit: cover; }
.dw-low-stock-tag {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--dw-warning);
  color: #fff;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: .75rem;
  font-weight: 700;
}
.dw-item-body { padding: 14px 16px; }
.dw-item-name { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.dw-item-desc { font-size: .82rem; color: var(--dw-muted); margin-bottom: 12px; }
.dw-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dw-item-price { font-size: 1.1rem; font-weight: 900; color: var(--dw-primary); }
.dw-add-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--dw-primary);
  color: #fff;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  font-family: var(--dw-font);
}
.dw-add-btn:hover { background: var(--dw-primary-d); transform: scale(1.1); }

/* ---- CART ---- */
.dw-cart-fab {
  position: fixed;
  bottom: 30px;
  left: 24px;
  background: var(--dw-secondary);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 14px 24px;
  font-family: var(--dw-font);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,.3);
  display: none;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  transition: all .25s;
  animation: cartPop .3s ease;
}
.dw-cart-fab:hover { transform: translateY(-3px); }
.dw-cart-fab.show { display: flex; }
@keyframes cartPop { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dw-cart-count {
  background: var(--dw-primary);
  color: #fff;
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 900;
}

/* ---- DRAWER ---- */
.dw-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 2000;
  display: none;
  backdrop-filter: blur(3px);
}
.dw-overlay.show { display: block; }
.dw-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 28px 28px 0 0;
  z-index: 2001;
  padding: 20px 24px 40px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
.dw-drawer.show { transform: translateY(0); }
.dw-drawer-handle {
  width: 44px; height: 5px;
  background: var(--dw-border);
  border-radius: 10px;
  margin: 0 auto 20px;
}
.dw-drawer-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--dw-secondary);
}

/* ---- CART ITEMS ---- */
.dw-cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--dw-border);
}
.dw-cart-item-info { flex: 1; }
.dw-cart-item-name { font-weight: 700; font-size: .95rem; }
.dw-cart-item-price { font-size: .85rem; color: var(--dw-primary); font-weight: 600; margin-top: 2px; }
.dw-qty-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dw-qty-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--dw-border);
  background: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--dw-font);
  transition: all .15s;
}
.dw-qty-btn:hover { background: var(--dw-primary); border-color: var(--dw-primary); color: #fff; }
.dw-qty-val { font-weight: 700; font-size: 1rem; min-width: 24px; text-align: center; }
.dw-cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}
.dw-cart-total-price { color: var(--dw-primary); font-size: 1.4rem; font-weight: 900; }

/* ---- ORDER TRACKING ---- */
.dw-track-wrap { max-width: 560px; margin: 0 auto; padding: 24px 20px; }
.dw-order-header {
  text-align: center;
  padding: 30px 24px;
  background: linear-gradient(135deg, var(--dw-secondary), #0f3460);
  border-radius: 20px;
  color: #fff;
  margin-bottom: 28px;
}
.dw-order-num { font-size: 2rem; font-weight: 900; letter-spacing: 2px; }
.dw-order-store { font-size: .9rem; opacity: .7; margin-top: 4px; }
.dw-track-steps { position: relative; padding: 10px 0; }
.dw-track-line {
  position: absolute;
  right: 23px; top: 30px; bottom: 30px;
  width: 3px;
  background: var(--dw-border);
}
.dw-track-line-fill {
  position: absolute;
  right: 23px; top: 30px;
  width: 3px;
  background: linear-gradient(180deg, var(--dw-success), var(--dw-primary));
  transition: height .5s ease;
}
.dw-step {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 14px 0;
  position: relative;
}
.dw-step-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 3px solid var(--dw-border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all .3s;
  flex-shrink: 0;
  z-index: 1;
}
.dw-step.done .dw-step-icon {
  border-color: var(--dw-success);
  background: var(--dw-success);
}
.dw-step.active .dw-step-icon {
  border-color: var(--dw-primary);
  background: var(--dw-primary);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,53,.4); }
  50% { box-shadow: 0 0 0 12px rgba(255,107,53,0); }
}
.dw-step-text { padding-top: 10px; }
.dw-step-title { font-weight: 700; font-size: 1rem; }
.dw-step-desc { font-size: .85rem; color: var(--dw-muted); margin-top: 2px; }
.dw-step.done .dw-step-title { color: var(--dw-success); }
.dw-step.active .dw-step-title { color: var(--dw-primary); }

/* ---- ALERTS ---- */
.dw-alert {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: .92rem;
  font-weight: 500;
  margin-bottom: 18px;
  display: none;
  align-items: center;
  gap: 10px;
}
.dw-alert.show { display: flex; }
.dw-alert-success { background: rgba(46,204,113,.12); border: 1px solid rgba(46,204,113,.3); color: #1a8a4a; }
.dw-alert-error   { background: rgba(231,76,60,.1);   border: 1px solid rgba(231,76,60,.25);  color: #c0392b; }
.dw-alert-info    { background: rgba(52,152,219,.1);  border: 1px solid rgba(52,152,219,.25); color: #1a5f8a; }

/* ---- LOADING ---- */
.dw-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px;
  gap: 16px;
}
.dw-spinner {
  width: 44px; height: 44px;
  border: 4px solid var(--dw-border);
  border-top-color: var(--dw-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- NOTICE ---- */
.dawrak-notice {
  padding: 30px;
  text-align: center;
  background: var(--dw-card);
  border-radius: var(--dw-radius);
  box-shadow: var(--dw-shadow);
  font-family: var(--dw-font);
  color: var(--dw-muted);
}

/* ---- MODAL ---- */
.dw-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.dw-modal.show { display: flex; }
.dw-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
}
.dw-modal-box {
  background: #fff;
  border-radius: 24px;
  padding: 28px;
  max-width: 460px;
  width: 100%;
  position: relative;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: modalIn .3s ease;
}
@keyframes modalIn { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dw-modal-close {
  position: absolute;
  top: 16px; left: 16px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--dw-border);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}
.dw-modal-close:hover { background: var(--dw-danger); color: #fff; }

/* ---- OPTIONS CHECKBOXES ---- */
.dw-options-group { margin: 14px 0; }
.dw-option-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid var(--dw-border);
  cursor: pointer;
  margin-bottom: 8px;
  transition: all .15s;
  font-size: .92rem;
}
.dw-option-label input[type=checkbox],
.dw-option-label input[type=radio] { accent-color: var(--dw-primary); }
.dw-option-label:hover { border-color: var(--dw-primary); background: rgba(255,107,53,.05); }
.dw-option-extra { margin-right: auto; color: var(--dw-primary); font-weight: 700; font-size: .9rem; }

/* ---- EMPTY STATE ---- */
.dw-empty {
  text-align: center;
  padding: 60px 30px;
  color: var(--dw-muted);
}
.dw-empty-icon { font-size: 3.5rem; margin-bottom: 14px; }
.dw-empty-title { font-size: 1.2rem; font-weight: 700; color: var(--dw-secondary); margin-bottom: 6px; }
.dw-empty-desc { font-size: .9rem; }

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
  .dw-stores-grid, .dw-menu-items {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .dw-hero { padding: 40px 20px 60px; }
  .dw-hero-logo { font-size: 2rem; }
  .dw-card { padding: 20px; }
}
