/* =========================================================
   Chez Gizza — pickup ordering (cart / checkout)
   Extends styles.css variables/classes; only ever visible when
   pickup ordering is unlocked (see feature-flags.js).
   ========================================================= */

[hidden]{ display: none !important; }

/* ---------- Header cart button ---------- */
.cg-cart-btn{
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  appearance: none; border: 0; background: none; cursor: pointer;
  color: var(--muted); padding: 4px; transition: color .12s ease;
}
.cg-cart-btn:hover{ color: var(--ink); }
.cg-cart-count{
  position: absolute; top: -4px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--rose-2); color: #fffdfa; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* ---------- Overlay ---------- */
.cg-cart-overlay{
  position: fixed; inset: 0; z-index: 200;
  background: rgba(35,43,34,0.45);
  display: flex; justify-content: flex-end;
}
.cg-cart-panel{
  width: min(440px, 100%); height: 100%; background: var(--paper);
  box-shadow: -18px 0 50px rgba(35,43,34,0.18);
  padding: 26px 22px 22px; overflow-y: auto; position: relative;
}
.cg-cart-close{
  position: absolute; top: 16px; right: 16px;
  appearance: none; border: 0; background: none; cursor: pointer;
  font-size: 22px; line-height: 1; color: var(--muted); padding: 6px;
}
.cg-cart-close:hover{ color: var(--ink); }
.cg-cart-body h3{ margin: 0 0 18px; padding-right: 30px; }
.cg-cart-body h4{ font-family: "Cormorant Garamond", Georgia, serif; font-size: 18px; font-weight: 600; margin: 22px 0 12px; }

/* ---------- Cart items ---------- */
.cg-cart-items{ display: flex; flex-direction: column; gap: 14px; }
.cg-cart-item{
  display: grid; grid-template-columns: 56px 1fr auto auto; align-items: center; gap: 12px;
  padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.cg-cart-item-media{
  width: 56px; height: 56px; border-radius: 10px; overflow: hidden;
  background: linear-gradient(180deg, #fffdfa, #f1ece3); flex: none;
}
.cg-cart-item-media img{ width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-cart-item-name{ font-size: 14px; font-weight: 600; }
.cg-cart-item-price{ font-size: 12.5px; color: var(--rose-2); font-weight: 600; }
.cg-qty{ display: flex; align-items: center; gap: 6px; }
.cg-qty-btn{
  appearance: none; border: 1px solid var(--line); background: var(--surface); cursor: pointer;
  width: 24px; height: 24px; border-radius: 999px; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.cg-qty-btn:hover{ border-color: var(--sage); }
.cg-qty-val{ min-width: 16px; text-align: center; font-size: 13px; font-weight: 600; }
.cg-cart-remove{
  appearance: none; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 13px;
}
.cg-cart-remove:hover{ color: var(--rose-2); }
.cg-cart-empty{ padding: 20px 0; }

.cg-cart-total{
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 18px 0; font-size: 15px;
}
.cg-cart-total strong{ color: var(--rose-2); font-size: 18px; }
.cg-cart-checkout-btn{ width: 100%; }

/* ---------- Checkout ---------- */
.cg-back-btn{
  appearance: none; border: 0; background: none; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 600; padding: 0; margin-bottom: 14px;
}
.cg-back-btn:hover{ color: var(--ink); }

.cg-order-summary{
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface);
  padding: 14px 16px; margin-bottom: 20px;
}
.cg-summary-row{ display: flex; justify-content: space-between; font-size: 13px; padding: 4px 0; color: var(--muted); }
.cg-summary-total{ border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; color: var(--ink); font-size: 14px; }
.cg-summary-total strong{ color: var(--rose-2); }

.cg-field-block{ margin-bottom: 20px; }
.cg-field-block > label{ display: block; margin-bottom: 8px; }

.cg-date-grid{ display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cg-date-btn{
  appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--surface);
  border-radius: var(--radius-sm); padding: 10px 4px; display: flex; flex-direction: column; align-items: center;
  gap: 2px; color: var(--ink); transition: all .12s ease;
}
.cg-date-btn:hover{ border-color: var(--sage); }
.cg-date-btn.active{ background: var(--sage); border-color: var(--sage); color: #fffdfa; }
.cg-date-dow{ font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.75; }
.cg-date-num{ font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px; font-weight: 600; }
.cg-date-mon{ font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.75; }

.cg-time-grid{ display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-height: 220px; overflow-y: auto; }
.cg-time-btn{
  appearance: none; cursor: pointer; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 8px 4px; font-size: 12.5px; font-weight: 600; color: var(--ink);
  transition: all .12s ease;
}
.cg-time-btn:hover{ border-color: var(--sage); }
.cg-time-btn.active{ background: var(--sage); border-color: var(--sage); color: #fffdfa; }

.cg-form-field{ margin-bottom: 14px; }
.cg-input{
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 11px 13px; transition: border-color .12s ease;
}
.cg-input:focus{ outline: none; border-color: var(--sage); }
.cg-input-invalid{ border-color: var(--rose-2); }
.cg-field-error{ margin: 5px 0 0; font-size: 12px; color: var(--rose-2); min-height: 1em; }
.cg-submit-btn{ width: 100%; margin-top: 6px; }
.cg-submit-status{ text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0 0; min-height: 1.2em; }

/* ---------- Confirmation ---------- */
.cg-order-id{ font-family: "Cormorant Garamond", Georgia, serif; font-size: 20px; font-weight: 600; color: var(--rose-2); }

/* ---------- Add to cart (category.html cards) ---------- */
.cg-cart-control{ margin-top: 12px; }
.cg-add-to-cart{ width: 100%; }
.cg-card-qty{
  display: flex; align-items: center; justify-content: space-between;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  padding: 5px;
}
.cg-card-qty .cg-qty-btn{ width: 32px; height: 32px; font-size: 16px; flex: none; }
.cg-card-qty .cg-qty-val{ font-size: 15px; font-weight: 700; min-width: 24px; text-align: center; }

@media (max-width: 480px){
  .cg-cart-panel{ width: 100%; padding: 22px 16px 18px; }
  .cg-date-grid{ grid-template-columns: repeat(3, 1fr); }
  .cg-time-grid{ grid-template-columns: repeat(2, 1fr); }
}
