/* BDStall — pages/cart.css */

/* ── Page wrapper ── */
.cart-page {
  background: #F7F6F2;
  min-height: 60vh;
  padding: 24px 16px 56px;
}

.cart-inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Heading ── */
.cart-heading {
  font-size: 1.375rem;
  font-weight: 800;
  color: #1C1C1A;
  margin: 0 0 20px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.cart-count {
  font-size: 1rem;
  font-weight: 500;
  color: #6B6558;
}

/* ── Two-column layout on tablet+ ── */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: start;
}

@media (min-width: 768px) {
  .cart-page    { padding: 32px 24px 64px; }
  .cart-layout  { grid-template-columns: 1fr 300px; gap: 24px; }
  .cart-heading { font-size: 1.625rem; margin-bottom: 24px; }
}

@media (min-width: 1024px) {
  .cart-layout { grid-template-columns: 1fr 320px; }
}

/* ── Items panel ── */
.cart-items {
  background: white;
  border-radius: 12px;
  border: 1px solid #E8E8E4;
  overflow: hidden;
}

/* ── Single cart row ── */
.cart-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border-bottom: 1px solid #F0EFE9;
}

.cart-item:last-child { border-bottom: none; }

/* Thumbnail */
.cart-item-img {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: #F8F7F3;
  border: 1px solid #EEE9DC;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Content column next to image */
.cart-item-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Top row: name + delete button */
.cart-item-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: #1C1C1A;
  margin: 0 0 3px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-item-variant {
  font-size: 0.8125rem;
  color: #6B6558;
  margin: 0;
}

/* Delete — top-right, never centred */
.cart-item-delete {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #B0ACA4;
  font-size: 0.875rem;
  transition: color 0.15s, background 0.15s;
  margin-top: 1px;
}

.cart-item-delete:hover {
  color: #C0392B;
  background: #FDECEA;
}

/* Bottom row: qty stepper + subtotal */
.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Quantity stepper ── */
.qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid #D3D1C7;
  border-radius: 6px;
  overflow: hidden;
}

.qty-btn {
  width: 32px;
  height: 32px;
  background: #F8F7F3;
  border: none;
  font-size: 1.125rem;
  font-weight: 700;
  color: #3A3A38;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  line-height: 1;
}

.qty-btn:hover:not(:disabled) { background: #EEE9DC; }

.qty-btn:disabled {
  color: #B8B5AB;
  cursor: not-allowed;
}

.qty-input {
  width: 44px;
  height: 32px;
  border: none;
  border-left: 1px solid #D3D1C7;
  border-right: 1px solid #D3D1C7;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #1C1C1A;
  background: white;
  padding: 0;
  -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* Item subtotal */
.cart-item-subtotal {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark, #0D7A3E);
  margin: 0;
  white-space: nowrap;
}

/* ── Order summary card ── */
.cart-summary {
  background: white;
  border-radius: 12px;
  border: 1px solid #E8E8E4;
  padding: 20px;
  position: sticky;
  top: 80px;
}

.cart-summary-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #6B6558;
  margin: 0 0 14px;
}

.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #ECEAE4;
}

.cart-summary-total-label {
  font-size: 1rem;
  font-weight: 700;
  color: #1C1C1A;
}

.cart-summary-total-amount {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--green-dark, #0D7A3E);
}

.btn-checkout {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 13px 20px;
  background: var(--green, #149A49);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-checkout:hover {
  background: var(--green-dark, #0D7A3E);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(20,154,73,0.3);
  color: white;
  text-decoration: none;
}

.btn-continue {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 20px;
  background: white;
  color: #3A3A38;
  border: 1px solid #D3D1C7;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}

.btn-continue:hover {
  background: #F8F7F3;
  border-color: #B8B5AB;
  color: #1C1C1A;
  text-decoration: none;
}

/* ── Empty state ── */
.cart-empty {
  text-align: center;
  padding: 64px 24px;
  background: white;
  border-radius: 12px;
  border: 1px solid #E8E8E4;
}

.cart-empty-icon  { font-size: 3.5rem; margin-bottom: 12px; }

.cart-empty-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1C1C1A;
  margin: 0 0 8px;
}

.cart-empty-sub {
  font-size: 0.9375rem;
  color: #6B6558;
  margin: 0 0 24px;
}

.btn-shop-now {
  display: inline-block;
  padding: 13px 32px;
  background: var(--green, #149A49);
  color: white;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, transform 0.15s;
}

.btn-shop-now:hover {
  background: var(--green-dark, #0D7A3E);
  transform: translateY(-1px);
  color: white;
  text-decoration: none;
}

/* ── Fly-to-cart clone (injected by JS on product page) ── */
.cart-fly-clone {
  position: fixed;
  pointer-events: none;
  z-index: 99999;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 6px 24px rgba(0,0,0,0.22);
  will-change: left, top, width, height, opacity;
}
