/* فونت فارسی مربع Vazirmatn */
@import url("https://cdn.jsdelivr.net/npm/vazirmatn@33.003/Vazirmatn-font-face.css");

/* متغیرهای رنگی مدرن */
:root {
  --primary: #8B4513;      /* قهوه‌ای گرم */
  --secondary: #D2691E;     /* نارنجی طلایی */
  --accent: #FFD700;        /* طلایی */
  --bg: #0F0C0A;           /* پس‌زمینه تیره */
  --panel: #1A1612;        /* پنل‌ها */
  --card: #2C2419;         /* کارت‌ها */
  --text: #F5F5DC;         /* متن روشن */
  --text-muted: #D2B48C;   /* متن کمرنگ */
  --border: #3E3429;       /* حاشیه‌ها */
  --shadow: rgba(0, 0, 0, 0.3);
  --gradient: linear-gradient(135deg, #8B4513 0%, #D2691E 100%);
  --gradient-light: linear-gradient(135deg, #D2691E 0%, #FFD700 100%);
}

/* ریست استایل‌ها */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Vazirmatn', 'Tahoma', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}

/* کانتینر اصلی */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* کارت‌ها */
.card {
  background: var(--card);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 8px 32px var(--shadow);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

/* دکمه‌ها */
.btn {
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(139, 69, 19, 0.3);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.btn:hover::before {
  left: 100%;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 69, 19, 0.4);
}

.btn.gray {
  background: #6B5B73;
  box-shadow: 0 4px 15px rgba(107, 91, 115, 0.3);
}

.btn:active {
  transform: translateY(0);
}

/* فیلدهای ورودی */
.input, input, select, textarea {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 8px 0;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: 'Vazirmatn', sans-serif;
}

.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(210, 105, 30, 0.2);
  background: var(--card);
}

/* هدر */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  background: var(--panel);
  border-radius: 16px;
  margin-bottom: 30px;
  box-shadow: 0 4px 20px var(--shadow);
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* نشان‌ها */
.badge {
  background: var(--gradient-light);
  border-radius: 20px;
  padding: 8px 16px;
  color: #000;
  font-weight: 600;
  font-size: 14px;
  display: inline-block;
}

/* گرید محصولات */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin: 30px 0;
}

/* آیتم محصولات */
.item {
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 8px 25px var(--shadow);
  transition: all 0.3s ease;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient);
}

.item:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 16px;
  transition: transform 0.3s ease;
}

.item:hover img {
  transform: scale(1.05);
}

.item h4 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.item p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.price-row span {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

/* فوتر */
footer {
  color: var(--text-muted);
  text-align: center;
  padding: 40px 0;
  margin-top: 60px;
  border-top: 1px solid var(--border);
  font-size: 14px;
}

/* پاپ‌آپ */
.popup {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
}

.popup.active {
  display: flex;
}

.popup .box {
  background: var(--card);
  border-radius: 24px;
  max-width: 600px;
  width: 95%;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  animation: popupSlide 0.3s ease;
}

@keyframes popupSlide {
  from {
    opacity: 0;
    transform: translateY(50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* منوی همبرگر */
.hamburger {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.3s ease;
}

.hamburger:hover {
  background: var(--border);
}

.hamburger span {
  width: 24px;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav {
  display: none;
}

.nav.active {
  display: block;
}

/* جداول */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow);
}

.table th,
.table td {
  border-bottom: 1px solid var(--border);
  padding: 16px;
  text-align: right;
}

.table th {
  background: var(--gradient);
  color: white;
  font-weight: 600;
}

.table tr:hover {
  background: var(--panel);
}

/* وضعیت */
.status {
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--gradient-light);
  color: #000;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

/* ────────────────────────────── */
/* استایل‌های خاص برای صفحات مختلف */
/* ────────────────────────────── */

/* صفحه ورود مشتری */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg) 0%, #1A1612 100%);
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="coffee" patternUnits="userSpaceOnUse" width="20" height="20"><circle cx="10" cy="10" r="2" fill="%23D2691E" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23coffee)"/></svg>');
  opacity: 0.3;
}

.login-card {
  background: var(--card);
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border);
  backdrop-filter: blur(20px);
  position: relative;
  z-index: 10;
  max-width: 450px;
  width: 90%;
  text-align: center;
}

.login-card h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 30px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  position: relative;
}

