
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background: #fdfbf7;
  color: #2e1d13;
  -webkit-font-smoothing: antialiased;
}

/* Header */
header {
  background: #7a1515;
  color: #fff;
  padding: 14px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.logo small {
  display: block;
  font-size: 11px;
  color: #ffd98a;
  font-weight: normal;
  letter-spacing: 0.02em;
}

/* Buttons */
.btn {
  border: 0;
  border-radius: 8px;
  padding: 10px 18px;
  background: #7a1515;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.btn:hover {
  background: #640f0f;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(122, 21, 21, 0.2);
}
.btn:active {
  transform: translateY(0);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: #fff;
  color: #7a1515;
  border: 1px solid #e2cfb9;
}
.btn-ghost:hover {
  background: #fdf6ec;
  box-shadow: none;
}
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}
.gold {
  background: #c9820c;
}
.gold:hover {
  background: #b07007;
  box-shadow: 0 4px 10px rgba(201, 130, 12, 0.25);
}

/* Hero Section */
.hero {
  padding: 60px 6%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #fff3dc 0%, #fdfbf7 100%);
  border-bottom: 1px solid #ebd9c5;
}
.hero small {
  font-size: 12px;
  font-weight: 700;
  color: #a05a1e;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 {
  font-size: 40px;
  line-height: 1.15;
  margin: 10px 0 14px;
  color: #441111;
}
.hero p {
  font-size: 16px;
  color: #5c4533;
  margin-bottom: 22px;
  max-width: 520px;
}
.heroicon {
  font-size: 90px;
  user-select: none;
}

/* Section Structure */
section {
  padding: 40px 6%;
}
section h2 {
  font-size: 24px;
  margin-top: 0;
  margin-bottom: 20px;
  color: #441111;
  border-bottom: 2px solid #ecd8c0;
  padding-bottom: 8px;
  display: inline-block;
}

/* Grids & Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.category-card {
  background: #fff;
  border: 1px solid #ebd9c5;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(61, 37, 23, 0.08);
  border-color: #d1b496;
}
.card {
  background: #fff;
  border: 1px solid #ebd9c5;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 3px 10px rgba(0,0,0,0.03);
  transition: all 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(61, 37, 23, 0.07);
}
.pic {
  height: 170px;
  border-radius: 10px;
  background: #fbf5ec;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 68px;
  overflow: hidden;
  margin-bottom: 12px;
}
.pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 700;
  color: #381f13;
}
.card p {
  margin: 0 0 10px;
  font-size: 13px;
  color: #715542;
  flex: 1;
}
.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #f4e9dc;
}
.price {
  font-size: 19px;
  font-weight: 800;
  color: #7a1515;
}

/* Inputs & Forms */
.search, input, textarea, select {
  padding: 11px 14px;
  border: 1px solid #d4beaa;
  border-radius: 8px;
  font-size: 14px;
  background: #fff;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #7a1515;
  box-shadow: 0 0 0 3px rgba(122, 21, 21, 0.12);
}
.search {
  width: 100%;
  max-width: 500px;
  margin-bottom: 24px;
  display: block;
}

/* Panels / Modals */
.panel {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(45, 25, 15, 0.6);
  backdrop-filter: blur(2px);
  z-index: 1000;
  overflow-y: auto;
  padding: 30px 16px;
}
.box {
  max-width: 600px;
  margin: 20px auto;
  background: #fff;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.18);
  border: 1px solid #ebd9c5;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
  margin-bottom: 18px;
}
.panel-header h2 {
  margin: 0;
  font-size: 20px;
  color: #441111;
}
.form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #f2e7db;
  padding: 12px 0;
}

/* Quantity controls in cart */
.qty-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}
.qty-btn {
  background: #f4ebd9;
  border: 1px solid #d8c4ae;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  color: #4a2d18;
}
.qty-btn:hover {
  background: #eadbc2;
}

/* Toast Notification */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2b170c;
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.22);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: translateY(0);
}
#toast.error {
  background: #8b1e1e;
}
#toast.success {
  background: #216d29;
}

/* Footer */
footer {
  background: #2d180d;
  color: #e2cbba;
  padding: 36px 6%;
  font-size: 14px;
  margin-top: 40px;
}

