@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@100..900&display=swap');

:root {
  --primary: #0A2540;
  --secondary: #0D9488;
  --accent: #14B8A6;
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --text: #1E293B;
  --muted: #64748B;
  --border: #E2E8F0;
  --success: #10B981;
  --danger: #EF4444;
  --warning: #F59E0B;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --radius: 12px;
}

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

body {
  font-family: 'Vazirmatn', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.6;
  min-height: 100vh;
}

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

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
header {
  background: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary);
}

.logo img {
  height: 48px;
  width: auto;
}

.search-bar {
  flex: 1;
  max-width: 500px;
  position: relative;
}

.search-bar input {
  width: 100%;
  padding: 12px 48px 12px 16px;
  border: 1px solid var(--border);
  border-radius: 50px;
  font-family: inherit;
  font-size: 1rem;
  outline: none;
  transition: border 0.2s;
}

.search-bar input:focus {
  border-color: var(--secondary);
}

.search-bar button {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
}

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

.header-actions a, .header-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  position: relative;
}

.cart-count {
  position: absolute;
  top: -8px;
  left: -8px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-categories {
  display: flex;
  gap: 24px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  overflow-x: auto;
}

.nav-categories a {
  white-space: nowrap;
  padding: 8px 0;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.2s;
}

.nav-categories a:hover, .nav-categories a.active {
  color: var(--secondary);
}

/* Hero Slider */
.hero {
  margin: 24px 0;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  height: 420px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  padding: 40px;
}

.hero-content h1 {
  font-size: 2.5rem;
  margin-bottom: 16px;
  font-weight: 800;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 24px;
  opacity: 0.9;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.2s;
}

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

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

.btn-outline {
  background: transparent;
  border: 2px solid white;
  color: white;
}

/* Sections */
.section {
  margin: 48px 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

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

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
}

.product-image {
  height: 200px;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discount-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--danger);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.product-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 1.05rem;
  line-height: 1.4;
}

.product-price {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.old-price {
  font-size: 0.95rem;
  color: var(--muted);
  text-decoration: line-through;
}

.add-to-cart {
  margin-top: 12px;
  width: 100%;
}

/* Footer */
footer {
  background: var(--primary);
  color: white;
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin-bottom: 32px;
}

.footer-grid h3 {
  margin-bottom: 16px;
  font-size: 1.1rem;
}

.footer-grid ul {
  list-style: none;
}

.footer-grid li {
  margin-bottom: 8px;
}

.footer-grid a {
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-grid a:hover {
  opacity: 1;
}

.copyright {
  text-align: center;
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Forms */
.form-container {
  max-width: 440px;
  margin: 40px auto;
  background: var(--card);
  padding: 32px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--secondary);
}

.error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 4px;
  display: none;
}

/* Cart */
.cart-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 16px;
  align-items: center;
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
}

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

.qty-controls button {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
}

/* Admin & Profile */
.sidebar {
  width: 260px;
  background: var(--card);
  min-height: calc(100vh - 80px);
  padding: 24px 0;
  border-left: 1px solid var(--border);
}

.sidebar a {
  display: block;
  padding: 12px 24px;
  color: var(--text);
  transition: background 0.2s;
}

.sidebar a:hover, .sidebar a.active {
  background: #F1F5F9;
  color: var(--secondary);
}

.main-content {
  flex: 1;
  padding: 24px;
}

.dashboard-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 120px);
}

/* Responsive */
@media (max-width: 768px) {
  .header-top {
    flex-wrap: wrap;
  }
  .search-bar {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
  }
  .hero {
    height: auto;
    padding: 32px 20px;
  }
  .hero-content h1 {
    font-size: 1.8rem;
  }
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  .dashboard-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    min-height: auto;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.product-card, .section {
  animation: fadeIn 0.4s ease-out;
}
