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

:root {
  --charcoal: #1a1a1a;
  --muted: #7a746d;
  --cream: #f2f1ef;
  --card: #ffffff;
  --border: #ddd8d1;
  --accent: #a25d34;
  --shadow: none;
}

body.cart-page {
  font-family: "Cairo", sans-serif;
  background: var(--cream);
  color: var(--charcoal);
  min-height: 100vh;
}

.cart-shell {
  max-width: 1200px;
  margin: 40px auto 80px;
  padding: 0 24px;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 28px;
}

.cart-kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  font-size: 0.75rem;
  color: var(--muted);
}

.cart-header h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 600;
}

.back-link {
  text-decoration: none;
  color: var(--charcoal);
  border: 1px solid var(--border);
  padding: 10px 18px;
  background: #fff;
  font-weight: 600;
  transition: 0.2s ease;
}

.back-link:hover {
  background: #f7f5f2;
  border-color: #cbc4ba;
}

.cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 30px;
  align-items: start;
}

.cart-panel,
.summary-panel {
  background: var(--card);
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
  border-radius: 0;
}

.cart-head {
  display: grid;
  grid-template-columns: 1.8fr 1fr 0.8fr 0.4fr;
  align-items: center;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: #6f6861;
  padding-bottom: 14px;
  border-bottom: 1px solid #e7e1d9;
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 0;
}

.cart-item {
  display: grid;
  grid-template-columns: 1.8fr 1fr 0.8fr 0.4fr;
  align-items: center;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid #ece7e1;
}

.cart-item:last-child {
  border-bottom: none;
}

.item-info {
  display: flex;
  gap: 16px;
  align-items: center;
}

.item-image {
  width: 88px;
  height: 88px;
  background: #f3f1ed;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

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

.image-placeholder {
  font-size: 0.75rem;
  color: var(--muted);
}

.item-meta h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.item-desc {
  margin: 0 0 6px;
  color: #69645d;
  font-size: 0.9rem;
  line-height: 1.4;
}

.item-price {
  margin: 0;
  font-weight: 600;
  color: var(--accent);
}

.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border: 1px solid #d8d1c8;
  background: #fff;
  justify-self: start;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: #f1efeb;
  cursor: pointer;
  font-size: 1rem;
  color: #4f4a45;
}

.qty-value {
  min-width: 20px;
  text-align: center;
  font-weight: 700;
}

.item-total {
  font-weight: 700;
  color: var(--charcoal);
}

.item-remove {
  border: none;
  background: transparent;
  color: #7d766f;
  cursor: pointer;
  font-size: 1.1rem;
  justify-self: start;
}

.item-remove:hover {
  color: var(--charcoal);
}


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

.summary-panel h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.3rem;
  font-weight: 700;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin: 0;
  color: #4f4a45;
}

.summary-row.total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--charcoal);
  padding: 0;
  border: none;
}

.summary-note {
  margin: 18px 0 0;
  padding: 0;
  background: transparent;
  color: #766f67;
  font-size: 0.85rem;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.4;
}

.btn-primary {
  margin-top: 24px;
  width: 100%;
  border: 1px solid #181818;
  border-radius: 0;
  background: #171717;
  color: #fff;
  padding: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease;
}

.btn-primary:hover:not(:disabled) {
  background: #0f0f0f;
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* --- Updated Client Information Section --- */

.client-details {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 16px; /* Space between form groups */
}

.client-details h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--charcoal);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Create a vertical stack for each label/input pair */
.client-details label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 6px;
}

.client-details input {
  width: 100%;
  box-sizing: border-box; /* Ensures padding doesn't break width */
  border: 1px solid var(--border);
  padding: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  background-color: #fff;
  transition: border-color 0.2s ease;
  border-radius: 0; /* Keeps the sharp, modern look */
}

.client-details input:focus {
  outline: none;
  border-color: var(--accent);
  background-color: #fafafa;
}

/* Placeholder styling to match the muted theme */
.client-details input::placeholder {
  color: #bbb;
  font-weight: 300;
}

.cart-empty {
  text-align: center;
  padding: 30px 0;
  color: var(--muted);
}

@media (max-width: 960px) {
  .cart-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .summary-panel {
    position: static;
  }

  .cart-head {
    display: none;
  }

  .cart-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 18px 0;
  }

  .qty-control,
  .item-total,
  .item-remove {
    justify-self: flex-start;
  }
}

@media (max-width: 600px) {
  .cart-shell {
    margin: 24px auto 56px;
    padding: 0 16px;
  }

  .cart-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .cart-header h1 {
    font-size: 2.3rem;
  }

  .back-link {
    padding: 12px 18px;
  }

  .cart-panel,
  .summary-panel {
    padding: 20px 16px;
  }

  .item-image {
    width: 92px;
    height: 82px;
  }

  .item-total {
    font-size: 1.2rem;
  }

  .btn-primary {
    padding: 13px;
  }
}
