:root {
  --ld-deepblue: #0000ff;
  --ld-red: #e5231b;
  --ld-bg: #ffffff;
  --ld-bg-alt: #f0f4ff;
  --ld-surface: #ffffff;
  --ld-text: #0a1a3a;
  --ld-text-secondary: #475569;
  --ld-border: #e2e8f0;
  --ld-card-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ld-text);
  background: var(--ld-bg);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 clamp(1.25rem, 4vw, 3rem); }
.inline { display: inline; }

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ld-border);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .7rem; font-weight: 800; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-text { font-size: 1rem; letter-spacing: -0.02em; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a, .link-btn {
  font-size: .92rem; font-weight: 600; color: var(--ld-text-secondary);
  background: none; border: 0; cursor: pointer; padding: 0;
}
.nav a.active, .nav a:hover, .link-btn:hover { color: var(--ld-deepblue); }

.btn, button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  background: var(--ld-red); color: #fff !important; border: 0; border-radius: 8px;
  padding: .7rem 1.1rem; font-weight: 700; cursor: pointer; font-size: .9rem;
}
.btn:hover { opacity: .92; }
.btn-sm { padding: .45rem .9rem; font-size: .82rem; }
.btn-outline {
  background: transparent; color: var(--ld-deepblue) !important;
  border: 2px solid var(--ld-deepblue);
}
.btn-block { width: 100%; }

