:root {
  --background: #f5f5f7;
  --foreground: #171717;
  --card: #ffffff;
  --card-hover: #fafafa;
  --border: #e5e7eb;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --accent: #0066ff;
  --accent-hover: #0052cc;
  --accent-light: #e8f0fe;
  --danger: #ef4444;
  --success: #12b76a;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  font-family: "Vazirmatn", "IRANSansX", "IRANSans", "Dana", "Estedad", -apple-system, BlinkMacSystemFont, "Segoe UI", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--background);
}

body {
  min-height: 100%;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
}

.app-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px calc(104px + env(safe-area-inset-bottom));
}

.is-loading .quick-actions,
.is-loading .bottom-nav,
.is-loading .search-card {
  transform: translateZ(0);
}

.hero {
  display: contents;
}

.hero[hidden] {
  display: none;
}

.hero-top,
.section-title,
.detail-actions,
.modal-actions {
  display: flex;
  align-items: center;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 275px;
  color: var(--foreground);
  font-size: 25px;
  font-weight: 950;
  line-height: 1.35;
}

.search-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.05);
}

.search-icon {
  display: grid;
  width: 42px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
}

.search-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.search-card input {
  width: 100%;
  height: 52px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 16px;
}

.search-card input::placeholder {
  color: var(--muted-2);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin: 16px 0;
}

.quick-action,
.nav-item {
  color: var(--muted);
  background: transparent;
}

.quick-action {
  display: grid;
  min-height: 46px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
}

.quick-action span,
.nav-item span {
  display: grid;
  place-items: center;
}

.quick-action span {
  position: relative;
  overflow: hidden;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted);
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.06);
  transition: border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.quick-action svg {
  position: relative;
  z-index: 1;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.85;
}

.quick-action b,
.nav-item b {
  font-size: 11px;
  font-weight: 850;
}

.quick-action b {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.quick-action.active {
  color: var(--accent);
  background: transparent;
}

.quick-action.active span {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 102, 255, 0.12);
}

.panel {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--card);
  box-shadow: 0 18px 38px rgba(17, 24, 39, 0.07);
}

