:root {
  --main-bg: #ffffff;      /* 60% أبيض */
  --primary: #2d6cdf;      /* أزرق */
  --accent: #ff8c2a;       /* برتقالي */
  --text: #1a1a1a;
  --card: #f8f9fb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: sans-serif;
  background: var(--main-bg);
  color: var(--text);
  direction: rtl;
  overflow-x: hidden;
}

/* ===== HEADER ===== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: white;
}

.main-header {
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  position: relative;
  z-index: 10;
  background: white;
  justify-content: space-between;
  justify-content: space-between;
}

.main-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 3px; /* سماكة الخط */
  background: #ff8c2a; /* البرتقالي */
}

.logo {
  width: 60px;
  height: 60px;
  object-fit: contain;
}

.header-text h1 {
  margin: 0;
  font-size: 22px;
}

.header-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.7;
}

/* ===== TABS (الفئات) ===== */
.tabs {
  display: flex;
  gap: 10px;
  padding: 10px;
  overflow-x: auto;
}

.tab {
  border: none;
  padding: 10px 15px;
  border-radius: 20px;
  background: #eee;
  cursor: pointer;
  white-space: nowrap;
  font-size: 14px;
}

.tab.active {
  background: var(--primary);
  color: white;
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  gap: 10px;
  padding: 10px;
}

/* ===== STORES ===== */
.stores {
  width: 30%;
  max-width: 200px;
  background: white;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

.store {
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  background: #f3f3f3;
  font-size: 14px;
}

.store.active {
  background: var(--primary);
  color: white;
}

/* ===== PRODUCTS ===== */
.products {
  flex: 1;
  overflow-y: auto;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.product {
  background: white;
  border-radius: 16px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
  transition: 0.25s;
  animation: fadeUp 0.4s ease;
}

.product:hover {
  transform: translateY(-5px);
}

.product img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 12px;
  background: #eee;
}

.product h3 {
  font-size: 14px;
  margin: 8px 0;
}

.product p {
  color: var(--primary);
  font-weight: bold;
  margin: 0;
}

/* ===== QTY ===== */
.qty {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}

.qty button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: #eee;
  font-size: 16px;
  cursor: pointer;
}

/* ===== ADD BUTTON ===== */
.add-btn {
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 10px;
  border: none;
  width: 100%;
  font-size: 14px;
  cursor: pointer;
}

/* ===== CART BUTTON ===== */
.cart {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: var(--accent);
  color: white;
  padding: 12px 18px;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
}

/* ===== BOTTOM SHEET ===== */
.bottom-sheet {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);

  display: flex;
  justify-content: center;
  align-items: flex-end;

  opacity: 0;
  pointer-events: none;
  transition: 0.3s;
}

.bottom-sheet.active {
  opacity: 1;
  pointer-events: all;
}

.sheet-content {
  background: white;
  width: 100%;
  max-height: 80%;
  border-radius: 20px 20px 0 0;
  padding: 15px;
  overflow-y: auto;
  transform: translateY(100%);
  transition: 0.3s;
}

.bottom-sheet.active .sheet-content {
  transform: translateY(0);
}

/* ===== CART ITEMS ===== */
/* عنصر السلة */
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f9fafb;
  padding: 10px;
  border-radius: 10px;
  margin-bottom: 8px;
}

/* زر الحذف */
.remove-btn {
  width: 32px !important;
  height: 32px !important;

  background: var(--accent) !important;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  flex: 0 0 32px; 
}

/* معلومات المنتج */
.skeleton {
  padding: 10px;
  border-radius: 10px;
  height: 120px;
  background: #eee;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* صورة وهمية */
.s-img {
  width: 100%;
  height: 120px;
  background: #eee;
  border-radius: 10px;
  margin-bottom: 10px;
}

/* سطور */
.s-line {
  height: 14px;
  background: #eee;
  border-radius: 6px;
  margin-bottom: 8px;
}

.s-line.small {
  width: 60%;
}

/* زر وهمي */
.s-btn {
  height: 35px;
  background: #eee;
  border-radius: 8px;
  margin-top: 10px;
}

/* حركة */
.skeleton div {
  animation: pulse 1.2s infinite;}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.product-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  background: #eee;
  margin-bottom: 10px;
}

