:root {
  --bg: #080b14;
  --panel: #111827;
  --panel-soft: #172033;
  --card: #0f172a;
  --text: #f9fafb;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #facc15;
  --accent-2: #ef4444;
  --good: #22c55e;
  --bad: #fb7185;
  --radius: 22px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(239, 68, 68, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(250, 204, 21, 0.13), transparent 30rem),
    var(--bg);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(8, 11, 20, 0.78);
  border-bottom: 1px solid var(--line);
}

.navbar-inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 1.35rem;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--muted);
  font-weight: 650;
}

.nav-links a:hover { color: var(--text); }

.badge {
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #111827;
  font-size: 0.82rem;
  font-weight: 900;
}

.hero {
  padding: 72px 0 46px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 34px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(250, 204, 21, 0.35);
  background: rgba(250, 204, 21, 0.1);
  border-radius: 999px;
  color: #fde68a;
  font-weight: 800;
  font-size: 0.9rem;
}

h1, h2, h3 { margin: 0; letter-spacing: -0.04em; }

h1 {
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.92;
  margin-top: 20px;
}

h2 { font-size: clamp(1.8rem, 4vw, 3.2rem); }

.lead {
  margin: 22px 0 0;
  max-width: 640px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 900;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #fb923c);
  color: #111827;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-danger {
  background: rgba(251, 113, 133, 0.12);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.3);
}

.hero-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.hero-product {
  border-radius: 26px;
  background: var(--card);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.hero-product img {
  width: min(260px, 80%);
  margin: 0 auto;
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.45));
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 28px;
}

.stat {
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.05);
  border-radius: 18px;
  padding: 16px;
}

.stat strong { display: block; font-size: 1.3rem; }
.stat span { color: var(--muted); font-size: 0.88rem; }

