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

:root {
  --page-bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: rgba(255, 255, 255, 0.72);
  --border: rgba(14, 19, 33, 0.08);
  --text: #1d2434;
  --text-soft: rgba(29, 36, 52, 0.58);
  --shadow-card: 0 30px 60px rgba(15, 19, 32, 0.16);
  --gold: #d3b264;
  --gold-dark: #a77f2c;
}

body {
  background: var(--page-bg);
  color: var(--text);
  margin: 0;
  font-family: "Kanit", "Kanit", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

.container {
  width: min(1300px, 92vw);
  margin: 0 auto;
}

.cart-page {
  padding: clamp(32px, 6vw, 56px) 0 96px;
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 5vw, 48px);
}

.cart-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(15, 19, 32, 0.06);
  color: rgba(29, 36, 52, 0.7);
}

.cart-head h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3rem);
  font-weight: 700;
}

.cart-sub {
  margin: 0;
  font-size: 1.05rem;
  color: var(--text-soft);
}

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.34fr);
  gap: clamp(24px, 4vw, 40px);
  align-items: flex-start;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  background: var(--surface);
  border-radius: 20px;
  padding: 20px 24px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  align-items: center;
}

.cart-item-checkbox-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #d3b264;
  border-radius: 4px;
}

.cart-item-image {
  width: 180px;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.cart-item-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.03);
  color: rgba(0, 0, 0, 0.2);
}

.cart-item-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.cart-item h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  color: #1d2434;
}


.cart-item .cart-price {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(211, 178, 100, 0.12);
  border: 1px solid rgba(211, 178, 100, 0.5);
  font-weight: 600;
  color: #a77f2c;
  font-size: 1rem;
  width: fit-content;
}

.cart-meta {
  margin-top: 14px;
  font-size: 0.9rem;
}

.cart-meta a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(211, 178, 100, 0.08);
  border: 1px solid rgba(211, 178, 100, 0.7);
  color: #8a6a23;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(15, 19, 32, 0.08);
  transition: background 0.2s ease, color 0.2s ease,
              box-shadow 0.2s ease, transform 0.2s ease;
}

.cart-meta a:hover {
  background: linear-gradient(120deg, rgba(211, 178, 100, 0.96), rgba(190, 139, 44, 0.9));
  border-color: rgba(211, 178, 100, 0.75);
  color: #20140c;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px rgba(211, 178, 100, 0.26);
}

.cart-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  justify-content: center;
}

.qty-group {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  border: 1px solid rgba(15, 19, 32, 0.15);
  overflow: hidden;
  background: #ffffff;
  gap: 0;
}

.qty-group button {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #1d2434;
  transition: background 0.2s ease;
}

.qty-group button:hover {
  background: rgba(15, 19, 32, 0.05);
}

.qty-group span {
  min-width: 50px;
  text-align: center;
  font-weight: 600;
  padding: 0 8px;
  display: inline-block;
  color: #1d2434;
}

.qty-group span::after {
  content: ' ชิ้น';
  font-size: 0.85rem;
  color: rgba(29, 36, 52, 0.6);
  font-weight: 400;
  margin-left: 4px;
}

.cart-remove {
  border: none;
  background: rgba(248, 113, 113, 0.12);
  color: #b91c1c;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 0.9rem;
}

.cart-remove:hover {
  background: rgba(248, 113, 113, 0.2);
}

.cart-summary-card {
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--surface);
  border-radius: 26px;
  padding: 24px clamp(18px, 3vw, 28px);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

.summary-box h2 {
  margin: 0 0 18px;
  font-size: 1.3rem;
}

.select-all-container {
  display: none;
}

.select-all-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.95rem;
  user-select: none;
  font-weight: 500;
}

.select-all-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--gold);
}

.summary-box dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.summary-box dt {
  font-size: 0.95rem;
  color: var(--text-soft);
}

.summary-box dd {
  margin: 4px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.cart-clear,
.cart-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  width: 100%;
  box-sizing: border-box;
  border-radius: 999px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.cart-clear {
  background: rgba(15, 19, 32, 0.08);
  color: var(--text);
}

.cart-clear:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 16px rgba(15, 19, 32, 0.12);
}

.cart-checkout {
  background: linear-gradient(120deg, rgba(211, 178, 100, 0.92), rgba(190, 139, 44, 0.9));
  color: #20140c;
  border: 1px solid rgba(211, 178, 100, 0.55);
}

.cart-checkout:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(211, 178, 100, 0.26);
}

.cart-empty {
  display: flex;
  justify-content: center;
}

.cart-empty-card {
  width: min(640px, 100%);
  padding: clamp(28px, 6vw, 38px);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(211, 178, 100, 0.28);
  box-shadow: 0 30px 60px rgba(15, 19, 32, 0.18);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-empty-card h2 {
  margin: 0;
  font-size: 1.6rem;
}

.cart-empty-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
}

.empty-action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(211, 178, 100, 0.92), rgba(190, 139, 44, 0.9));
  color: #20140c;
  text-decoration: none;
  font-weight: 600;
  border: 1px solid rgba(211, 178, 100, 0.55);
}

.empty-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 28px rgba(211, 178, 100, 0.26);
}

@media (max-width: 960px) {
  .cart-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cart-summary-card {
    position: static;
  }

  .cart-item {
    grid-template-columns: auto auto 1fr;
    gap: 16px;
  }

  .cart-item-image {
    width: 140px;
    height: 140px;
  }

  .cart-controls {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    margin-top: 12px;
  }
}

@media (max-width: 540px) {
  .cart-page {
    padding-top: clamp(24px, 10vw, 48px);
  }

  .cart-empty-card {
    border-radius: 22px;
  }
}