/* معلومات المنتج */
.cart-info {
  flex: 1;
  text-align: right;
}

.cart-name {
  font-weight: bold;
  font-size: 14px;
  display: block;
}

.cart-price {
  font-size: 13px;
  color: #666;
}

/* الكمية */
.qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.qty button {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-size: 14px;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;
}

.qty span {
  min-width: 20px;
  text-align: center;
  font-weight: bold;
}

/* ===== TOTAL ===== */
#totalPrice {
  font-size: 18px;
  font-weight: bold;
  margin: 15px 0;
  text-align: center;
}

/* ===== INPUTS ===== */
#cartModal input,
#cartModal textarea {
  width: 100%;
  padding: 12px;
  margin-top: 8px;
  border-radius: 10px;
  border: 1px solid #ddd;
}

/* ===== SEND BUTTON ===== */
#cartModal button {
  margin-top: 12px;
  padding: 14px;
  width: 100%;
  background: var(--primary);
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: bold;
}

/* ===== TOAST ===== */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: white;
  padding: 10px 15px;
  border-radius: 10px;
  opacity: 0;
  transition: 0.3s;
}

#toast.show {
  opacity: 1;
}

/* ===== ANIMATION ===== */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {

  .layout {
    flex-direction: column;
  }

  .stores {
    width: 100%;
    max-width: none;
    display: flex;
    overflow-x: auto;
    gap: 8px;
  }

  .store {
    min-width: 120px;
    text-align: center;
  }

  .products-grid {
    grid-template-columns: 1fr 1fr;
  }
}


#categories {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 15px;
  transition: 0.4s;
}

.cat-card {
  height: 100px;
  border-radius: 16px;
  color: white;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.4s;
}

/* الألوان */
.restaurant { background: #ff8c2a; }
.market { background: #2ecc71; }
.pharmacy { background: #e74c3c; }
.telecom { background: #2d6cdf; }

/* بعد الاختيار */
#categories.active {
  display: flex;
  overflow-x: auto;
}

#categories.active .cat-card {
  flex: 0 0 auto;
  width: 120px;
  height: 50px;
  font-size: 14px;
}

/* الكرت المختار */
.cat-card.selected {
  transform: scale(1.1);
  height: 70px !important;
}


/* ===== INTRO ===== */

#intro {
  width: 100%;
  padding: 20px;
  margin-top: 20px;


  display: flex;
  justify-content: center;

  transition: 0.4s;
}

.intro-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  width: 90%;
  max-width: 400px;
}

.intro-card {
  height: 120px;
  border-radius: 20px;
  color: white;
  font-size: 18px;
  font-weight: bold;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
  transition: all 0.4s ease;

  flex-direction: column;
  gap: 10px;
  
}

/* ألوان */
.intro-card.restaurant { background: #ff8c2a; }
.intro-card.market { background: #2ecc71; }
.intro-card.pharmacy { background: #e74c3c; }
.intro-card.telecom { background: #2d6cdf; }

/* hover */
.intro-card:hover {
  transform: scale(1.05);
}

.intro-card i {
  font-size: 32px;
  font-size: 30px;
  opacity: 0.9;
}

.intro-card span {
  font-size: 16px;
}

/* عند الضغط */
.intro-card.active {
  transform: scale(1.3);
  position: fixed;
  z-index: 9999;
  transition: all 0.6s ease;
  left: 50%;
  transform: translateX(-50%) scale(0.7);
  width: 200px;
  height: 60px;
  border-radius: 30px;
}

/* اختفاء */
#intro.hide {
  display: none;
  opacity: 0;
  transform: scale(0.9);
  pointer-events: none;

}

@keyframes tabBounce {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.2); }
  60%  { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.tab.bounce {
  animation: tabBounce 0.4s ease;
}

.layout {
  opacity: 0;
  transition: 0.4s;
}

.sheet-header {
  display: flex;
  justify-content: space-between; /* 👈 يخليهم مقابل بعض */
  align-items: center;
}

.close {
  font-size: 28px; /* 👈 كبر الزر */
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  transition: 0.2s;
}

/* hover حلو */
.close:hover {
  background: #f1f1f1;
}