/* ===================================================
   E-MENU CART & ORDERING SYSTEM STYLES
   Slide-over drawer, floating button, quantity controls
   =================================================== */

/* Floating Cart Button */
.floating-cart-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  background: var(--color-heading); /* #28431A */
  color: #ffffff;
  border: none;
  border-radius: 40px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: "Open Sans", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(40, 67, 26, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(120px);
  opacity: 0;
  pointer-events: none;
}
.floating-cart-btn.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.floating-cart-btn:hover {
  background: #1c3012;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 28px rgba(40, 67, 26, 0.5);
}

.cart-btn-badge {
  background: var(--primary); /* #6fa0bf */
  color: #fff;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 800;
}

.cart-btn-total {
  font-weight: 800;
  letter-spacing: 0.5px;
}

/* Add to Cart button on menu items */
.item-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

/* Inline Quantity Stepper on Card */
.item-qty-stepper {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #d1d5db;
  border-radius: 24px;
  padding: 3px 6px;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: all var(--transition);
}
.item-qty-stepper:hover {
  border-color: var(--color-heading);
}

.item-qty-btn-inline {
  background: #f3f4f6;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  user-select: none;
  line-height: 1;
}
.item-qty-btn-inline:hover {
  background: var(--color-heading);
  color: #ffffff;
}
.item-qty-btn-inline:active {
  transform: scale(0.92);
}

.item-qty-inline-val {
  font-weight: 800;
  font-size: 0.95rem;
  min-width: 22px;
  text-align: center;
  color: var(--color-heading);
  user-select: none;
}

.item-add-btn {
  background: linear-gradient(135deg, #28431A 0%, #3e6827 100%);
  color: #ffffff !important;
  border: none;
  border-radius: 24px;
  padding: 8px 18px;
  font-family: "Open Sans", sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 3px 10px rgba(40, 67, 26, 0.28);
}
.item-add-btn:hover {
  background: linear-gradient(135deg, #1b3012 0%, #2b4b1a 100%);
  transform: translateY(-2px);
  box-shadow: 0 5px 14px rgba(40, 67, 26, 0.4);
}
.item-add-btn:active {
  transform: scale(0.96);
}
.item-add-btn.added {
  background: #059669 !important;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.35);
}

/* Cart Drawer Backdrop */
.cart-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.cart-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Cart Drawer Panel */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: #ffffff;
  z-index: 1001;
  box-shadow: -6px 0 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.cart-drawer.active {
  right: 0;
}

.cart-header {
  padding: 20px 24px;
  background: var(--primary);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.cart-header h2 {
  color: #ffffff !important;
  font-size: 1.25rem;
  margin: 0;
}
.cart-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.cart-close-btn:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: rotate(90deg);
}

/* Location Header (Table/Room) */
.cart-location-bar {
  background: #EBF3F8;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cart-location-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-heading);
}
.cart-location-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-location-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-heading);
  background: #fff;
}
.cart-location-input {
  width: 80px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-align: center;
  color: var(--color-heading);
}

/* Cart Items Body */
.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-empty-state {
  text-align: center;
  margin: auto;
  padding: 40px 20px;
  color: var(--text-muted);
}
.cart-empty-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

/* Cart Item Card */
.cart-item {
  background: #F9F5FF;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition);
}
.cart-item-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.cart-item-name {
  font-weight: 700;
  color: var(--color-heading);
  font-size: 0.95rem;
  flex: 1;
}
.cart-item-station-tag {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(111, 160, 191, 0.2);
  color: var(--primary-dark);
}
.cart-item-price {
  font-weight: 700;
  color: var(--color-heading);
  font-size: 0.95rem;
  white-space: nowrap;
}

.cart-item-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.qty-control {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 6px;
  gap: 8px;
}
.qty-btn {
  background: none;
  border: none;
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-heading);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition);
}
.qty-btn:hover {
  background: #EBF3F8;
}
.qty-val {
  font-weight: 700;
  font-size: 0.92rem;
  min-width: 18px;
  text-align: center;
  color: var(--color-heading);
}

.cart-item-note-btn {
  background: none;
  border: none;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.cart-item-note-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--color-heading);
  background: #ffffff;
  display: none;
}
.cart-item-note-input.active {
  display: block;
}

/* Cart Footer / Checkout */
.cart-footer {
  padding: 20px 24px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.05);
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: var(--color-heading);
}
.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-heading);
  margin: 12px 0 16px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
}

.cart-notes-field {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-family: inherit;
  margin-bottom: 14px;
  resize: vertical;
  max-height: 80px;
  color: var(--color-heading);
}

.cart-submit-btn {
  width: 100%;
  padding: 15px 20px;
  background: var(--color-heading);
  color: #ffffff;
  border: none;
  border-radius: var(--radius);
  font-family: "Open Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(40, 67, 26, 0.3);
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cart-submit-btn:hover {
  background: #1b3012;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(40, 67, 26, 0.4);
}
.cart-submit-btn:disabled {
  background: #a0a0a0;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* Success Modal */
.order-success-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.9);
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  padding: 36px 30px;
  width: 90%;
  max-width: 420px;
  z-index: 1005;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.order-success-modal.active {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  visibility: visible;
}

.success-check-icon {
  width: 70px;
  height: 70px;
  background: #E8F8ED;
  color: #2E7D32;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.order-num-badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 1.15rem;
  font-weight: 800;
  margin: 12px 0 16px;
  letter-spacing: 1px;
}

.success-close-btn {
  padding: 12px 30px;
  background: var(--color-heading);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  margin-top: 18px;
  font-family: inherit;
  transition: all var(--transition);
}
.success-close-btn:hover {
  background: #1b3012;
}

@media (max-width: 480px) {
  .floating-cart-btn {
    bottom: 16px;
    right: 16px;
    left: 16px;
    justify-content: space-between;
    padding: 12px 20px;
  }
  .cart-drawer {
    max-width: 100%;
  }
}
