/* ── Cart Button (floating) ── */
#cart-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--btn);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 22px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 300;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  opacity: 0;
  pointer-events: none;
}
#cart-fab.visible { opacity: 1; pointer-events: auto; }
#cart-fab:hover { transform: scale(1.05); box-shadow: 0 6px 28px rgba(0,0,0,0.3); }
#cart-fab .cart-count {
  background: #fff;
  color: var(--accent);
  border-radius: 50%;
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
}

/* ── Add to Cart btn on card ── */
.add-to-cart-btn {
  margin-top: 12px;
  width: 100%;
  padding: 9px;
  background: var(--btn);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: 'Georgia', serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
}
.add-to-cart-btn:hover { opacity: 0.88; }
.add-to-cart-btn:active { transform: scale(0.97); }
.add-to-cart-btn.added { background: #4caf7d; }

/* ── Cart Drawer ── */
#cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
#cart-overlay.open { opacity: 1; pointer-events: auto; }

#cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: #fff;
  z-index: 401;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 30px rgba(0,0,0,0.15);
}
#cart-drawer.open { transform: translateX(0); }

#cart-header {
  padding: 20px 22px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
#cart-header h2 { font-size: 1.3rem; }
#cart-close-btn {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: #888; padding: 4px 8px; border-radius: 6px;
}
#cart-close-btn:hover { background: #f5f5f5; color: #333; }

#cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 22px;
}

.cart-empty {
  text-align: center;
  color: #aaa;
  padding: 60px 20px;
  font-size: 1rem;
}
.cart-empty .icon { font-size: 2.5rem; margin-bottom: 10px; }

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.cart-item-thumb {
  width: 52px; height: 52px;
  border-radius: 8px;
  object-fit: cover;
  background: #f0ece6;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  overflow: hidden;
}
.cart-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 0.95rem; }
.cart-item-price { font-size: 0.85rem; color: #888; margin-top: 2px; }

.qty-controls {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.qty-btn {
  width: 28px; height: 28px;
  border: 1.5px solid #ddd;
  background: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.15s, background 0.15s;
}
.qty-btn:hover { border-color: var(--accent); background: #f0f7f2; }
.qty-num { font-weight: 600; min-width: 20px; text-align: center; }
.cart-item-total { font-weight: 700; color: var(--accent); min-width: 55px; text-align: right; }

#cart-footer {
  padding: 20px 22px;
  border-top: 1px solid #eee;
  flex-shrink: 0;
  background: #fafafa;
}
.cart-subtotal {
  display: flex; justify-content: space-between;
  font-size: 1rem; margin-bottom: 16px;
}
.cart-subtotal strong { font-size: 1.2rem; color: var(--accent); }
#checkout-btn {
  width: 100%;
  padding: 14px;
  background: var(--btn);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
}
#checkout-btn:hover { opacity: 0.88; }

/* ── Checkout Modal ── */
#checkout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
#checkout-overlay.open { opacity: 1; pointer-events: auto; }

#checkout-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 500px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: scale(0.96);
  transition: transform 0.25s;
}
#checkout-overlay.open #checkout-modal { transform: scale(1); }

.checkout-head {
  padding: 22px 26px 18px;
  border-bottom: 1px solid #eee;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: #fff; z-index: 1;
}
.checkout-head h2 { font-size: 1.3rem; }
.checkout-close {
  background: none; border: none; font-size: 1.3rem;
  cursor: pointer; color: #888; padding: 4px 8px; border-radius: 6px;
}
.checkout-close:hover { background: #f5f5f5; }

.checkout-body { padding: 22px 26px; }

.checkout-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aaa;
  margin: 20px 0 12px;
}
.checkout-section-title:first-child { margin-top: 0; }

.co-form-group { margin-bottom: 14px; }
.co-form-group label {
  display: block; font-size: 0.85rem; font-weight: 600;
  color: #555; margin-bottom: 5px;
}
.co-form-group input,
.co-form-group textarea,
.co-form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s;
}
.co-form-group input:focus,
.co-form-group textarea:focus,
.co-form-group select:focus { outline: none; border-color: var(--accent); }
.co-form-group textarea { resize: vertical; min-height: 70px; }

