/* Customer portal styles */

/* ── App Header ── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 0 12px;
  flex-wrap: wrap;
}
.app-header-info { display: flex; align-items: center; gap: 14px; }
.customer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #818cf8, #4f46e5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 20px rgba(99,102,241,0.3);
}
.app-header-info h2 { margin: 0; font-size: 20px; font-weight: 700; }
.app-header-actions { display: flex; align-items: center; gap: 10px; }

/* ── Main tabs ── */
.main-tabs {
  display: flex;
  gap: 4px;
  background: #f0f4f1;
  border-radius: 16px;
  padding: 5px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.main-tab {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  color: #4a6553;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  box-shadow: none;
}
.main-tab:hover  { background: rgba(0,177,79,0.1); transform: none; }
.main-tab.active { background: #fff; color: #006e2f; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }

/* Section toolbar */
.section-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.section-toolbar h3 { margin: 0; font-size: 18px; font-weight: 700; color: #0a3520; }

/* ── Order cards ── */
.order-cards { display: flex; flex-direction: column; gap: 12px; }
.order-card  {
  background: #fff;
  border: 1px solid #d3ddd7;
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}
.order-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-1px); }
.order-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #dff8ea;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.order-card-body { flex: 1; min-width: 0; }
.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.order-store { font-weight: 700; font-size: 15px; color: #0a3520; }
.order-id    { font-family: monospace; font-size: 12px; color: #6b7f72; }
.order-meta  { font-size: 13px; color: #6b7f72; margin-top: 4px; }

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.status-PENDING   { background: #fef9c3; color: #854d0e; }
.status-CONFIRMED { background: #dbeafe; color: #1e40af; }
.status-PREPARING { background: #ffedd5; color: #9a3412; }
.status-PICKED_UP { background: #ede9fe; color: #5b21b6; }
.status-DELIVERED { background: #dcfce7; color: #166534; }
.status-CANCELLED { background: #fee2e2; color: #991b1b; }

.pm-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 700; }
.pm-SEPAY_QR { background: #e0f2fe; color: #0369a1; }
.pm-COD      { background: #fef3c7; color: #92400e; }

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #6b7f72;
}
.empty-state .emoji { font-size: 48px; margin-bottom: 12px; }

/* ── Stores grid ── */
.stores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.store-card {
  background: #fff;
  border: 1px solid #d3ddd7;
  border-radius: 18px;
  padding: 20px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.store-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }
.store-card.closed { opacity: 0.6; }
.store-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.store-name { font-size: 16px; font-weight: 700; color: #0a3520; }
.store-open-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
}
.store-open-badge.open   { background: #dcfce7; color: #166534; }
.store-open-badge.closed { background: #fee2e2; color: #991b1b; }
.store-address { font-size: 13px; color: #6b7f72; margin-bottom: 8px; }
.store-meta    { display: flex; align-items: center; gap: 12px; font-size: 13px; font-weight: 600; }
.store-rating  { color: #f59e0b; }
.store-eta     { color: #4a6553; }
.store-select-btn {
  width: 100%;
  margin-top: 12px;
  background: linear-gradient(135deg, #00b14f, #008a3a);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  transition: filter 0.2s;
  box-shadow: 0 6px 16px rgba(0,177,79,0.25);
}
.store-select-btn:hover { filter: brightness(1.06); transform: none; }

/* ── Products grid ── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.product-card {
  background: #f8fdf9;
  border: 1px solid #d3ddd7;
  border-radius: 14px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.product-card:hover { box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.product-card-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  background: #eef2ef;
}
.product-card-img-placeholder {
  width: 100%;
  height: 120px;
  background: linear-gradient(135deg, #dff8ea, #c7f0d8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}
.product-card-body { padding: 12px; }
.product-card-name { font-size: 14px; font-weight: 700; color: #0a3520; margin-bottom: 4px; }
.product-card-price { font-size: 15px; font-weight: 800; color: #006e2f; }
.product-card-actions { padding: 0 12px 12px; }
.add-to-cart-btn {
  width: 100%;
  background: linear-gradient(135deg, #00b14f, #008a3a);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px;
  font-weight: 700;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: filter 0.2s;
  box-shadow: 0 4px 12px rgba(0,177,79,0.25);
}
.add-to-cart-btn:hover { filter: brightness(1.06); transform: none; }
.product-qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
}
.product-qty-control button {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: #006e2f;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}
.product-qty-control span { font-weight: 700; min-width: 24px; text-align: center; }

/* ── Cart ── */
.cart-total {
  margin-top: 12px;
  padding: 12px;
  background: #f2f6f3;
  border-radius: 12px;
  font-size: 14px;
  color: #2d4436;
  text-align: right;
}
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eef2ef;
  font-size: 14px;
}

/* ── Payment methods ── */
.payment-method-select { margin-top: 4px; }
.payment-method-select label:first-child { display: block; margin-bottom: 8px; }
.pm-options { display: flex; flex-direction: column; gap: 10px; }
.pm-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #d3ddd7;
  cursor: pointer;
  background: #f8fdf9;
  transition: all 0.2s;
}
.pm-option input { display: none; }
.pm-option.active { border-color: #00b14f; background: #dff8ea; }
.pm-icon { font-size: 28px; }
.pm-name { font-weight: 700; font-size: 14px; color: #0a3520; }
.pm-desc { font-size: 12px; color: #6b7f72; }

/* ── QR / COD ── */
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px;
  background: #f8fdf9;
  border-radius: 16px;
  border: 2px dashed #a3e6bf;
  margin-top: 16px;
  gap: 8px;
}
#order-qr-code { padding: 12px; background: #fff; border-radius: 12px; }
.qr-amount { font-size: 20px; font-weight: 800; color: #006e2f; margin: 0; }
.qr-ref    { font-size: 13px; color: #4a6553; margin: 0; }

.cod-badge {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px;
  background: #fefce8;
  border: 2px solid #fbbf24;
  border-radius: 16px;
  margin-top: 16px;
}
.cod-icon  { font-size: 36px; }
.cod-title { font-weight: 700; font-size: 16px; color: #92400e; margin-bottom: 6px; }
.cod-desc  { font-size: 13px; color: #78350f; line-height: 1.5; }
.cod-amount { font-size: 24px; font-weight: 800; color: #d97706; margin-top: 8px; }

/* ── Form panel ── */
.form-panel {
  padding: 24px;
  animation: slideDown 0.25s ease;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.form-panel h4 { margin: 0 0 4px 0; font-size: 16px; font-weight: 700; color: #0a3520; }

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,30,18,0.55);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none !important; }
.modal-box { width: min(600px,100%); max-height: 90vh; overflow-y: auto; padding: 28px; animation: modalIn 0.25s ease; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-header h3 { margin: 0; font-size: 18px; font-weight: 700; }
.modal-close {
  background: #f2f6f3; border: none; width: 34px; height: 34px; border-radius: 10px;
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: #4a6553; transition: background 0.2s; box-shadow: none; padding: 0;
}
.modal-close:hover { background: #fee2e2; color: #b91c1c; transform: none; }

/* Order detail in modal */
.order-detail-section { margin-bottom: 14px; }
.order-detail-section h5 { margin: 0 0 6px 0; font-size: 14px; font-weight: 700; color: #2d4436; }
.order-items-list { display: flex; flex-direction: column; gap: 4px; }
.order-item-row { display: flex; justify-content: space-between; font-size: 14px; padding: 6px 0; border-bottom: 1px solid #eef2ef; }

/* Btn helpers */
.btn-sm { padding: 8px 14px !important; font-size: 13px !important; }
.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #00b14f, #008a3a);
  box-shadow: 0 8px 20px rgba(0,138,58,0.28);
  border: none;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform 0.2s, filter 0.2s;
  font-family: inherit;
  font-size: 14px;
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

/* Auth */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
  padding: 60px 0;
}
.auth-card { padding: 32px; }
.auth-card h2 { margin: 0 0 4px 0; font-size: 22px; font-weight: 800; }
.promo-icon { font-size: 52px; margin-bottom: 16px; }
.auth-promo h1 { font-size: 28px; font-weight: 800; line-height: 1.25; color: #0a3520; margin: 0 0 10px 0; }
.auth-promo p  { color: #3b5249; font-size: 15px; line-height: 1.6; }
.promo-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.promo-badge  { padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,0.25); border: 1px solid rgba(0,100,50,0.15); font-size: 13px; font-weight: 600; color: #0a3520; }
.tabs { display: flex; gap: 6px; }
.tab-btn { padding: 9px 18px; border-radius: 10px; font-weight: 600; color: #4a6553; background: #f2f6f3; border: 1px solid #d3ddd7; cursor: pointer; transition: all 0.2s; box-shadow: none; }
.tab-btn.active { background: var(--brand-soft); color: #006e2f; border-color: #a3e6bf; }
.tab-btn:hover { transform: none; }
.intro { margin: 0 0 16px 0; font-size: 14px; }

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; padding: 32px 0; }
  .stores-grid { grid-template-columns: 1fr; }
  .main-tab { font-size: 12px; padding: 8px 10px; }
}
