* {
  box-sizing: border-box;
}

body {
  margin: 0;
  direction: rtl;
  font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
  background: #f4f7fb;
  color: #111827;
}

.container {
  width: min(1200px, 95vw);
  margin: 0 auto;
}

.site-header {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr 2fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #b91c1c;
  font-weight: 800;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.search-form {
  display: flex;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.search-form input {
  width: 100%;
  border: 0;
  outline: none;
  padding: 10px 12px;
}

.search-form button {
  border: 0;
  background: #dc2626;
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

.cart-link {
  text-decoration: none;
  color: #0f172a;
  font-weight: 700;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 8px 12px;
}

.cart-link.active {
  background: #fee2e2;
  color: #b91c1c;
}

.nav-links {
  display: flex;
  gap: 16px;
  padding: 8px 0 12px;
}

.nav-links a {
  color: #475569;
  text-decoration: none;
  font-size: 14px;
}

.hero {
  background: linear-gradient(135deg, #fde8e8 0%, #fff1f2 100%);
  border-bottom: 1px solid #fee2e2;
}

.hero h1 {
  margin: 0;
  padding: 32px 0;
  font-size: 38px;
  font-weight: 900;
  letter-spacing: 0.2px;
  color: #b91c1c;
}

.page-wrap {
  padding: 24px 0 36px;
}

.empty-state {
  text-align: center;
  padding: 44px 14px;
}

.empty-icon {
  font-size: 48px;
}

.empty-state h2 {
  margin: 10px 0 8px;
}

.empty-state p {
  color: #64748b;
}

.primary-link {
  display: inline-block;
  text-decoration: none;
  background: #dc2626;
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 700;
}

.cart-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
}

.cart-table {
  border: none;
  border-radius: 24px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.08);
}

.table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 12px;
  background: #fff6f6;
  border-bottom: 1px solid #fee2e2;
  padding: 18px 20px;
  font-weight: 800;
  color: #7f1d1d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cart-row {
  display: grid;
  grid-template-columns: 2.5fr 1fr 1fr;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
  align-items: center;
}

.product-cell {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.product-cell img {
  width: 96px;
  height: 96px;
  border-radius: 18px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.product-info {
  min-width: 0;
}

.product-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.product-name {
  margin: 0;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.product-name a {
  color: #111827;
  text-decoration: none;
}

.product-name a:hover {
  color: #b91c1c;
}

.sku {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.product-price-label {
  margin: 8px 0 0;
  color: #475569;
  font-size: 14px;
}

.item-quantity {
  display: flex;
  justify-content: center;
}

.qty-wrap {
  display: inline-flex;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}

.qty-wrap button {
  border: 0;
  background: transparent;
  width: 36px;
  height: 36px;
  color: #111827;
  font-size: 18px;
  cursor: pointer;
}

.qty-wrap input {
  width: 58px;
  border: 0;
  background: transparent;
  text-align: center;
  line-height: 36px;
  font-weight: 700;
  font-size: 16px;
  color: #111827;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}

.qty-wrap input::-webkit-outer-spin-button,
.qty-wrap input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.item-total {
  text-align: right;
}

.item-total-label {
  display: block;
  color: #64748b;
  font-size: 13px;
  margin-bottom: 4px;
}

.total-price {
  color: #b91c1c;
  font-size: 20px;
  font-weight: 900;
}

.remove-btn {
  border: 1px solid #fee2e2;
  background: #fff1f2;
  color: #b91c1c;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s ease;
}

.remove-btn:hover {
  background: #fee2e2;
}

.continue-link {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border: 1px solid #dc2626;
  color: #dc2626;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 800;
  background: #fff5f5;
  transition: all 0.2s ease;
}

.continue-link:hover {
  background: #fee2e2;
}

.summary-card {
  border: none;
  border-radius: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fff7f7 100%);
  padding: 24px;
  position: sticky;
  top: 94px;
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.08);
}

.summary-card h2 {
  margin: 0 0 18px;
  font-size: 24px;
  letter-spacing: 0.02em;
  color: #111827;
}

.summary-rows {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 16px;
  margin-bottom: 18px;
}

.summary-rows div,
.total-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.total-row {
  font-size: 20px;
  font-weight: 800;
  color: #dc2626;
}

.coupon-box label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
}

.coupon-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.coupon-input-wrap input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 12px 14px;
  text-transform: uppercase;
  background: #ffffff;
}

.coupon-input-wrap button {
  border: none;
  border-radius: 14px;
  background: #dc2626;
  color: #ffffff;
  padding: 0 18px;
  cursor: pointer;
  font-weight: 700;
}

#couponStatus {
  margin: 8px 0 0;
  color: #15803d;
  font-size: 13px;
  font-weight: 700;
}

.checkout-link {
  margin-top: 18px;
  display: block;
  text-align: center;
  text-decoration: none;
  background: #b91c1c;
  color: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 900;
  box-shadow: 0 16px 28px rgba(185, 28, 28, 0.18);
  transition: transform 0.2s ease;
}

.checkout-link:hover {
  transform: translateY(-1px);
}

.summary-note {
  margin: 16px 0 0;
  text-align: center;
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
  }

  .cart-layout {
    grid-template-columns: 1fr;
  }

  .table-head {
    display: none;
  }

  .cart-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .summary-card {
    position: static;
  }

  .hero h1 {
    font-size: 28px;
  }
}