.order-type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.order-type-btn {
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.15s;
  text-align: center;
}
.order-type-btn .ot-icon { font-size: 1.4rem; display: block; margin-bottom: 4px; }
.order-type-btn.selected { border-color: var(--accent); background: #f0f7f2; color: var(--accent); font-weight: 600; }

.notify-type-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.notify-type-btn {
  padding: 10px 6px;
  border: 2px solid #ddd;
  border-radius: 10px;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: all 0.15s;
  text-align: center;
}
.notify-type-btn .ot-icon { font-size: 1.2rem; display: block; margin-bottom: 3px; }
.notify-type-btn.selected { border-color: var(--accent); background: #f0f7f2; color: var(--accent); font-weight: 600; }

/* Payment placeholder */
.payment-placeholder {
  background: #f8f8f8;
  border: 2px dashed #ddd;
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  color: #aaa;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.payment-placeholder .pay-icon { font-size: 2rem; margin-bottom: 8px; }
.payment-placeholder strong { display: block; color: #888; margin-bottom: 4px; }

.order-summary-row {
  display: flex; justify-content: space-between;
  padding: 8px 0;
  font-size: 0.9rem;
  color: #555;
  border-bottom: 1px solid #f0f0f0;
}
.order-summary-row:last-of-type { border-bottom: none; }
.order-total-row {
  display: flex; justify-content: space-between;
  padding: 12px 0 0;
  font-size: 1.1rem;
  font-weight: bold;
}
.order-total-row span:last-child { color: var(--accent); }

#place-order-btn {
  width: 100%;
  margin-top: 20px;
  padding: 15px;
  background: var(--btn);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1.05rem;
  font-family: 'Georgia', serif;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
}
#place-order-btn:hover { opacity: 0.88; }
#place-order-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Order Confirmation ── */
#confirmation-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
#confirmation-overlay.open { opacity: 1; pointer-events: auto; }

#confirmation-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}
.confirm-icon { font-size: 3.5rem; margin-bottom: 16px; }
.confirm-title { font-size: 1.6rem; margin-bottom: 8px; color: #1a1a1a; }
.confirm-sub { color: #777; font-size: 0.95rem; margin-bottom: 20px; line-height: 1.6; }
.confirm-order-id {
  background: #f4f4f4;
  border-radius: 8px;
  padding: 10px 16px;
  font-family: monospace;
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--accent);
  margin-bottom: 24px;
  letter-spacing: 1px;
}
#confirm-done-btn {
  padding: 12px 32px;
  background: var(--btn);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-family: 'Georgia', serif;
  cursor: pointer;
}

/* ── Item Customization Modal ── */
#customize-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
#customize-overlay.open { opacity: 1; pointer-events: auto; }

#customize-modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  transform: scale(0.97);
  transition: transform 0.2s;
  overflow: hidden;
}
#customize-overlay.open #customize-modal { transform: scale(1); }

.cust-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f0ece6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
}
.cust-img img { width: 100%; height: 100%; object-fit: cover; }

.cust-head {
  padding: 18px 22px 12px;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.cust-head-info { flex: 1; }
.cust-name { font-size: 1.2rem; font-weight: bold; color: #1a1a1a; }
.cust-desc { font-size: 0.85rem; color: #888; margin-top: 3px; line-height: 1.4; }
.cust-close {
  background: none; border: none; font-size: 1.2rem;
  cursor: pointer; color: #aaa; padding: 2px 6px; border-radius: 6px; flex-shrink: 0;
}
.cust-close:hover { background: #f5f5f5; color: #333; }

.cust-body {
  padding: 16px 22px;
  overflow-y: auto;
  flex: 1;
}

.cust-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #aaa;
  margin: 18px 0 10px;
}
.cust-section-title:first-child { margin-top: 0; }

/* Size options */
.size-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.size-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.size-option:hover { border-color: #ccc; }
.size-option.selected { border-color: var(--accent); background: #f0f7f2; }
.size-option input[type="radio"] { display: none; }
.size-label { flex: 1; font-weight: 600; font-size: 0.95rem; }
.size-price { font-weight: 700; color: var(--accent); }

/* Toppings */
.topping-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.topping-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1.5px solid #eee;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.topping-option:hover { border-color: #ccc; }
.topping-option.selected { border-color: var(--accent); background: #f0f7f2; }
.topping-option input[type="checkbox"] { display: none; }
.topping-check {
  width: 20px; height: 20px;
  border: 2px solid #ddd;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 0.75rem;
  transition: all 0.15s;
}
.topping-option.selected .topping-check {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.topping-name { flex: 1; font-size: 0.9rem; }
.topping-price { font-size: 0.85rem; color: #888; font-weight: 600; }

/* Comment */
.cust-comment {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  resize: vertical;
  min-height: 70px;
  transition: border-color 0.15s;
}
.cust-comment:focus { outline: none; border-color: var(--accent); }

/* Footer */
.cust-footer {
  padding: 14px 22px;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-shrink: 0;
  background: #fafafa;
}
.cust-total { font-size: 1.1rem; font-weight: bold; color: var(--accent); }
.cust-total small { font-size: 0.75rem; color: #aaa; font-weight: normal; display: block; }
#cust-add-btn {
  padding: 12px 24px;
  background: var(--btn);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: 'Georgia', serif;
  font-weight: bold;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
#cust-add-btn:hover { opacity: 0.88; }

/* Cart item modifiers display */
.cart-item-mods {
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 3px;
  line-height: 1.4;
}

@media (max-width: 480px) {
  #cart-drawer { width: 100vw; }
  .checkout-body { padding: 16px 18px; }
  .checkout-head { padding: 16px 18px; }
  #customize-modal { max-height: 96vh; }
  .cust-img { height: 130px; }
}