/* Responsive */
@media(max-width: 650px) {
  h1 { font-size: 28px; }
  .hero { flex-direction: column; text-align: center; gap: 20px; padding: 40px 6%; }
  .hero p { margin: 0 auto 20px; }
  .heroicon { font-size: 60px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .pic { height: 130px; font-size: 50px; }
  .box { padding: 18px; margin: 10px auto; }
}

/* Admin Specific */
.admin-shell { display: flex; gap: 20px; align-items: flex-start; }
.admin-nav {
  width: 190px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: #fff;
  border: 1px solid #ead8bd;
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-nav button {
  text-align: left;
  background: #fff;
  color: #3d2517;
  border: 1px solid transparent;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}
.admin-nav button.active { background: #7a1515; color: #fff; }
.admin-main { flex: 1; min-width: 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: #fff; border: 1px solid #ead8bd; border-radius: 12px; padding: 14px; }
.kpi small { color: #8a6a4d; font-weight: 600; letter-spacing: .04em; }
.kpi b { font-size: 22px; display: block; margin-top: 4px; }
.badge { padding: 3px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; border: 1px solid #ead8bd; background: #fff; }
.badge-paid { background: #e6f6e6; border-color: #b6e0b6; color: #1a6b1a; }
.badge-pending { background: #fff3d6; border-color: #f0d48a; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.table-wrap { background: #fff; border: 1px solid #ead8bd; border-radius: 12px; overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; background: #fff6e3; padding: 10px; border-bottom: 1px solid #ead8bd; white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid #f0e0c6; vertical-align: middle; }
#admin.panel { padding: 0; overflow-y: auto; background: #fdfbf7; }
#admin .box { max-width: 1280px; padding: 0 20px 0; background: transparent; border: 0; box-shadow: none; border-radius: 0; }
.admin-top { position: sticky; top: 0; background: #fdfbf7; z-index: 2; padding: 16px 20px; margin: 0 -20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid #ead8bd; }
.admin-shell { padding-top: 16px; }
.admin-main { padding-bottom: 80px; }
.order-card { background: #fff; border: 1px solid #ead8bd; border-radius: 14px; padding: 0; margin-bottom: 12px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,0.05); border-left-width: 4px; }
.order-card.paid { border-left-color: #2e7d32; }
.order-card.unpaid { border-left-color: #d99a22; }
.order-card.cancelled { border-left-color: #b0b0b0; opacity: .92; }
.order-card-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: #fff8ec; padding: 10px 14px; border-bottom: 1px solid #f0e0c6; align-items: center; }
.orderNo { font-family: ui-monospace, monospace; font-size: 13px; }
.order-card-body { padding: 12px 14px; display: grid; grid-template-columns: 1fr 190px; gap: 14px; align-items: center; }
.order-card-meta { font-size: 13px; color: #5a3d2a; line-height: 1.5; }
.order-card-actions { display: flex; flex-direction: column; gap: 8px; }
@media(max-width: 800px) {
  .admin-shell { flex-direction: column; }
  .admin-nav { width: 100%; flex-direction: row; overflow: auto; position: static; }
}

/* Order Item & Customer Order Card Styles */
.box-wide {
  max-width: 760px;
}

.cust-order-card {
  background: #fff;
  border: 1px solid #ebd9c5;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(61, 37, 23, 0.04);
  transition: transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid #d99a22;
}
.cust-order-card.status-pending { border-left-color: #d99a22; }
.cust-order-card.status-confirmed { border-left-color: #0c8599; }
.cust-order-card.status-shipped { border-left-color: #4263eb; }
.cust-order-card.status-delivered { border-left-color: #2b8a3e; }
.cust-order-card.status-cancelled { border-left-color: #c92a2a; opacity: 0.88; }

.cust-order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f4e9dd;
}
.cust-order-num {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  color: #381f13;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.cust-order-date {
  font-size: 12px;
  color: #8c7360;
  margin-top: 2px;
}
.cust-order-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.badge-chip {
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.badge-chip-pending { background: #fff3d6; color: #856404; border: 1px solid #f0d48a; }
.badge-chip-confirmed { background: #e3f7fa; color: #0c5460; border: 1px solid #bee5eb; }
.badge-chip-shipped { background: #edf2ff; color: #364fc7; border: 1px solid #bac8ff; }
.badge-chip-delivered { background: #ebfbee; color: #2b8a3e; border: 1px solid #b2f2bb; }
.badge-chip-cancelled { background: #fff5f5; color: #c92a2a; border: 1px solid #ffc9c9; }
.badge-chip-paid { background: #ebfbee; color: #2b8a3e; border: 1px solid #b2f2bb; }
.badge-chip-cod { background: #fdf5e6; color: #9c5c00; border: 1px solid #f7dfa7; }

/* Items List inside Order */
.cust-order-items {
  margin: 12px 0;
  background: #fdfaf6;
  border: 1px solid #f0e4d4;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cust-order-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #eedfcb;
}
.cust-order-item-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}
.cust-item-thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: #f7ede0;
  border: 1px solid #ebd9c5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  overflow: hidden;
  flex-shrink: 0;
}
.cust-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cust-item-details {
  flex: 1;
  min-width: 0;
}
.cust-item-name {
  font-size: 14px;
  font-weight: 700;
  color: #381f13;
  line-height: 1.3;
  word-break: break-word;
}
.cust-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #785c47;
  margin-top: 3px;
  flex-wrap: wrap;
}
.cust-item-cat {
  background: #f1e4d3;
  color: #63432d;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.cust-item-price {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: #7a1515;
  white-space: nowrap;
  margin-left: auto;
}
.cust-item-price small {
  display: block;
  font-size: 11px;
  font-weight: normal;
  color: #8c7360;
}
.cust-item-qty {
  color: #6b4a2f;
}

.admin-order-item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px dashed #e8dac9;
}
.admin-order-item-row:last-child { border-bottom: none; }
.admin-order-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 7px;
  background: #f7ead7;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  font-size: 19px;
}
.admin-order-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.admin-order-item-details { flex: 1; min-width: 0; color: #3d2517; }
.admin-order-item-details > b { font-size: 13px; word-break: break-word; }
.admin-order-item-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 3px;
  color: #8a6a4d;
  font-size: 11px;
}
.admin-order-item-price {
  color: #7a1515;
  font-size: 13px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}
.admin-order-item-price small {
  display: block;
  color: #8a6a4d;
  font-size: 10px;
  font-weight: 400;
}

@media (max-width: 520px) {
  .cust-order-item-row { align-items: flex-start; gap: 9px; }
  .cust-item-thumb { width: 44px; height: 44px; font-size: 21px; }
  .cust-item-price { font-size: 13px; }
  .cust-item-price small { font-size: 10px; }
}

/* Order Card Footer */
.cust-order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #f4e9dd;
}
.cust-order-address-snippet {
  font-size: 12px;
  color: #6e5039;
  line-height: 1.4;
  flex: 1;
  min-width: 200px;
}
.cust-order-total-block {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-left: auto;
}
.cust-order-total-label {
  font-size: 13px;
  color: #785c47;
  font-weight: 600;
}
.cust-order-total-val {
  font-size: 18px;
  font-weight: 800;
  color: #7a1515;
}
.cust-order-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-end;
  margin-top: 4px;
}
.btn-track {
  background: #7a1515;
  color: #fff !important;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid #7a1515;
  transition: all 0.15s ease;
  cursor: pointer;
}
.btn-track:hover {
  background: #941e1e;
  border-color: #941e1e;
}
.btn-reorder {
  background: #fff;
  border: 1px solid #d4beaa;
  color: #4a2d18;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.btn-reorder:hover {
  background: #fbf5ee;
  border-color: #8a6a4d;
}

/* Order Confirmation Dialog / Success Modal */
.order-success-banner {
  text-align: center;
  padding: 20px 10px 16px;
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
  border-radius: 12px;
  border: 1px solid #f7dfa7;
  margin-bottom: 20px;
}
.order-success-icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 10px;
  display: inline-block;
  animation: pulse-glow 2s infinite ease-in-out;
}
@keyframes pulse-glow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.order-success-title {
  font-size: 20px;
  font-weight: 800;
  color: #7a1515;
  margin: 0 0 4px;
}
.order-success-subtitle {
  font-size: 13px;
  color: #785c47;
  margin: 0;
}
.order-summary-box {
  background: #fdfaf6;
  border: 1px solid #ebd9c5;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
}
.order-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: #5a3d2a;
}
.order-summary-row.bold {
  font-weight: 700;
  font-size: 15px;
  color: #381f13;
  border-top: 1px solid #ebd9c5;
  margin-top: 6px;
  padding-top: 10px;
}

