:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary2: #06b6d4;
  --danger: #ef4444;
  --border: rgba(15, 23, 42, 0.12);
  --shadow: 0 10px 30px rgba(2, 6, 23, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji",
    "Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(900px 450px at 15% 0%, rgba(79, 70, 229, 0.12), transparent 60%),
    radial-gradient(700px 420px at 90% 10%, rgba(6, 182, 212, 0.12), transparent 55%),
    var(--bg);
}

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

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

.siteHeader {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(246, 247, 251, 0.72);
  border-bottom: 1px solid var(--border);
}

.headerInner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 12px;
}

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

.brandMark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  box-shadow: 0 12px 30px rgba(79, 70, 229, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.brandText {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brandText small {
  font-weight: 600;
  color: var(--muted);
}

.headerActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cartLink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.cartLink:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.08);
  border-color: rgba(79, 70, 229, 0.35);
}

.cartBadge {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  font-weight: 800;
  font-size: 13px;
}

main {
  padding: 26px 0 36px;
}

.heroRow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.heroTitle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.heroTitle h1 {
  margin: 0;
  font-size: clamp(22px, 3.2vw, 34px);
  letter-spacing: -0.02em;
}

.heroTitle p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.categoryBar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.pill {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
  user-select: none;
}

.pill:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.08);
}

.pillActive {
  border-color: rgba(79, 70, 229, 0.45);
  background: rgba(79, 70, 229, 0.10);
}

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

.fieldGroup {
  display: flex;
  gap: 8px;
  align-items: center;
}

.fieldGroup label {
  font-weight: 700;
  color: var(--muted);
  font-size: 13px;
}

.input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.85);
  min-width: 120px;
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}

.input:focus {
  border-color: rgba(79, 70, 229, 0.5);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.errorText {
  color: var(--danger);
  font-weight: 700;
  font-size: 13px;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  font-weight: 800;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.7);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease, background 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(2, 6, 23, 0.08);
  border-color: rgba(79, 70, 229, 0.35);
}

.btnPrimary {
  background: linear-gradient(135deg, var(--primary), var(--primary2));
  color: white;
  border-color: transparent;
}

.btnGhost {
  background: rgba(255, 255, 255, 0.75);
}

.btnSecondary {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary);
  border-color: rgba(79, 70, 229, 0.35);
  font-weight: 900;
}

.btnSecondary:hover {
  background: rgba(79, 70, 229, 0.16);
  border-color: rgba(79, 70, 229, 0.5);
}

.btnLink {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--primary);
  font-weight: 900;
}

.btnDanger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.35);
  color: #b91c1c;
}

.gridMeta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 16px;
}

.gridMeta strong {
  font-size: 14px;
}

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

.productCard {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(2, 6, 23, 0.04);
  display: flex;
  flex-direction: column;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.productCard:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: rgba(79, 70, 229, 0.35);
}

.productImageWrap {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: rgba(79, 70, 229, 0.06);
}

.productImage {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.productBody {
  padding: 14px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.productTitleRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.productTitleRow h3 {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.01em;
}

.productCategory {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.priceRow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.productPrice {
  font-size: 18px;
  font-weight: 1000;
}

.actionsRow {
  display: flex;
  gap: 10px;
  align-items: center;
}

.actionsRow .btn {
  flex: 1;
}

.actionsRowBuy {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.actionsRowBuy .btn {
  flex: 1;
}

.favRow {
  display: flex;
}

.favRow .btn {
  flex: 1;
}

.detailsBtn {
  margin-top: auto;
  display: flex;
  justify-content: flex-start;
}

.liked {
  border-color: rgba(79, 70, 229, 0.5);
  background: rgba(79, 70, 229, 0.12);
}

.toastWrap {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  color: white;
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 160ms ease, transform 160ms ease;
}

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

/* Modal */
.modalOverlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 18px;
}

.modalOverlayOpen {
  display: flex;
}

.modalOverlayOrder {
  z-index: 2100;
}

.modal {
  width: min(720px, 92vw);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.45);
  overflow: hidden;
}

.modalNarrow {
  width: min(440px, 92vw);
}

.orderProductSummary {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(79, 70, 229, 0.06);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.45;
}

.orderProductSummary .orderLineTotal {
  margin-top: 6px;
  font-size: 16px;
  font-weight: 1000;
  color: var(--text);
}

.orderForm .formGrid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fieldGroupBlock {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

.fieldGroupBlock label {
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}

.inputBlock {
  width: 100%;
  min-width: 0;
}

.textarea {
  resize: vertical;
  min-height: 72px;
  font-family: inherit;
  line-height: 1.45;
}

.optionalHint {
  font-weight: 700;
  color: var(--muted);
}

.orderFormActions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: 4px;
}

.orderFormActions .btn {
  min-width: 110px;
}

.modalHeader {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.modalHeader h2 {
  margin: 0;
  font-size: 18px;
}

.iconBtn {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  font-weight: 1000;
}

.modalBody {
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.modalProductTop {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 14px;
  align-items: center;
}

.modalProductTop img {
  width: 180px;
  height: 120px;
  object-fit: cover;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.modalPrice {
  font-size: 22px;
  font-weight: 1000;
  margin: 0;
}

.modalMeta {
  color: var(--muted);
  font-weight: 800;
  margin: 6px 0 10px;
}

.modalDesc {
  margin: 0;
  color: #334155;
  line-height: 1.55;
}

.highlightList {
  margin: 0;
  padding-left: 18px;
  color: #334155;
  line-height: 1.6;
  font-weight: 700;
}

/* Cart */
.cartHeaderRow {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cartGrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.cartItems {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.04);
}

.cartItemRow {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 12px;
  padding: 14px 14px;
  align-items: center;
  border-bottom: 1px solid var(--border);
}

.cartItemRow:last-child {
  border-bottom: none;
}

.cartItemRow img {
  width: 110px;
  height: 76px;
  border-radius: 14px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.cartItemInfo h3 {
  margin: 0;
  font-size: 16px;
}

.cartItemInfo small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.cartItemRight {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.qtyRow {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qtyRow .btn {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
}

.qtyInput {
  width: 74px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  background: rgba(255, 255, 255, 0.85);
  font-weight: 900;
  outline: none;
}

.emptyState {
  padding: 18px;
  color: var(--muted);
  font-weight: 800;
}

.cartSummary {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: 0 10px 22px rgba(2, 6, 23, 0.04);
}

.summaryRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 16px;
}

.summaryRow strong {
  font-size: 14px;
  color: var(--muted);
}

.summaryTotal {
  font-size: 24px;
  font-weight: 1000;
}

/* Footer */
.siteFooter {
  border-top: 1px solid var(--border);
  padding: 26px 0 18px;
  margin-top: 30px;
}

.footerGrid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.footerGrid h4 {
  margin: 0 0 10px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.footerGrid p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  line-height: 1.55;
}

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

.footerLinks a {
  font-weight: 900;
  color: var(--primary);
  border: 1px solid rgba(79, 70, 229, 0.25);
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.08);
}

.footerBottom {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 820px) {
  .headerInner {
    padding: 12px 0;
  }

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

  .cartItemRow {
    grid-template-columns: 100px 1fr;
    grid-template-rows: auto auto;
  }

  .cartItemRight {
    grid-column: 1 / -1;
    align-items: flex-start;
  }

  .modalProductTop {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .modalProductTop img {
    width: 100%;
    height: auto;
  }

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