.flash { padding: .85rem 1.25rem; text-align: center; font-weight: 600; }
.flash-success { background: #ecfdf5; color: #047857; }
.flash-error { background: #fef2f2; color: #b91c1c; }

.shop-hero {
  position: relative;
  padding: 120px 0 56px;
  text-align: center;
  background: url('/images/shop-hero.jpg') center/cover no-repeat;
  color: #fff;
}
.shop-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(10, 26, 58, 0.55);
}
.shop-hero > .container {
  position: relative;
  z-index: 1;
}
.shop-hero h1 {
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 800;
  margin: 0 0 8px;
}
.shop-hero p { margin: 0 0 18px; opacity: .92; }
.shop-hero form {
  display: flex; gap: .6rem; max-width: 640px; margin: 0 auto 14px; flex-wrap: wrap; justify-content: center;
}
.shop-hero input, .shop-hero select, .field, input[type=text], input[type=email], input[type=password], input[type=number], textarea, select {
  width: 100%;
  border: 1px solid var(--ld-border);
  border-radius: 10px;
  padding: .75rem .9rem;
  font: inherit;
  background: #fff;
}
.shop-hero input { max-width: 420px; }
.shop-hero .stats { font-size: .875rem; opacity: .92; }

.section { padding: 32px 0 48px; }
.section-title { font-size: 1.25rem; font-weight: 800; margin: 0 0 20px; }

.categories { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; }
.category-card {
  flex: 0 0 auto; min-width: 110px; text-align: center;
  background: var(--ld-surface); border: 2px solid transparent;
  border-radius: 14px; padding: 16px 20px; box-shadow: var(--ld-card-shadow);
  cursor: pointer; transition: .2s;
}
.category-card:hover, .category-card.active { border-color: var(--ld-deepblue); transform: translateY(-2px); }
.category-card img, .category-card .ph {
  width: 80px; height: 80px; border-radius: 14px; object-fit: cover;
  background: var(--ld-bg-alt); margin: 0 auto 10px; display: grid; place-items: center;
}
.category-card span { font-size: .8rem; font-weight: 700; }

.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; align-items: center; }
.toolbar select { width: auto; min-width: 180px; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
@media (min-width: 1200px) { .product-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 600px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }

.product-card {
  background: var(--ld-surface); border: 1px solid var(--ld-border);
  border-radius: 12px; overflow: hidden; transition: .2s; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.product-card .img { aspect-ratio: 1; background: var(--ld-bg-alt); position: relative; overflow: hidden; }
.product-card .img img { width: 100%; height: 100%; object-fit: cover; }
.product-card .badge {
  position: absolute; top: 8px; left: 8px; background: var(--ld-red); color: #fff;
  font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 6px;
}
.product-card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-card h3 { margin: 0; font-size: .88rem; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .vendor { font-size: .72rem; color: #888; }
.product-card .price { font-size: 1.1rem; font-weight: 800; color: var(--ld-deepblue); }
.product-card .old { font-size: .78rem; color: #999; text-decoration: line-through; }
.product-card form { margin-top: auto; }

.pagination { display: flex; justify-content: center; gap: .4rem; margin-top: 2rem; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: .45rem .75rem; border-radius: 8px; border: 1px solid var(--ld-border); font-weight: 600; font-size: .85rem;
}
.pagination .active span { background: var(--ld-deepblue); color: #fff; border-color: var(--ld-deepblue); }

.product-detail { padding: 100px 0 48px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }
.gallery { border-radius: 14px; overflow: hidden; background: var(--ld-bg-alt); border: 1px solid var(--ld-border); }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.thumbs { display: flex; gap: .5rem; margin-top: .75rem; overflow-x: auto; }
.thumbs img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--ld-border); }

.card-panel {
  background: var(--ld-surface); border: 1px solid var(--ld-border);
  border-radius: 14px; padding: 1.25rem; box-shadow: var(--ld-card-shadow);
}
.field-label { display: block; font-size: .82rem; font-weight: 700; margin: 0 0 .35rem; }
.field-group { margin-bottom: 1rem; }

.login-page {
  min-height: calc(100vh - 140px);
  display: grid; place-items: center;
  padding: 2rem 1rem;
  background:
    radial-gradient(circle at top right, rgba(0,0,255,.12), transparent 40%),
    linear-gradient(180deg, #f0f4ff, #fff);
}
.login-card { width: min(420px, 100%); }
.login-card h1 { margin: 0 0 .4rem; font-weight: 800; }
.login-card .hint { color: var(--ld-text-secondary); font-size: .9rem; margin-bottom: 1.25rem; }
.demo-accounts { background: var(--ld-bg-alt); border-radius: 10px; padding: .9rem; font-size: .82rem; margin-top: 1rem; }
.demo-accounts code { font-weight: 700; }

.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { text-align: left; padding: .75rem .5rem; border-bottom: 1px solid var(--ld-border); vertical-align: top; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ld-text-secondary); }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stat { background: var(--ld-surface); border: 1px solid var(--ld-border); border-radius: 14px; padding: 1rem 1.1rem; }
.stat .label { font-size: .78rem; color: var(--ld-text-secondary); font-weight: 600; }
.stat .value { font-size: 1.45rem; font-weight: 800; color: var(--ld-deepblue); margin-top: .25rem; }

.badge-pill {
  display: inline-block; padding: .2rem .55rem; border-radius: 999px;
  font-size: .72rem; font-weight: 700; background: var(--ld-bg-alt); color: var(--ld-deepblue);
}
.badge-pill.success { background: #ecfdf5; color: #047857; }
.badge-pill.warn { background: #fff7ed; color: #c2410c; }
.badge-pill.danger { background: #fef2f2; color: #b91c1c; }

.site-footer { background: #0a1a3a; color: rgba(255,255,255,.8); padding: 2rem 0; margin-top: 2rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.footer-brand-row { display: flex; align-items: center; gap: .7rem; margin-bottom: .35rem; }
.footer-logo { height: 32px; width: auto; }
.footer-brand-text { font-weight: 800; color: #fff; }
.site-footer p { margin: .4rem 0 0; font-size: .9rem; }

.empty { text-align: center; padding: 4rem 1rem; color: var(--ld-text-secondary); }
.cart-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1.5rem; }
@media (max-width: 900px) { .cart-layout { grid-template-columns: 1fr; } }
.muted { color: var(--ld-text-secondary); }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.stack-2 > * + * { margin-top: 1rem; }

.payment-screen { display: flex; justify-content: center; }
.payment-card { max-width: 480px; margin: 0 auto; text-align: center; }
.payment-card h1 { margin: 0 0 .75rem; font-weight: 800; }
.payment-status-label { margin-top: 1rem; font-weight: 700; }
.payment-hint { margin-top: .5rem; font-size: .85rem; }
.payment-spinner {
  width: 48px; height: 48px; margin: 0 auto 1.25rem;
  border: 4px solid var(--ld-border);
  border-top-color: var(--ld-deepblue);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.payment-icon {
  width: 64px; height: 64px; margin: 0 auto 1rem;
  border-radius: 50%; display: grid; place-items: center;
  font-size: 1.75rem; font-weight: 800; color: #fff;
}
.payment-icon.success { background: #047857; }
.payment-icon.failed { background: var(--ld-red); }
.payment-actions { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.5rem; }
