* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #2657ff;
  --primary-dark: #1233a3;
  --accent: #00a6ff;
  --green: #0fb981;
  --orange: #ff8a00;
  --text: #101828;
  --muted: #667085;
  --bg: #f5f8ff;
  --white: #ffffff;
  --soft: #eef5ff;
  --line: #e3e9f5;
  --shadow: 0 18px 44px rgba(39, 84, 255, 0.13);
  --card-shadow: 0 12px 30px rgba(16, 24, 40, 0.07);
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 86px;
}

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

button,
input,
select {
  font-family: inherit;
}

button {
  cursor: pointer;
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  padding: 14px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.back-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.brand-box h3 {
  font-size: 16px;
  line-height: 1;
}

.brand-box p {
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.login-btn {
  border: none;
  background: var(--soft);
  color: var(--primary-dark);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 900;
}

.ref-strip {
  display: none;
  margin: 12px 15px 0;
  padding: 12px 14px;
  background: #eafaf3;
  color: #087148;
  border-radius: 16px;
  font-size: 14px;
  border: 1px solid #c8f0df;
}

.page-hero {
  margin: 15px;
  padding: 22px 17px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at top right, #dbeaff, transparent 34%),
    linear-gradient(135deg, #ffffff, #eef5ff);
  box-shadow: var(--card-shadow);
}

.tagline,
.section-head span {
  display: inline-block;
  background: var(--soft);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.page-hero h1 {
  font-size: 34px;
  line-height: 1.05;
  margin: 12px 0 8px;
  letter-spacing: -1px;
}

.page-hero h1 span {
  color: var(--primary);
}

.page-hero p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.filter-box {
  margin: 0 15px 15px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 13px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  box-shadow: var(--card-shadow);
}

.filter-box input,
.filter-box select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px;
  outline: none;
  background: white;
}

.filter-box input:focus,
.filter-box select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(39, 84, 255, 0.09);
}

.quick-cats {
  margin: 0 15px 18px;
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.quick-cats::-webkit-scrollbar {
  display: none;
}

.quick-cat {
  border: 1px solid var(--line);
  background: white;
  color: var(--muted);
  border-radius: 999px;
  padding: 10px 14px;
  white-space: nowrap;
  font-weight: 900;
}

.quick-cat.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow);
}

.section {
  padding: 24px 15px;
}

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

.section-head h2 {
  font-size: 26px;
  margin-top: 8px;
  letter-spacing: -0.7px;
  line-height: 1.1;
}

.result-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.loading-box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  display: flex;
  gap: 13px;
  align-items: center;
  box-shadow: var(--card-shadow);
}

.loading-box.is-hidden {
  display: none;
}

.loading-box h3 {
  font-size: 16px;
}

.loading-box p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.loader {
  width: 34px;
  height: 34px;
  border: 4px solid #e7efff;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

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

.product-card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: 0.2s ease;
}

.product-card:hover {
  transform: translateY(-2px);
}

.product-visual {
  height: 176px;
  background:
    radial-gradient(circle at top right, #dceaff, transparent 34%),
    linear-gradient(135deg, #eef5ff, #ffffff);
  display: grid;
  place-items: center;
  align-content: center;
  font-size: 58px;
  position: relative;
  overflow: hidden;
}

.product-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: white;
  border: 1px solid var(--line);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
  z-index: 2;
}

.template-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: #101828;
  color: white;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 900;
  z-index: 2;
}

.product-body {
  padding: 16px;
}

.product-body h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.product-body p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.product-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.product-tags span {
  background: var(--soft);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  gap: 10px;
}

.price {
  font-size: 21px;
  font-weight: 900;
}

.price small {
  color: var(--muted);
  font-size: 12px;
}

.moq {
  background: #fff8eb;
  color: #9a5a00;
  border-radius: 999px;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 900;
}

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

.primary-btn,
.secondary-btn {
  border: none;
  border-radius: 16px;
  padding: 13px 17px;
  font-weight: 900;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.primary-btn {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  box-shadow: var(--shadow);
}

.secondary-btn {
  background: var(--soft);
  color: var(--primary-dark);
}

.full-btn {
  width: 100%;
}

.empty-box {
  background: white;
  border: 1px dashed #cfd8e3;
  border-radius: 24px;
  padding: 28px 18px;
  text-align: center;
  color: var(--muted);
}

.empty-box h3 {
  color: var(--text);
  margin-bottom: 8px;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 560px;
  z-index: 80;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  box-shadow: 0 14px 35px rgba(16, 24, 40, 0.18);
  border-radius: 24px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px;
}

.bottom-nav .nav-item {
  padding: 8px 4px;
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  display: grid;
  gap: 3px;
  place-items: center;
}

.bottom-nav .nav-item span {
  font-size: 17px;
  line-height: 1;
}

.bottom-nav .nav-item b {
  font-size: 10px;
  line-height: 1;
}

.bottom-nav .nav-item.active {
  background: var(--soft);
  color: var(--primary-dark);
}

.login-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(8, 18, 35, 0.55);
  padding: 15px;
  place-items: end center;
}

.login-modal.active {
  display: grid;
}

.login-box {
  position: relative;
  background: white;
  border-radius: 28px;
  padding: 22px;
  width: 100%;
  max-width: 430px;
}

.close-btn {
  position: absolute;
  right: 14px;
  top: 12px;
  width: 36px;
  height: 36px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  font-size: 24px;
}

.login-box h2 {
  margin-bottom: 8px;
}

.login-box p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 14px;
}

.login-box label {
  display: block;
  font-size: 13px;
  font-weight: 900;
  margin: 12px 0 6px;
}

.login-box input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 13px;
  outline: none;
}

.login-box small {
  color: var(--muted);
  display: block;
  margin: 8px 0;
  line-height: 1.4;
}

.otp-area {
  display: none;
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }

  .main-header {
    padding: 18px 38px;
  }

  .ref-strip,
  .page-hero,
  .filter-box,
  .quick-cats {
    margin-left: 38px;
    margin-right: 38px;
  }

  .page-hero {
    padding: 32px;
  }

  .page-hero h1 {
    font-size: 50px;
  }

  .filter-box {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }

  .section {
    padding: 32px 38px;
  }

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

  .bottom-nav {
    display: none;
  }
}