.section-title {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title h2 {
  font-size: 21px;
  font-weight: 950;
}

.section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.panel.support-mode > .section-title {
  display: none;
}

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

.product-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: #ffffff;
  color: var(--foreground);
  text-align: start;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.product-card:active {
  transform: scale(0.985);
}

.product-card:has(.card-icon-button:active) {
  transform: none;
}

.card-actions {
  position: absolute;
  inset: 10px 10px auto 10px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.card-icon-button {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--muted);
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.10);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.card-icon-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.favorite-button.active {
  color: var(--danger);
}

.cart-button.active {
  color: var(--accent);
}

.skeleton-card {
  pointer-events: none;
}

.skeleton-card .card-actions span,
.skeleton-row span,
.skeleton-row b,
.skeleton-row i,
.skeleton-card .product-image,
.skeleton-card .product-info i {
  display: block;
  border-radius: 999px;
  background: linear-gradient(90deg, #f0f2f5 0%, #fafafa 45%, #eef1f5 100%);
  background-size: 220% 100%;
  animation: skeleton-pulse 1.1s ease-in-out infinite;
}

.skeleton-card .card-actions span {
  width: 32px;
  height: 32px;
}

.skeleton-card .product-image {
  border-radius: 18px;
}

.skeleton-card .product-info i {
  height: 12px;
  margin-top: 10px;
}

.skeleton-card .product-info i:nth-child(1) {
  width: 54%;
}

.skeleton-card .product-info i:nth-child(2) {
  width: 82%;
}

.skeleton-card .product-info i:nth-child(3) {
  width: 68%;
}

.skeleton-row {
  pointer-events: none;
}

.skeleton-row span {
  width: 92px;
  height: 44px;
  border-radius: 16px;
}

.skeleton-row b {
  width: 128px;
  height: 16px;
}

.skeleton-row i {
  width: 10px;
  height: 18px;
}

.product-image {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 0.86;
  place-items: center;
  overflow: visible;
  background: transparent;
}

.product-image img,
.detail-image-wrap img,
.modal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-image img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.product-info {
  padding: 12px;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 22px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.product-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-meta b {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 7px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 10px;
}

.product-info h3 {
  margin-top: 4px;
  overflow: hidden;
  color: var(--foreground);
  font-size: 15px;
  font-weight: 950;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-info p {
  display: -webkit-box;
  min-height: 37px;
  margin-top: 5px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.product-info strong {
  display: block;
  margin-top: 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.category-list {
  display: grid;
  gap: 11px;
}

.category-row {
  direction: ltr;
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 92px;
  padding: 13px 12px;
  border: 1px solid var(--border);
  border-radius: 22px;
  color: var(--foreground);
  text-align: start;
  background:
    linear-gradient(180deg, #ffffff, #fbfbfd);
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.055);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.category-row:hover {
  border-color: rgba(0, 102, 255, 0.18);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.075);
}

.category-samples {
  position: relative;
  display: block;
  width: 130px;
  height: 54px;
}

.sample-logo {
  position: absolute;
  top: 0;
  left: calc(var(--i) * 38px);
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 15px;
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(17, 24, 39, 0.12);
}

.sample-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.category-row > span:nth-child(2) {
  direction: rtl;
  min-width: 0;
  text-align: start;
  padding-inline-start: 2px;
}

.category-row b {
  display: block;
  overflow: hidden;
  color: #202124;
  font-size: 15px;
  font-weight: 850;
  line-height: 1.45;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: normal;
}

.category-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.category-row i {
  direction: rtl;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border-radius: 999px;
  background: transparent;
  color: #b6bcc6;
  font-size: 24px;
  font-weight: 300;
  font-style: normal;
  line-height: 1;
}

.category-row:active {
  transform: scale(0.985);
}

.bottom-nav {
  position: fixed;
  right: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  width: min(386px, calc(100% - 32px));
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(229, 231, 235, 0.92);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 36px rgba(17, 24, 39, 0.16);
  transform: translateX(50%);
  backdrop-filter: blur(18px);
}

.nav-item {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 58px;
  place-items: center;
  gap: 2px;
  border-radius: 23px;
}

.nav-item span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--foreground);
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.nav-item.active {
  color: var(--accent);
  background: transparent;
}

.nav-item.active span {
  border-color: var(--accent);
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(0, 102, 255, 0.12);
}

.nav-item.has-items span {
  border-color: rgba(0, 102, 255, 0.38);
  color: var(--accent);
}

.nav-item.has-items::after {
  content: attr(data-count);
  position: absolute;
  top: 5px;
  right: 16px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  padding: 0 4px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.detail-view {
  animation: fade-in 0.16s ease;
}

.back-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  margin: 2px 0 12px;
  padding: 0 14px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.detail-hero {
  overflow: hidden;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(17, 24, 39, 0.07);
  text-align: center;
}

.detail-image-wrap {
  display: grid;
  width: 100%;
  aspect-ratio: 1 / 0.74;
  place-items: center;
  overflow: visible;
  border-radius: 0;
  background: transparent;
}

.detail-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.detail-category {
  margin-top: 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 950;
}

.detail-hero h2 {
  margin-top: 5px;
  font-size: 27px;
  font-weight: 950;
  line-height: 1.25;
}

.detail-hero > p:not(.detail-category) {
  margin-top: 10px;
  color: #374151;
  font-size: 14px;
  line-height: 1.9;
}

.detail-panel {
  margin-top: 14px;
}

.plans {
  display: grid;
  gap: 9px;
}

.plan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 17px;
  background: #fafafa;
}

.plan-row b {
  color: var(--foreground);
  font-size: 13px;
}

.plan-row small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.plan-row strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.detail-actions {
  gap: 10px;
  margin-top: 16px;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  min-height: 52px;
  flex: 1;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 950;
}

.primary-button {
  background: var(--accent);
  color: white;
}

.ghost-button {
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--foreground);
}

.support-card {
  grid-column: 1 / -1;
  padding: 18px;
  border-radius: 20px;
  background: #fafafa;
  text-align: center;
}

.support-card .primary-button {
  width: min(100%, 220px);
  min-height: 54px;
  flex: none;
  margin: 0 auto;
  padding: 0 24px;
  white-space: nowrap;
}

.support-card h3 {
  font-size: 20px;
}

.support-card p {
  margin: 10px 0 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.empty {
  grid-column: 1 / -1;
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

.modal {
  display: none;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes skeleton-pulse {
  0% {
    background-position: 100% 0;
  }

  100% {
    background-position: -100% 0;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-inline: 10px;
  }

  .quick-actions {
    gap: 6px;
  }

  .quick-action b,
  .nav-item b {
    font-size: 10px;
  }

  .product-grid {
    gap: 10px;
  }

  .product-info {
    padding: 10px;
  }
}