.form-group label {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  transition: all 0.3s ease;
  pointer-events: none;
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label {
  top: -8px;
  right: 12px;
  font-size: 12px;
  color: var(--secondary);
  background: var(--card);
  padding: 0 8px;
}

/* منوی محصولات */
.menu-header {
  background: var(--gradient);
  color: white;
  padding: 30px 0;
  margin-bottom: 40px;
  border-radius: 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.menu-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="coffee-beans" patternUnits="userSpaceOnUse" width="30" height="30"><circle cx="15" cy="15" r="3" fill="white" opacity="0.1"/><circle cx="25" cy="25" r="2" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23coffee-beans)"/></svg>');
  opacity: 0.2;
}

.menu-header h1 {
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}

.menu-header p {
  font-size: 18px;
  opacity: 0.9;
  position: relative;
  z-index: 2;
}

.category {
  margin: 50px 0;
}

.category h2 {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 30px;
  color: var(--secondary);
  position: relative;
  padding-bottom: 15px;
}

.category h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 4px;
  background: var(--gradient);
  border-radius: 2px;
}

/* سبد خرید */
.cart-modal {
  background: var(--card);
  border-radius: 24px;
  max-width: 700px;
  width: 95%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.cart-table th,
.cart-table td {
  padding: 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.cart-table th {
  background: var(--gradient);
  color: white;
  font-weight: 600;
}

.cart-table img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 12px;
}

.action-btn {
  background: none;
  border: none;
  color: var(--secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.action-btn:hover {
  background: var(--border);
  transform: scale(1.1);
}

.total-row {
  text-align: center;
  margin: 20px 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  padding: 20px;
  background: var(--panel);
  border-radius: 16px;
}

.btn-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ────────────────────────────── */
/* ریسپانسیو موبایل و تبلت       */
/* ────────────────────────────── */
@media (max-width: 768px) {
  body {
    font-size: 16px;
    padding-bottom: 20px;
  }

  .container {
    padding: 15px;
  }

  .header {
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    text-align: center;
  }

  .header h1 {
    font-size: 24px;
  }

  .header .cart-btn {
    width: 100%;
    font-size: 16px;
    padding: 14px 20px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
  }

  .item {
    padding: 16px;
  }

  .item img {
    height: 180px;
  }

  .item h4 {
    font-size: 18px;
  }

  .price-row {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .price-row .btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
  }

  .login-card {
    padding: 30px 20px;
    margin: 20px;
  }

  .login-card h2 {
    font-size: 28px;
  }

  .menu-header {
    padding: 20px;
    margin-bottom: 30px;
  }

  .menu-header h1 {
    font-size: 28px;
  }

  .category h2 {
    font-size: 24px;
  }

  /* پاپ‌آپ سبد خرید برای موبایل */
  .popup.active {
    align-items: flex-end;
  }

  .cart-modal {
    max-width: none;
    width: 100%;
    height: 85vh;
    border-radius: 24px 24px 0 0;
  }

  .cart-table th,
  .cart-table td {
    padding: 12px 8px;
    font-size: 14px;
  }

  .cart-table img {
    width: 50px;
    height: 50px;
  }

  .btn-row {
    flex-direction: column;
  }

  .btn-row .btn {
    width: 100%;
  }
}

/* ────────────────────────────── */
/* ریسپانسیو تبلت */
/* ────────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }

  .item img {
    height: 220px;
  }
}

/* ────────────────────────────── */
/* ریسپانسیو دسکتاپ‌های بزرگ‌تر  */
/* ────────────────────────────── */
@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }

  .item img {
    height: 240px;
  }

  .container {
    padding: 30px;
  }
}

/* ────────────────────────────── */
/* انیمیشن‌ها و افکت‌های اضافی */
/* ────────────────────────────── */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item {
  animation: fadeInUp 0.6s ease forwards;
}

.item:nth-child(1) { animation-delay: 0.1s; }
.item:nth-child(2) { animation-delay: 0.2s; }
.item:nth-child(3) { animation-delay: 0.3s; }
.item:nth-child(4) { animation-delay: 0.4s; }
.item:nth-child(5) { animation-delay: 0.5s; }
.item:nth-child(6) { animation-delay: 0.6s; }

/* اسکرول بار سفارشی */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--panel);
}

::-webkit-scrollbar-thumb {
  background: var(--gradient);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gradient-light);
}
