@font-face {
  font-family: "YekanBakhFaNum";
  src: url("../test/font/YekanBakhFaNum-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YekanBakhFaNum";
  src: url("../test/font/YekanBakhFaNum-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "YekanBakhFaNum";
  src: url("../test/font/YekanBakhFaNum-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Material Symbols Outlined";
  font-style: normal;
  font-weight: 400;
  src: url("../test/font/material-symbols-v39-latin-regular.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-soft: #f9fbff;
  --surface-2: #f3f6fc;
  --border: #e3e8f2;
  --text: #1c1b1f;
  --text-muted: #6b7280;
  --brand: #13369d;
  --danger: #ba1a1a;
  --success: #1f8b4c;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body.cart-page {
  margin: 0;
  min-height: 100vh;
  font-family: "YekanBakhFaNum", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.material-symbols-outlined {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga";
}

.cart-page-content {
  padding: 32px;
}

.page-title {
  margin: 0 0 16px;
  font-size: 2rem;
  font-weight: 700;
}

.page-description {
  margin: 0;
  color: var(--text-muted);
}

.cart-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.cart-drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(100vw, 410px);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.15);
  z-index: 999;
  display: flex;
  flex-direction: column;
  transform: translateX(-102%);
  transition: transform 0.28s ease;
}

.cart-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cart-drawer.is-open {
  transform: translateX(0);
}

body.cart-drawer-open {
  overflow: hidden;
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.cart-drawer-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cart-icon-filled {
  color: var(--brand);
}

.cart-drawer-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-items-count {
  background: #dd2858;
  color: #fff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.cart-close-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cart-close-button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.cart-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty-state {
  border: 1px dashed #d6deeb;
  border-radius: 12px;
  background: #f8fbff;
  color: #6b7280;
  padding: 16px;
  text-align: center;
  font-size: 0.86rem;
}

.cart-item {
  display: flex;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-soft);
  padding: 10px;
}

.cart-item-image-wrap {
  width: 84px;
  height: 84px;
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
  background: #eef3fb;
}

.cart-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.cart-item-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cart-item-meta {
  margin: 4px 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.cart-item-delete {
  width: 30px;
  height: 30px;
  border: 1px solid #e3e8f2;
  background: #ffffff;
  color: #8a94a7;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cart-item-delete:hover {
  color: var(--brand);
  background: #eef3fb;
  border-color: #c7d4ef;
}

.cart-item-delete .material-symbols-outlined {
  font-size: 18px;
}

.cart-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.cart-item-price {
  color: var(--brand);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.cart-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6deeb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.qty-button {
  border: 0;
  background: transparent;
  color: #4a5568;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.qty-button:hover {
  background: #eef3fb;
}

.qty-button .material-symbols-outlined {
  font-size: 16px;
}

.qty-value {
  min-width: 28px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.cart-drawer-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px;
}

.cart-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.summary-value {
  color: var(--text);
  font-weight: 600;
}

.summary-shipping-free {
  color: var(--success);
  font-weight: 600;
}

.summary-divider {
  height: 1px;
  background: var(--border);
}

.summary-row-total {
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
}

.summary-total-value {
  color: var(--brand);
}

.checkout-button {
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
}

.checkout-button:hover {
  background: #0f2d7a;
}

.secure-payment-note {
  margin: 12px 0 0;
  color: #7a8191;
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.secure-payment-note .material-symbols-outlined {
  font-size: 14px;
}

@media (max-width: 767px) {
  .cart-page-content {
    padding: 20px;
  }

  .cart-drawer {
    top: 12px;
    bottom: 12px;
    width: 80vw;
    max-width: 380px;
    border-radius: 12px 0 0 12px;
  }
}
