:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-soft: #fafafa;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --primary: #111827;
  --primary-dark: #000000;
  --secondary: #4b5563;
  --accent: #f3f4f6;
  --soft: #f9fafb;
  --dark: #111827;
  --danger: #b91c1c;
  --success: #047857;
  --radius: 16px;
  --shadow: 0 14px 30px rgba(17, 24, 39, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 12px rgba(17, 24, 39, .04);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

.site-nav a,
.link-button {
  color: var(--muted);
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.site-nav a:hover,
.site-nav .active,
.link-button:hover {
  color: var(--text);
}

.mobile-toggle {
  display: none;
  background: none;
  color: var(--text);
  border: 0;
  font-size: 1.5rem;
}

.pill {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: .78rem;
  font-weight: 800;
}

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

.hero {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(28px, 6vw, 76px);
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 32px;
  align-items: center;
  box-shadow: var(--shadow);
}

.hero h1 {
  font-size: clamp(2.1rem, 5vw, 4.5rem);
  line-height: 1.02;
  margin: 0 0 18px;
  letter-spacing: -.04em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 620px;
}

.hero-art {
  min-height: 320px;
  border-radius: 28px;
  background: #f9fafb;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--text);
  text-align: center;
  padding: 30px;
}

.hero-art strong {
  font-size: 3rem;
  color: var(--text);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  padding: 12px 18px;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: .2s;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(17, 24, 39, .08);
}

.btn-primary:hover {
  background: var(--secondary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(17, 24, 39, .10);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--text);
  box-shadow: 0 8px 18px rgba(17, 24, 39, .06);
}

.btn-danger {
  background: #ffffff;
  color: var(--danger);
  border-color: #fecaca;
}

.btn-small {
  padding: 8px 12px;
  border-radius: 10px;
  font-size: .9rem;
}

.btn-block {
  width: 100%;
}

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

.section-head h2,
.page-title h1 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
}

.page-title {
  margin-bottom: 24px;
}

.muted {
  color: var(--muted);
}

.sku {
  color: var(--secondary);
  text-transform: uppercase;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  margin: 0 0 6px;
}

.grid {
  display: grid;
  gap: 18px;
}

.category-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.products-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.category-card,
.product-card,
.card,
.summary-card,
.order-card,
.admin-row,
.admin-order-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 8px 22px rgba(17, 24, 39, .04);
}

.category-card:hover,
.product-card:hover,
.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(17, 24, 39, .07);
  transition: .2s;
}

/* Clean homepage/category display */
.category-card {
  position: relative !important;
  display: block !important;
  overflow: hidden !important;
  background: #ffffff !important;
  border: 1px solid var(--line) !important;
  border-radius: 22px !important;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.05) !important;
  text-decoration: none !important;
  padding: 0 !important;
}

.category-card::before,
.category-card::after {
  display: none !important;
  content: none !important;
  background: none !important;
  opacity: 0 !important;
}

.category-card img {
  width: 100% !important;
  height: 240px !important;
  object-fit: cover !important;
  display: block !important;
  opacity: 1 !important;
  filter: none !important;
  mix-blend-mode: normal !important;
  transform: none !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--soft) !important;
}

.category-card > div {
  position: static !important;
  padding: 14px 16px 16px !important;
  background: #ffffff !important;
}

.category-card h3 {
  position: static !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #111827 !important;
  font-size: 1.05rem !important;
  font-weight: 800 !important;
  line-height: 1.25 !important;
  text-shadow: none !important;
  background: transparent !important;
}

.category-card p {
  display: none !important;
}

.category-card:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 16px 34px rgba(17, 24, 39, 0.08) !important;
}

.category-card:hover img {
  opacity: 1 !important;
  filter: none !important;
}

.product-card h3 {
  margin: 0 0 6px;
}

.product-card p {
  margin: 0;
}

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

.product-image {
  aspect-ratio: 4 / 3;
  background: var(--soft);
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 42px;
}

.product-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 16px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 12px;
  margin-bottom: 20px;
}

.input-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font: inherit;
  background: #ffffff;
  color: var(--text);
}

.input-field:focus {
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 4px rgba(17, 24, 39, .08);
}

.form-stack {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.full {
  grid-column: 1 / -1;
}

.p-xl {
  padding: clamp(20px, 4vw, 34px);
}

.product-detail-layout {
  display: grid;
  grid-template-columns: .95fr 1.05fr;
  gap: 28px;
  align-items: start;
}

.product-detail-image {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.product-detail-image img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.product-detail-info {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(20px, 4vw, 36px);
  box-shadow: var(--shadow);
}

.product-detail-info h1 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  margin: 0 0 10px;
}

.price-line {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text);
}

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 22px;
  align-items: start;
}

.cart-row {
  display: grid;
  grid-template-columns: 92px 1fr 100px 110px auto;
  gap: 16px;
  align-items: center;
  background: #ffffff;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  margin-bottom: 12px;
}

.cart-row img {
  width: 92px;
  height: 82px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0;
}

.summary-line.big {
  font-size: 1.3rem;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 22px;
  align-items: start;
}

.hidden {
  display: none !important;
}

.empty {
  color: var(--muted);
  background: #ffffff;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 22px;
}

.login-wrap {
  width: min(880px, calc(100% - 32px));
  margin: 44px auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.spread {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.right {
  text-align: right;
}

.status-badge {
  display: inline-flex;
  background: #f3f4f6;
  color: #374151;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 800;
  text-transform: capitalize;
}

.order-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px;
  margin-bottom: 12px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 22px;
}

.admin-sidebar {
  background: #ffffff;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  align-self: start;
  position: sticky;
  top: 86px;
  box-shadow: var(--shadow);
}

.admin-sidebar a {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 8px;
}

.admin-sidebar a:hover,
.admin-sidebar a.active {
  background: #f3f4f6;
  color: var(--text);
}

.admin-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  margin-bottom: 12px;
}

.admin-row > div:first-child:nth-last-child(2) {
  grid-column: 1 / 3;
}

.admin-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 14px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.admin-order-card {
  padding: 18px;
  margin-bottom: 14px;
}

.admin-order-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 12px;
  align-items: end;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: 1.8rem;
  margin-top: 8px;
}

.site-footer {
  background: #ffffff;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 34px clamp(16px, 4vw, 56px);
  margin-top: 60px;
  border-top: 1px solid var(--line);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background: var(--dark);
  color: #ffffff;
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  transition: .2s;
  pointer-events: none;
  z-index: 200;
}

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

.toast-error {
  background: #991b1b;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e5e7eb;
  border-top-color: var(--text);
  border-radius: 999px;
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.section-head a {
  color: var(--text);
  font-weight: 800;
}

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

label {
  color: var(--text);
  font-weight: 600;
}

@media (max-width: 800px) {
  .mobile-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 72px;
    left: 12px;
    right: 12px;
    background: #ffffff;
    padding: 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
  }

  .site-nav.open {
    display: flex;
  }

  .hero,
  .product-detail-layout,
  .cart-layout,
  .checkout-layout,
  .login-wrap,
  .admin-shell {
    grid-template-columns: 1fr;
  }

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

  .cart-row {
    grid-template-columns: 72px 1fr;
  }

  .cart-row .qty-input,
  .cart-row strong,
  .cart-row button {
    grid-column: 2;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .category-card img {
    height: 200px !important;
  }
}