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

:root {
  --primary: #ef4056;
  --primary-dark: #d92b46;
  --ink: #23254e;
  --muted: #81858b;
  --border: #e6e8ed;
  --bg: #f6f7fb;
  --shadow: 0 12px 45px rgba(25,35,70,.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  direction: rtl;
  font-family: 'Vazirmatn', Tahoma, sans-serif !important;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.9;
}

button, input, a {
  font-family: inherit;
}

header {
  background: #fff;
  padding: 20px max(24px, calc((100% - 1200px)/2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 20px rgba(0,0,0,.025);
}

.logo {
  font-size: 32px;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -1px;
}

.back {
  text-decoration: none;
  color: #555;
  font-weight: 600;
  transition: .25s;
}

.back:hover { color: var(--primary); }

.container {
  max-width: 1200px;
  margin: 45px auto;
  padding: 0 20px;
}

h1 {
  font-size: 27px;
  font-weight: 900;
  margin: 0 0 28px;
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  box-shadow: var(--shadow);
}

.item {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 26px 0;
  border-bottom: 1px solid #f0f0f2;
  transition: background .25s;
}

.item:last-child { border-bottom: 0; }

.item img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  background: #fafbfc;
  border-radius: 16px;
  padding: 12px;
  transition: transform .3s;
}

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

.info { flex: 1; min-width: 0; }

.info h3 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 14px;
  line-height: 1.8;
}

.price {
  color: #20243c;
  font-size: 21px;
  font-weight: 900;
}

.controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 20px;
}

.qty {
  display: flex;
  align-items: center;
  gap: 20px;
  border: 1px solid #f1c5cd;
  border-radius: 13px;
  padding: 5px 14px;
  background: #fff8f9;
  color: var(--primary);
  font-weight: 800;
}

.qty button {
  border: 0;
  background: transparent;
  color: var(--primary);
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s;
}

.qty button:hover { transform: scale(1.2); }

.remove {
  border: 0;
  background: #fff0f2;
  color: var(--primary);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: .25s;
}

.remove:hover {
  background: var(--primary);
  color: white;
}

.summary {
  position: sticky;
  top: 24px;
}

.summary h3 {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 20px;
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 22px 0;
  color: #62666e;
  font-size: 14px;
}

.total {
  border-top: 1px dashed #ddd;
  padding-top: 22px;
  font-size: 17px;
  color: var(--ink);
  font-weight: 900;
}

.total span:last-child {
  color: var(--primary);
  font-size: 19px;
}

.checkout {
  width: 100%;
  padding: 17px;
  border: none;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg,#ef4056,#ff6074);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(239,64,86,.23);
  transition: transform .25s, box-shadow .25s;
}

.checkout:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(239,64,86,.32);
}

.checkout:disabled { cursor: not-allowed; }

.notice {
  color: var(--muted);
  font-size: 12px;
  line-height: 2.2;
}

.empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 17px;
}

.empty::before {
  content: '🛒';
  display: block;
  font-size: 70px;
  margin-bottom: 18px;
}

.empty a {
  display: inline-block;
  margin-top: 22px;
  background: var(--primary);
  color: white;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 12px;
  font-weight: 800;
}

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .container { margin: 25px auto; }
  .panel { padding: 18px; }
  .item { gap: 14px; }
  .item img { width: 100px; height: 110px; }
  .info h3 { font-size: 14px; }
  .price { font-size: 16px; }
  h1 { font-size: 23px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
  }
}