.section {
  padding: 44px 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card {
  background: rgba(17, 24, 39, 0.82);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.product-card {
  display: flex;
  flex-direction: column;
}

.product-media {
  background: radial-gradient(circle at center, rgba(250, 204, 21, 0.16), transparent 60%), #0b1020;
  min-height: 230px;
  display: grid;
  place-items: center;
  padding: 24px;
}

.product-media img {
  width: 160px;
  height: 210px;
  object-fit: contain;
}

.product-body {
  padding: 18px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.product-title {
  font-size: 1rem;
  line-height: 1.35;
  min-height: 43px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.pill.danger {
  background: rgba(251, 113, 133, 0.13);
  color: #fecdd3;
  border: 1px solid rgba(251, 113, 133, 0.25);
}

.price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.price {
  color: #fde68a;
  font-weight: 950;
  font-size: 1.2rem;
}

.filters {
  display: grid;
  grid-template-columns: 1.4fr 0.65fr 0.75fr auto;
  gap: 12px;
  margin-bottom: 22px;
}

.form-card {
  max-width: 460px;
  margin: 44px auto;
  padding: 26px;
}

.input, select, textarea {
  width: 100%;
  min-height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

textarea { min-height: 110px; padding-top: 14px; }
select option { background: #111827; }

.form-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.two-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.message {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.07);
  color: var(--muted);
}

.message.error { background: rgba(251, 113, 133, 0.12); color: #fecdd3; }
.message.success { background: rgba(34, 197, 94, 0.12); color: #bbf7d0; }

.cart-layout, .product-layout, .admin-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 22px;
  align-items: start;
}

.cart-item, .order-row, .admin-row {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child, .order-row:last-child, .admin-row:last-child { border-bottom: 0; }

.cart-item img {
  width: 70px;
  height: 90px;
  object-fit: contain;
}

.summary-card {
  padding: 22px;
  position: sticky;
  top: 96px;
}

.summary-line {
  display: flex;
  justify-content: space-between;
  margin: 12px 0;
  color: var(--muted);
}

.summary-line.total {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--text);
  font-weight: 950;
  font-size: 1.15rem;
}

.footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  padding: 34px 0;
  color: var(--muted);
}

.small { color: var(--muted); font-size: 0.9rem; line-height: 1.6; }
.hidden { display: none !important; }

.admin-tabs {
  display: flex;
  gap: 10px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.table-like {
  display: grid;
  gap: 12px;
}

@media (max-width: 920px) {
  .hero-grid, .cart-layout, .product-layout, .admin-layout { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr; }
  .nav-links { gap: 10px; font-size: 0.9rem; }
}

@media (max-width: 560px) {
  .grid, .stats, .two-cols { grid-template-columns: 1fr; }
  .navbar-inner { height: auto; padding: 14px 0; align-items: flex-start; }
  .nav-links { flex-wrap: wrap; justify-content: flex-end; }
  .cart-item, .order-row, .admin-row { grid-template-columns: 1fr; }
}

.form-card-wide {
  max-width: 760px;
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.field-label .input {
  margin-top: 0;
}

.required-star {
  color: var(--accent);
  font-weight: 950;
  margin-left: 3px;
}

.optional-text {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  margin-left: 4px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.92rem;
}

.check-row input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.account-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 22px;
  align-items: start;
}

.account-card {
  padding: 22px;
}

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


.profile-detail-grid {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.profile-detail {
  display: grid;
  gap: 4px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.profile-detail span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.profile-detail strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stock-label {
  margin-top: 8px;
  font-weight: 850;
  color: #fde68a;
}

.purchase-box {
  margin-top: auto;
  display: grid;
  gap: 12px;
}

.qty-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 850;
}

.qty-input {
  width: 86px;
  min-height: 42px;
  text-align: center;
  padding: 0 8px;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.product-actions .btn {
  width: 100%;
}

.detail-qty {
  margin-top: 16px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
}

.detail-actions {
  grid-template-columns: 1fr 1fr;
  margin-top: 14px;
}

.cart-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999;
  max-width: min(420px, calc(100vw - 32px));
  padding: 15px 18px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 18px;
  background: rgba(17, 24, 39, 0.96);
  color: #bbf7d0;
  box-shadow: var(--shadow);
  transform: translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-weight: 850;
}

.cart-toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 560px) {
  .detail-actions { grid-template-columns: 1fr; }
}

.order-card {
  overflow: hidden;
}

.order-summary {
  width: 100%;
  border: 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.order-summary:hover {
  background: rgba(255, 255, 255, 0.035);
}

.order-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.order-statuses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.order-total {
  color: #fde68a;
  font-weight: 950;
  white-space: nowrap;
}

.order-chevron {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
  white-space: nowrap;
}

.order-details {
  border-top: 1px solid var(--line);
  padding: 18px;
  background: rgba(8, 11, 20, 0.28);
}

.order-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.order-detail-box {
  display: grid;
  gap: 5px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.order-detail-box span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.order-detail-box strong {
  color: var(--text);
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.order-items {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.order-items h3 {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.order-item-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.order-item-row img {
  width: 54px;
  height: 72px;
  object-fit: contain;
}

.order-item-numbers {
  display: grid;
  gap: 4px;
  text-align: right;
  color: var(--muted);
  white-space: nowrap;
}

.order-item-numbers strong {
  color: var(--text);
}

.order-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 0.7fr;
  gap: 14px;
  align-items: start;
  margin-top: 16px;
}

.order-totals {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.order-totals div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
}

.order-totals strong {
  color: var(--text);
}

.order-totals .order-grand-total {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  color: var(--text);
  font-weight: 950;
}

.empty-order-card {
  padding: 20px;
}

@media (max-width: 920px) {
  .order-summary,
  .order-detail-grid,
  .order-bottom-grid {
    grid-template-columns: 1fr;
  }

  .order-item-row {
    grid-template-columns: 54px 1fr;
  }

  .order-item-numbers {
    grid-column: 1 / -1;
    text-align: left;
  }
}

.admin-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.admin-nav-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 22px 0;
}

.admin-nav-card {
  padding: 22px;
  display: grid;
  gap: 10px;
  min-height: 145px;
}

.admin-nav-card strong {
  font-size: 1.25rem;
}

.admin-nav-card span {
  color: var(--muted);
  line-height: 1.55;
}

.compact-stats {
  grid-template-columns: repeat(2, 1fr);
}

.admin-thumb {
  width: 58px;
  height: 76px;
  object-fit: contain;
}

.admin-order-card {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.admin-order-top {
  border-bottom: 1px solid var(--line);
}

.admin-order-summary {
  width: 100%;
  border: 0;
  cursor: pointer;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px;
  background: transparent;
  color: var(--text);
  text-align: left;
}

.admin-order-summary:hover {
  background: rgba(255,255,255,0.035);
}

.admin-order-summary small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-order-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  padding: 16px 18px;
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid var(--line);
}

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

@media (max-width: 920px) {
  .admin-nav-cards,
  .admin-order-summary,
  .admin-order-controls,
  .compact-stats {
    grid-template-columns: 1fr;
  }
}

.admin-filter-label {
  min-width: 240px;
}

.admin-filter-label select {
  margin-top: 8px;
}

.admin-order-filter-head {
  align-items: flex-end;
  gap: 18px;
}

.section-head.compact {
  margin-bottom: 4px;
}

.admin-section-card {
  padding: 22px;
}

.admin-product-filters {
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  margin-top: 18px;
}

.admin-product-status-filters {
  grid-template-columns: repeat(4, minmax(170px, 1fr));
}

@media (min-width: 921px) {
  .filters {
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(160px, 0.75fr)) auto;
  }

  .admin-product-filters {
    grid-template-columns: repeat(3, minmax(180px, 1fr));
  }

  .admin-product-status-filters {
    grid-template-columns: repeat(4, minmax(170px, 1fr));
  }
}

@media (max-width: 920px) {
  .admin-product-filters {
    grid-template-columns: 1fr;
  }
}

.admin-row {
  grid-template-columns: 84px 1fr auto auto;
}

@media (max-width: 560px) {
  .admin-row {
    grid-template-columns: 1fr;
  }
}


.admin-edit-card {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.admin-edit-head {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 16px;
  align-items: center;
}

.admin-edit-head img {
  width: 74px;
  height: 92px;
  object-fit: contain;
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
}

.admin-edit-form {
  display: grid;
  gap: 14px;
}

.admin-edit-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

@media (max-width: 720px) {
  .admin-edit-head {
    grid-template-columns: 54px 1fr;
  }
  .admin-edit-head .order-statuses {
    grid-column: 1 / -1;
  }
}

.product-gallery {
  display: grid;
  gap: 14px;
}

.product-gallery > img {
  width: 100%;
  max-height: 540px;
  object-fit: contain;
}

.gallery-thumbs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.gallery-thumbs button {
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  padding: 6px;
  cursor: pointer;
}

.gallery-thumbs button:hover {
  border-color: rgba(250, 204, 21, .65);
}

.gallery-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.image-upload-block {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.03);
}

.current-images {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.current-images img {
  width: 70px;
  height: 88px;
  object-fit: contain;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.05);
  padding: 4px;
}

/* Responsive polish: safer layouts for tablets and phones */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
}

.input,
select,
textarea,
button {
  max-width: 100%;
}

.section-head {
  flex-wrap: wrap;
  align-items: flex-start;
}

.section-head > div {
  min-width: 0;
}

.section-head h1,
.form-card h1 {
  font-size: clamp(2rem, 7vw, 3rem) !important;
  line-height: 1.02;
}

.admin-subnav,
.button-row,
.hero-actions,
.nav-links {
  scrollbar-width: thin;
}

.admin-subnav .btn,
.nav-links a,
.nav-links span,
.button-row .btn {
  white-space: nowrap;
}

.product-title,
.logo,
h1,
h2,
h3,
.order-summary,
.admin-order-summary,
.admin-edit-head,
.profile-detail strong,
.order-detail-box strong {
  overflow-wrap: anywhere;
}

.product-card .btn,
.purchase-box .btn,
.admin-edit-actions .btn,
.order-actions .btn {
  min-width: 0;
}

.admin-section-card,
.form-card,
.account-card,
.summary-card,
.order-details {
  min-width: 0;
}

.current-images,
.gallery-thumbs,
.admin-subnav {
  max-width: 100%;
}

@media (max-width: 1180px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filters .btn {
    width: 100%;
  }
}

@media (max-width: 920px) {
  .container {
    width: min(100% - 24px, 760px);
  }

  .hero {
    padding: 46px 0 28px;
  }

  .section {
    padding: 30px 0;
  }

  .section-head {
    gap: 14px;
  }

  .section-head > .btn {
    width: 100%;
  }

  .navbar-inner {
    height: auto;
    padding: 14px 0;
    flex-wrap: wrap;
  }

  .logo {
    font-size: 1.15rem;
  }

  .nav-links {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters,
  .admin-product-filters,
  .admin-product-status-filters,
  .admin-order-filter-head,
  .admin-order-controls {
    grid-template-columns: 1fr;
  }

  .admin-filter-label {
    min-width: 0;
    width: 100%;
  }

  .admin-subnav {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-left: -2px;
    margin-right: -2px;
  }

  .admin-subnav .btn {
    flex: 0 0 auto;
  }

  .cart-layout,
  .product-layout,
  .admin-layout,
  .account-layout,
  .order-bottom-grid {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }

  .product-media {
    min-height: 200px;
  }

  .order-summary,
  .admin-order-summary {
    grid-template-columns: 1fr;
  }

  .order-total,
  .order-chevron {
    white-space: normal;
  }

  .admin-order-controls .btn {
    width: 100%;
  }
}

@media (max-width: 680px) {
  .container {
    width: calc(100% - 20px);
  }

  .grid {
    grid-template-columns: 1fr;
  }

  .stats,
  .two-cols,
  .detail-actions,
  .order-detail-grid,
  .compact-stats {
    grid-template-columns: 1fr;
  }

  .hero-card,
  .hero-product,
  .form-card,
  .account-card,
  .admin-section-card,
  .summary-card,
  .order-details,
  .admin-edit-card {
    border-radius: 18px;
    padding: 16px;
  }

  .card {
    border-radius: 18px;
  }

  .btn {
    min-height: 44px;
    padding: 0 14px;
  }

  .hero-actions .btn,
  .button-row .btn,
  .admin-edit-actions .btn,
  .order-actions .btn {
    width: 100%;
  }

  .cart-item,
  .order-row,
  .admin-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .cart-item img,
  .admin-thumb {
    width: 64px;
    height: 82px;
  }

  .price-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .qty-control {
    align-items: stretch;
    flex-direction: column;
  }

  .qty-input {
    width: 100%;
  }

  .order-item-row {
    grid-template-columns: 54px 1fr;
  }

  .order-item-numbers {
    grid-column: 1 / -1;
    text-align: left;
    white-space: normal;
  }

  .admin-edit-head {
    grid-template-columns: 54px 1fr;
  }

  .admin-edit-head img {
    width: 54px;
    height: 72px;
  }

  .admin-edit-head .order-statuses {
    grid-column: 1 / -1;
  }

  .product-gallery > img {
    max-height: 360px;
  }

  .gallery-thumbs button {
    width: 58px;
    height: 58px;
  }

  .cart-toast {
    left: 10px;
    right: 10px;
    bottom: 12px;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
  }

  .nav-links {
    gap: 10px;
    font-size: 0.86rem;
  }

  .badge {
    min-width: 21px;
    height: 21px;
    font-size: 0.75rem;
  }

  .product-media img {
    width: 135px;
    height: 180px;
  }

  .product-media {
    min-height: 180px;
    padding: 18px;
  }

  .order-summary,
  .admin-order-summary,
  .admin-order-controls,
  .order-details {
    padding: 14px;
  }
}

.coupon-form {
  display: grid;
  gap: 12px;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  background: rgba(255,255,255,0.035);
}

.coupon-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

select[multiple] {
  min-height: 180px;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.footer-links a {
  color: inherit;
  text-decoration: none;
  opacity: 0.9;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.legal-card {
  padding: 28px;
  display: grid;
  gap: 14px;
  line-height: 1.65;
}

.legal-card h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

.legal-card h2 {
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0,0,0,0.68);
  backdrop-filter: blur(6px);
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  width: min(620px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 24px;
  border-radius: 24px;
  background: var(--card-bg, #111827);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 22px 70px rgba(0,0,0,0.45);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

textarea.input {
  min-height: 110px;
  resize: vertical;
}

.withdrawal-item-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.withdrawal-item-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}

.withdrawal-item-choice input {
  margin-top: 4px;
}

.withdrawal-item-choice span {
  display: grid;
  gap: 4px;
}

.withdrawal-item-note,
.item-withdrawal-admin {
  margin-top: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
}

.inline-status-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.inline-status-form select {
  min-width: 220px;
}

.readonly-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 14px;
  background: rgba(255,255,255,.05);
  color: var(--text);
  font-weight: 800;
}
