:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-light: #eef2ff;
  --accent: #f59e0b;
  --text: #1f2937;
  --text-muted: #6b7280;
  --bg: #f9fafb;
  --white: #ffffff;
  --border: #e5e7eb;
  --danger: #dc2626;
  --success: #16a34a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.15);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.8;
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.container.narrow {
  max-width: 780px;
}

.hidden {
  display: none !important;
}

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  text-decoration: none;
}

.nav {
  display: flex;
  gap: 6px;
}

.nav-link {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
  background: var(--primary-light);
  color: var(--primary);
}

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

.cart-btn {
  position: relative;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: 0.2s;
}

.cart-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  margin-inline-start: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--white);
  font-size: 0.75rem;
}

.login-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 8px 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.login-btn:hover {
  background: var(--primary-dark);
}

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

.user-name {
  font-weight: 700;
  color: var(--primary);
}

.logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: 0.2s;
}

.logout-btn:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: var(--white);
  padding: 72px 0;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.hero-text h1 {
  font-size: 2.6rem;
  font-weight: 900;
  margin-bottom: 16px;
}

.hero-text h1 span {
  color: #fbbf24;
}

.hero-text p {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: 28px;
  max-width: 480px;
}

.hero-art {
  font-size: 7rem;
  filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.3));
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-block;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: 0.2s;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.btn-ghost:hover {
  border-color: var(--text);
  color: var(--text);
}

.btn-block {
  width: 100%;
  display: block;
  text-align: center;
  margin-top: 8px;
}

/* ===== FEATURES ===== */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: -44px auto 56px;
  position: relative;
}

.feature {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}

.feature span {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

.feature h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
}

.feature p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== SECTIONS ===== */
.page {
  display: none;
  padding: 56px 0;
}

.page.active {
  display: block;
}

.section-head {
  text-align: center;
  margin-bottom: 36px;
}

.section-head h2 {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--text);
}

.section-head p {
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: 0.25s;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-img {
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4.5rem;
  color: var(--white);
  text-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.product-info h3 {
  font-size: 1.15rem;
}

.product-info p {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: 1;
}

.product-price {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
}

.product-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.add-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: 0.2s;
}

.add-btn:hover {
  background: var(--primary-dark);
}

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

.qty button {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
}

.qty button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.qty span {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
}

/* ===== CARDS ===== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}

.prose p {
  margin-bottom: 14px;
  color: var(--text-muted);
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose ul {
  margin: 10px 20px 14px;
  color: var(--text-muted);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}

.contact-row:last-child {
  border-bottom: none;
}

.contact-row span {
  font-size: 1.3rem;
}

.contact-row p {
  margin: 0;
}

/* ===== FOOTER ===== */
.footer {
  background: #111827;
  color: #d1d5db;
  margin-top: 40px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 48px 20px;
}

.footer-col h4 {
  color: var(--white);
  margin-bottom: 12px;
}

.footer-col a {
  display: block;
  color: #d1d5db;
  text-decoration: none;
  padding: 3px 0;
  font-size: 0.9rem;
}

.footer-col a:hover {
  color: var(--white);
}

.enamad-box {
  width: 110px;
  height: 110px;
  border: 1px dashed #4b5563;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.8rem;
  color: #9ca3af;
  background: #1f2937;
}

.footer-bottom {
  border-top: 1px solid #1f2937;
  padding: 16px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
}

/* ===== CART DRAWER ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 90;
}

.cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 380px;
  max-width: 90vw;
  background: var(--white);
  z-index: 100;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.cart-drawer-head h3 {
  font-size: 1.2rem;
}

.close-btn {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
}

.close-btn:hover {
  color: var(--danger);
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cart-empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0;
}

.cart-empty span {
  font-size: 3rem;
  display: block;
  margin-bottom: 10px;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cart-item-img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  color: var(--white);
  flex-shrink: 0;
}

.cart-item-info {
  flex: 1;
}

.cart-item-info h4 {
  font-size: 0.95rem;
}

.cart-item-info p {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.remove-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
}

.remove-item:hover {
  color: var(--danger);
}

.cart-drawer-foot {
  padding: 20px;
  border-top: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.cart-total {
  color: var(--primary);
  font-weight: 900;
}

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 36px;
  width: 100%;
  max-width: 400px;
}

.modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
}

.modal-box h3 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}

.modal-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.field {
  display: block;
  margin-bottom: 16px;
}

.field span {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: 0.2s;
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-error {
  color: var(--danger);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.demo-hint {
  margin-top: 16px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--primary-light);
  border-radius: 10px;
  padding: 10px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 50%;
  transform: translateX(50%);
  background: var(--text);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 12px;
  font-size: 0.95rem;
  z-index: 120;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateX(50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(50%) translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }

  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-text p {
    margin-inline: auto;
  }
}

@media (max-width: 600px) {
  .nav {
    display: none;
  }

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

  .hero-text h1 {
    font-size: 1.9rem;
  }

  .hero-art {
    font-size: 5rem;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}