/* Shopmart app-specific styles — built on tokens from styles.css. */

/* ----- auth/account button ----- */
.btn-login.btn-greet {
  width: auto;
  background: transparent;
  color: #fff;
  font-weight: 600;
  padding: 0 12px;
  text-transform: capitalize;
}
.dropdown-sep { height: 1px; background: var(--line); margin: 4px 0; }

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
  border-radius: 9px;
  background: var(--gold);
  color: #212121;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

/* ----- common button variants ----- */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 2px;
  background: #ff9f00; color: #fff;
  font-size: 15px; font-weight: 600;
  padding: 12px 22px;
  text-transform: uppercase;
  letter-spacing: .3px;
  cursor: pointer;
}
.btn-primary:hover { background: #e68a00; }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 2px;
  background: #fb641b; color: #fff;
  font-size: 15px; font-weight: 600;
  padding: 12px 22px;
  text-transform: uppercase;
  letter-spacing: .3px;
  cursor: pointer;
}
.btn-secondary:hover { background: #e0550f; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 2px;
  background: #fff; color: var(--text);
  font-size: 14px; font-weight: 500;
  padding: 9px 18px;
  cursor: pointer;
}
.btn-ghost:hover { background: #f5faff; color: var(--blue); }

.btn-link {
  background: none; border: 0; padding: 0;
  color: var(--blue); cursor: pointer;
  font-size: 14px; font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

.btn-danger { color: #c62828; }
.btn-danger:hover { background: #fff5f5; }

/* ----- toast ----- */
.toast-host {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 1000;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: #212121; color: #fff;
  font-size: 14px; padding: 10px 16px;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s, transform .2s;
  max-width: 360px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast-error { background: #c62828; }
.toast-success { background: #2e7d32; }

/* ----- forms ----- */
.form-card {
  max-width: 760px;
  margin: 24px auto;
  background: #fff;
  box-shadow: var(--shadow-1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.form-card .form-info {
  background: var(--blue);
  color: #fff;
  padding: 28px 28px;
}
.form-card .form-info h1 { margin: 0 0 6px; font-size: 24px; font-weight: 500; }
.form-card .form-info p  { margin: 0; opacity: .92; line-height: 1.5; }
.form-card .form-body   { padding: 28px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
}
.form-grid .field-full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px; color: var(--muted);
  font-weight: 500;
}
.field input, .field select, .field textarea {
  border: 1px solid #d0d4da;
  background: #fff;
  border-radius: 2px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.field .help { font-size: 12px; color: var(--muted); }
.field .err  { font-size: 12px; color: #c62828; min-height: 14px; }
.form-actions {
  display: flex; align-items: center; gap: 16px;
  margin-top: 22px;
  flex-wrap: wrap;
}
.form-actions .form-error { color: #c62828; font-size: 13px; }
.form-foot {
  padding: 18px 28px;
  background: #f7f8fa;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}
.form-foot a { color: var(--blue); }

@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ----- page container ----- */
.page {
  max-width: var(--container);
  margin: 8px auto 0;
  padding: 0 8px;
}
.page-card {
  background: #fff;
  box-shadow: var(--shadow-1);
  padding: 20px 24px;
}
.page-title { margin: 0 0 4px; font-size: 22px; font-weight: 500; }
.page-sub   { margin: 0 0 18px; color: var(--muted); }
.crumbs {
  display: flex; flex-wrap: wrap; gap: 6px;
  font-size: 13px; color: var(--muted);
  margin: 8px 0 12px;
}
.crumbs a { color: var(--blue); }
.crumbs .sep { color: #b0b0b0; }

/* ----- product list ----- */
.list-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px;
  align-items: start;
}
.filter-rail {
  background: #fff;
  box-shadow: var(--shadow-1);
  padding: 14px 16px;
  position: sticky; top: 72px;
}
.filter-rail h3 { margin: 0 0 8px; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: .3px; }
.filter-rail ul { display: flex; flex-direction: column; gap: 4px; }
.filter-rail a {
  display: flex; justify-content: space-between;
  padding: 6px 8px; font-size: 14px;
  border-radius: 2px;
}
.filter-rail a:hover, .filter-rail a.is-active { background: #f5faff; color: var(--blue); }
.filter-rail a .n { color: var(--muted); font-size: 12px; }

.list-main { display: flex; flex-direction: column; gap: 0; }
.list-toolbar {
  background: #fff;
  box-shadow: var(--shadow-1);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 8px;
}
.list-toolbar .count { font-size: 14px; color: var(--muted); }
.list-toolbar select {
  border: 1px solid #d0d4da;
  background: #fff;
  padding: 6px 10px;
  font: inherit;
  border-radius: 2px;
}
.list-grid {
  background: #fff;
  box-shadow: var(--shadow-1);
  padding: 8px 12px 22px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
@media (max-width: 1100px) { .list-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) {
  .list-layout { grid-template-columns: 1fr; }
  .list-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-rail { position: static; }
}

.empty, .list-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  box-shadow: var(--shadow-1);
}

.pager {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 12px 0 0; padding: 12px;
}
.pager button {
  border: 1px solid #d0d4da; background: #fff; color: var(--text);
  padding: 6px 12px; font-size: 13px; border-radius: 2px;
  cursor: pointer;
}
.pager button:disabled { opacity: .45; cursor: not-allowed; }
.pager .page-info { color: var(--muted); font-size: 13px; }

/* ----- product detail (PDP) ----- */
.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  max-width: var(--container);
  margin: 8px auto 0;
}
.pdp-media {
  background: #fff;
  box-shadow: var(--shadow-1);
  padding: 20px;
  display: flex; align-items: center; justify-content: center;
  position: sticky; top: 72px;
}
.pdp-media img { max-width: 100%; max-height: 480px; }
.pdp-info {
  background: #fff;
  box-shadow: var(--shadow-1);
  padding: 20px 24px;
}
.pdp-info .breadcrumb-line { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.pdp-info h1 { margin: 0 0 6px; font-size: 22px; font-weight: 500; }
.pdp-info .brand-line { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.pdp-rating {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green); color: #fff;
  font-size: 13px; font-weight: 600;
  padding: 3px 8px; border-radius: 3px;
}
.pdp-rating .n { color: #d8d8d8; font-weight: 500; }
.price-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 14px 0 6px; }
.price-now { font-size: 26px; font-weight: 600; color: #212121; }
.price-strike { color: var(--muted); text-decoration: line-through; font-size: 15px; }
.price-off   { color: var(--green); font-weight: 600; font-size: 14px; }
.pdp-info .desc { color: #444; line-height: 1.5; margin: 10px 0 16px; }
.pdp-stock { font-size: 14px; margin-bottom: 14px; }
.pdp-stock.in  { color: var(--green); font-weight: 600; }
.pdp-stock.out { color: #c62828; font-weight: 600; }
.qty-stepper {
  display: inline-flex; align-items: center;
  border: 1px solid #d0d4da; border-radius: 2px;
  overflow: hidden;
}
.qty-stepper button {
  width: 32px; height: 36px;
  border: 0; background: #fff; font-size: 18px; color: #212121;
  cursor: pointer;
}
.qty-stepper button:hover { background: #f5faff; color: var(--blue); }
.qty-stepper button:disabled { opacity: .4; cursor: not-allowed; }
.qty-stepper input {
  width: 44px; height: 36px;
  border: 0; border-left: 1px solid #d0d4da; border-right: 1px solid #d0d4da;
  text-align: center; font-size: 14px;
  -moz-appearance: textfield;
}
.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.pdp-actions { display: flex; gap: 12px; flex-wrap: wrap; margin: 18px 0 8px; }

.related-row {
  max-width: var(--container);
  margin: 8px auto 0;
  background: #fff;
  box-shadow: var(--shadow-1);
  padding: 18px 12px 22px;
}
.related-row h2 { margin: 0 12px 10px; font-size: 18px; font-weight: 500; }
.related-row .tile-row {
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  overflow: visible;
}
@media (max-width: 1100px) { .related-row .tile-row { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 820px)  { .related-row .tile-row { grid-template-columns: repeat(2, 1fr); } }

@media (max-width: 820px) {
  .pdp { grid-template-columns: 1fr; }
  .pdp-media { position: static; }
}

/* ----- cart page ----- */
.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 8px;
  align-items: start;
  max-width: var(--container);
  margin: 8px auto 0;
}
.cart-list { background: #fff; box-shadow: var(--shadow-1); }
.cart-row {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.cart-row:last-child { border-bottom: 0; }
.cart-row .img-box { width: 100px; height: 100px; background: #f7f8fa; display: flex; align-items: center; justify-content: center; }
.cart-row .img-box img { max-width: 100%; max-height: 100%; }
.cart-row .meta h3 { margin: 0 0 4px; font-size: 15px; font-weight: 500; }
.cart-row .meta .brand { color: var(--muted); font-size: 13px; }
.cart-row .meta .price { color: #212121; font-weight: 500; margin-top: 6px; }
.cart-row .line-total { font-weight: 600; min-width: 100px; text-align: right; }
.cart-row .remove { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: 13px; }

.price-card {
  background: #fff; box-shadow: var(--shadow-1);
  padding: 16px 20px;
  position: sticky; top: 72px;
}
.price-card h3 { margin: 0 0 12px; font-size: 12px; color: var(--muted); font-weight: 500; text-transform: uppercase; }
.price-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.price-line.total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 12px; font-weight: 600; font-size: 16px; }
.price-line .muted { color: var(--muted); }
.price-line .green { color: var(--green); font-weight: 500; }
.price-card .btn-primary { width: 100%; margin-top: 12px; }

@media (max-width: 820px) {
  .cart-layout { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 80px 1fr; gap: 12px; }
  .cart-row .qty-stepper, .cart-row .line-total, .cart-row .remove {
    grid-column: 1 / -1; justify-self: start;
  }
  .price-card { position: static; }
}

/* ----- checkout ----- */
.checkout { max-width: var(--container); margin: 8px auto 0; display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 8px; align-items: start; }
.step { background: #fff; box-shadow: var(--shadow-1); margin-bottom: 8px; }
.step h2 { margin: 0; font-size: 16px; font-weight: 500; padding: 14px 20px; display: flex; align-items: center; gap: 10px; background: #f7f8fa; border-bottom: 1px solid var(--line); }
.step h2 .num { width: 22px; height: 22px; background: var(--blue); color: #fff; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; }
.step .body { padding: 16px 20px; }
.addr-card {
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 12px 14px;
  display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start;
  cursor: pointer;
}
.addr-card.is-active { border-color: var(--blue); background: #f5faff; }
.addr-card .radio { width: 16px; height: 16px; border: 2px solid #b0b0b0; border-radius: 50%; margin-top: 3px; }
.addr-card.is-active .radio { border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--blue); }
.addr-card .actions { display: flex; flex-direction: column; gap: 4px; }
.addr-card .actions button { background: none; border: 0; color: var(--blue); cursor: pointer; font-size: 13px; padding: 0; text-align: right; }
.pay-grid { display: grid; gap: 10px; }
.pay-card {
  border: 1px solid var(--line); border-radius: 2px; padding: 12px 14px;
  display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start;
  cursor: pointer;
}
.pay-card.is-active { border-color: var(--blue); background: #f5faff; }
.pay-card .radio { width: 16px; height: 16px; border: 2px solid #b0b0b0; border-radius: 50%; margin-top: 3px; }
.pay-card.is-active .radio { border-color: var(--blue); box-shadow: inset 0 0 0 4px var(--blue); }
.pay-card .muted { color: var(--muted); font-size: 12px; }

.summary-items { display: flex; flex-direction: column; }
.summary-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center;
}
.summary-row:last-child { border-bottom: 0; }
.summary-row img { width: 56px; height: 56px; object-fit: contain; background: #f7f8fa; }
.summary-row .qty { color: var(--muted); font-size: 12px; }
.summary-row .amt { font-weight: 500; }

@media (max-width: 820px) {
  .checkout { grid-template-columns: 1fr; }
  .price-card { position: static; }
}

/* ----- user center ----- */
.account {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 8px;
  max-width: var(--container);
  margin: 8px auto 0;
}
.account-nav {
  background: #fff; box-shadow: var(--shadow-1);
  padding: 8px 0;
}
.account-nav a {
  display: block; padding: 10px 16px;
  font-size: 14px;
}
.account-nav a:hover, .account-nav a.is-active { background: #f5faff; color: var(--blue); }
.account-pane { background: #fff; box-shadow: var(--shadow-1); padding: 20px 24px; }
.account-pane h2 { margin: 0 0 14px; font-size: 18px; font-weight: 500; }
.order-card {
  border: 1px solid var(--line); border-radius: 2px;
  padding: 12px 14px; margin-bottom: 10px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  align-items: center;
}
.order-card .meta { font-size: 13px; color: var(--muted); }
.order-card .total { font-weight: 600; }

/* ----- wallet tab ----- */
.wallet-hero {
  background: linear-gradient(135deg, #2874f0 0%, #1a5fd0 100%);
  color: #fff;
  padding: 28px 32px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}
.wallet-hero::after {
  content: '';
  position: absolute;
  right: -40px; top: -40px;
  width: 200px; height: 200px;
  background: rgba(255,255,255,.08);
  border-radius: 50%;
}
.wallet-hero::before {
  content: '';
  position: absolute;
  right: 60px; bottom: -60px;
  width: 160px; height: 160px;
  background: rgba(255,255,255,.06);
  border-radius: 50%;
}
.wallet-hero-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
  opacity: .9;
}
.wallet-hero-value {
  font-size: 36px;
  font-weight: 600;
  margin-top: 6px;
  line-height: 1.1;
}
.wallet-hero-sub {
  font-size: 13px;
  opacity: .85;
  margin-top: 4px;
}

.wallet-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.wallet-stats .admin-stat-card { margin: 0; }

.wallet-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.wallet-cols:last-child { margin-bottom: 0; }
@media (max-width: 820px) {
  .wallet-stats { grid-template-columns: 1fr; }
  .wallet-cols  { grid-template-columns: 1fr; }
}

.wallet-card { margin: 0; }
.wallet-card-head {
  border-bottom: 1px solid var(--line);
  padding: 0 0 12px;
  margin-bottom: 14px;
}
.wallet-card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.wallet-card-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.wallet-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.wallet-form .form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}
.wallet-form .form-actions .form-error {
  margin-left: auto;
  color: #c62828;
  font-size: 13px;
}
.wallet-amount-wrap {
  position: relative;
}
.wallet-amount-wrap input {
  padding-left: 30px;
  font-size: 18px;
  font-weight: 600;
}
.wallet-amount-prefix {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 600;
  font-size: 16px;
  pointer-events: none;
}
.wallet-amount-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.wallet-warn {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fff8e1;
  border-left: 3px solid #f6a623;
  border-radius: 2px;
  font-size: 13px;
  color: #6b4d00;
}
.wallet-steps, .wallet-tips {
  margin: 0;
  padding-left: 20px;
  font-size: 13px;
  color: #444;
  line-height: 1.7;
}
.wallet-tips { padding-left: 18px; list-style: disc; }
.wallet-tips li, .wallet-steps li { margin-bottom: 4px; }

.wallet-card-info { background: #f7faff; }

.status-chip {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
  background: #fff8e1; color: #b26a00; text-transform: capitalize;
}
.status-chip.paid        { background: #e8f5e9; color: #2e7d32; }
.status-chip.cancelled   { background: #ffebee; color: #c62828; }
.status-chip.pending_payment { background: #fff8e1; color: #b26a00; }

@media (max-width: 820px) {
  .account { grid-template-columns: 1fr; }
}

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ----- success / empty pages ----- */
.success-card {
  background: #fff; box-shadow: var(--shadow-1);
  max-width: 560px; margin: 40px auto; padding: 32px 28px;
  text-align: center;
}
.success-card .check {
  width: 64px; height: 64px; margin: 0 auto 12px;
  background: var(--green); color: #fff;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 32px;
}
.success-card h1 { margin: 0 0 8px; font-size: 22px; }
.success-card .order-id { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
.success-card .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
