/* ====== Reset & Base ====== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Vazir', Tahoma, sans-serif;
  background: #f9f9f9;
  color: #333;
  line-height: 1.7;
  font-size: 15px;
  direction: rtl;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ====== Container ====== */
.container {
  width: 95%;
  max-width: 1200px;
  margin: auto;
  padding: 20px 0;
}

h1.page-title {
  font-size: 1.5rem;
  margin-bottom: 20px;
  font-weight: 600;
  color: #222;
}

/* ====== Header / Footer ====== */
header, footer {
  background: #fff;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

footer {
  border-top: 1px solid #eee;
  margin-top: 40px;
  font-size: 14px;
  text-align: center;
  color: #666;
}

/* ====== Grid System ====== */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* ====== Card ====== */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}

/* ====== Table (سبد خرید) ====== */
.cart-table {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cart-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr auto;
  align-items: center;
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.cart-product {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cart-product img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
}

.cart-qty input {
  width: 60px;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
}

/* ====== Cart Footer ====== */
.cart-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  margin-top: 20px;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.cart-actions {
  display: flex;
  gap: 10px;
}

/* ====== Forms ====== */
.form-control {
  display: flex;
  flex-direction: column;
  margin-bottom: 15px;
}

.form-control label {
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
}

.form-control input,
.form-control textarea,
.form-control select {
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  transition: border 0.2s;
}

.form-control input:focus,
.form-control textarea:focus {
  border-color: #00a859;
  outline: none;
}

/* ====== Buttons ====== */
.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  border: none;
  font-size: 14px;
  transition: 0.3s;
}

.btn.primary { background: #00a859; color: #fff; }
.btn.primary:hover { background: #008f4c; }

.btn.secondary { background: #555; color: #fff; }
.btn.secondary:hover { background: #333; }

.btn.danger { background: #e74c3c; color: #fff; }
.btn.danger:hover { background: #c0392b; }

.btn.full { width: 100%; }

/* ====== Alerts ====== */
.alert {
  padding: 12px;
  background: #f8d7da;
  color: #721c24;
  border-radius: 6px;
  margin-bottom: 15px;
  font-size: 14px;
}

.alert.success { background: #d4edda; color: #155724; }
.alert.info { background: #d1ecf1; color: #0c5460; }

/* ====== Product Page ====== */
.product-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.product-gallery img {
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.08);
}

.product-info h1 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.product-info .price {
  font-size: 1.3rem;
  color: #e74c3c;
  margin: 15px 0;
  font-weight: bold;
}

.tabs {
  margin-top: 30px;
}

.tab-buttons {
  display: flex;
  gap: 15px;
  border-bottom: 1px solid #eee;
}

.tab-buttons button {
  background: none;
  border: none;
  padding: 12px 15px;
  cursor: pointer;
  font-weight: 600;
}

.tab-buttons button.active {
  color: #00a859;
  border-bottom: 2px solid #00a859;
}

.tab-content {
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  margin-top: 10px;
}

/* ====== Dashboard ====== */
.dashboard {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
}

.sidebar {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
}

.sidebar ul {
  list-style: none;
}

.sidebar li {
  margin-bottom: 10px;
}

.sidebar a {
  display: block;
  padding: 10px;
  border-radius: 6px;
  transition: 0.2s;
}

.sidebar a:hover {
  background: #f1f1f1;
}

.dashboard-content {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
}

/* ====== Responsive ====== */
@media (max-width: 992px) {
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .product-page { grid-template-columns: 1fr; }
  .dashboard { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .cart-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "product product"
      "price qty"
      "total remove";
    gap: 10px;
  }
  .cart-footer {
    flex-direction: column;
    gap: 10px;
  }
  h1.page-title { font-size: 1.2rem; }
}
