/* --- Variables & Reset --- */
:root {
  --font-main: 'Vazirmatn', system-ui, sans-serif;
  
  --color-bg: #FAFAFA;
  --color-surface: #FFFFFF;
  --color-primary: #2563EB; /* Modern Blue */
  --color-primary-dark: #1D4ED8;
  --color-text-main: #1F2937;
  --color-text-muted: #6B7280;
  --color-border: #E5E7EB;
  --color-accent-bg: #F3F4F6;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
  
  --header-height: 80px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color 0.2s;
  cursor: pointer;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Toast Notification --- */
#toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.toast {
  background-color: #10B981; /* Success Green */
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  animation: slideUp 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Views Management --- */
.view {
  animation: fadeIn 0.3s ease-in-out;
}

.view.hidden {
  display: none !important;
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.2;
  color: #111827;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.8rem; margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; }

/* --- Components --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: all 0.2s;
  gap: 0.5rem;
}

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

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

.btn-block {
  width: 100%;
}

.btn-text {
  color: var(--color-text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-text:hover {
  color: var(--color-primary);
}

.icon-btn {
  padding: 0.5rem;
  border-radius: var(--radius-full);
  color: var(--color-text-main);
  transition: background-color 0.2s;
  position: relative;
}

.icon-btn:hover {
  background-color: var(--color-accent-bg);
}

.mb-4 { margin-bottom: 1rem; }
.pt-4 { padding-top: 2rem; }
.text-muted { color: var(--color-text-muted); }

/* --- Header --- */
.header {
  height: var(--header-height);
  background-color: var(--color-surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 3rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--color-primary);
  letter-spacing: -0.5px;
}

.nav-menu {
  display: flex;
  gap: 2rem;
}

.nav-link {
  color: var(--color-text-muted);
  font-weight: 500;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--color-text-main);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: 0;
  width: 100%;
  height: 2px;
  background-color: var(--color-primary);
  border-radius: 2px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #EF4444;
  color: white;
  font-size: 0.7rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.mobile-menu-btn {
  display: none;
}

/* --- Hero --- */
.hero {
  padding: 4rem 0;
  background: linear-gradient(180deg, #FFFFFF 0%, #FAFAFA 100%);
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 4rem;
}

.hero-text h1 {
  margin-bottom: 1.5rem;
  color: #111827;
}

.hero-text p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 450px;
}

.hero-image-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 16/10; /* Fixed aspect ratio for better framing */
  background-color: white;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensures image fills the frame */
  transition: transform 0.5s ease;
}

.hero-image-wrapper:hover .hero-img {
  transform: scale(1.05);
}

/* --- Categories --- */
.categories {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

.category-list {
  display: flex;
  gap: 1.5rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scrollbar-width: none;
  justify-content: center; /* Center items to remove empty space */
}
.category-list::-webkit-scrollbar {
  display: none;
}

.category-card {
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.2s;
}

.category-card:hover {
  transform: translateY(-5px);
}

.cat-icon {
  width: 70px;
  height: 70px;
  background-color: white;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  transition: all 0.2s;
}

.category-card:hover .cat-icon {
  background-color: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}

.category-card span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-main);
}

/* --- Products --- */
.products-section {
  padding: 2rem 0;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background-color: white;
  border: 1px solid var(--color-border);
  font-size: 0.9rem;
  color: var(--color-text-muted);
  transition: all 0.2s;
  cursor: pointer;
}

.filter-chip:hover, .filter-chip.active {
  background-color: var(--color-text-main);
  color: white;
  border-color: var(--color-text-main);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
}

.product-card {
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  border: 1px solid var(--color-border); /* Added border for frame effect */
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary); /* Highlight border on hover */
}

.product-img-container {
  height: 240px; /* Slightly taller */
  background-color: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border); /* Separator line */
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Ensures image fits nicely */
  mix-blend-mode: multiply;
  transition: transform 0.3s;
}

.product-card:hover .product-img {
  transform: scale(1.08);
}

.product-info {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-main);
}

.product-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 1rem;
  margin-top: auto;
}

.add-to-cart-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  background-color: var(--color-accent-bg);
  color: var(--color-text-main);
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.add-to-cart-btn:hover {
  background-color: var(--color-text-main);
  color: white;
}

/* --- Blog --- */
.blog-section {
  margin-top: 4rem;
  margin-bottom: 4rem;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.blog-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
  cursor: pointer;
  border: 1px solid var(--color-border);
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.blog-img {
  height: 200px;
  overflow: hidden;
}

.blog-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.blog-card:hover .blog-img img {
  transform: scale(1.05);
}

.blog-content {
  padding: 1.5rem;
}

.blog-content h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.blog-content p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

/* --- Blog Single View --- */
.blog-single-container {
  padding: 2rem 0;
  max-width: 800px;
}

.blog-single-hero {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.blog-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-body {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #374151;
  text-align: justify;
}

.blog-body p {
  margin-bottom: 1.5rem;
}

.blog-body h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* --- Login View --- */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.auth-card {
  background: white;
  padding: 3rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.ltr-input {
  direction: ltr;
  text-align: left;
}

.auth-footer {
  margin-top: 1.5rem;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.auth-footer a {
  color: var(--color-primary);
  font-weight: 600;
}

/* --- Contact View --- */
.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 3rem;
  padding: 3rem 0;
}

.contact-info h2 {
  margin-bottom: 1rem;
}

.contact-item {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.contact-item i {
  color: var(--color-primary);
  flex-shrink: 0;
}

.contact-form-wrapper {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

/* --- Footer --- */
.footer {
  background-color: white;
  border-top: 1px solid var(--color-border);
  padding: 4rem 0 2rem;
  margin-top: auto;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h3 {
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.footer-col p {
  color: var(--color-text-muted);
  max-width: 300px;
}

.footer-col ul li {
  margin-bottom: 0.75rem;
}

.footer-col ul li a {
  color: var(--color-text-muted);
}
.footer-col ul li a:hover {
  color: var(--color-primary);
}

.social-icons {
  display: flex;
  gap: 1rem;
}

.social-icons a {
  color: var(--color-text-main);
  transition: color 0.2s;
}
.social-icons a:hover {
  color: var(--color-primary);
}

.footer-bottom {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--color-border);
  padding-top: 2rem;
  width: 90%;
  margin: 0 auto;
}

/* --- Cart Drawer --- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 150;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  backdrop-filter: blur(2px);
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 400px;
  max-width: 90%;
  background-color: white;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 5px 0 15px rgba(0,0,0,0.1);
}

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

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.cart-item-img {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-sm);
  background-color: #f3f4f6;
  object-fit: cover;
}

.cart-item-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.cart-item-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.cart-item-price {
  color: var(--color-primary);
  font-weight: 700;
}

.cart-item-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #f3f4f6;
  border-radius: var(--radius-sm);
  padding: 0.25rem;
}

.qty-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 1.2rem;
  line-height: 1;
}
.qty-btn:hover {
  background-color: white;
}

.remove-btn {
  color: #EF4444;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  background-color: #f9fafb;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.empty-cart {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--color-text-muted);
  gap: 1rem;
}

/* --- Checkout View --- */
.checkout-view {
  padding: 2rem 0;
  background-color: var(--color-bg);
  min-height: 80vh;
}

.back-to-shop {
  margin-bottom: 2rem;
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
}

.checkout-form-section {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.checkout-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-size: 0.9rem;
}

.form-group input, .form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.payment-methods {
  display: grid;
  grid-template-columns: 1fr; /* Only one option now */
  gap: 1rem;
  margin-top: 1rem;
}

.payment-option {
  border: 1px solid var(--color-border);
  padding: 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s;
}

.payment-option:hover {
  background-color: var(--color-accent-bg);
}

.payment-option.selected {
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.05);
  color: var(--color-primary);
  font-weight: 600;
}

.order-summary-card {
  background: white;
  padding: 2rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 100px;
}

.checkout-items {
  max-height: 300px;
  overflow-y: auto;
  margin: 1.5rem 0;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  color: var(--color-text-muted);
}

.summary-row.total {
  color: var(--color-text-main);
  font-weight: 800;
  font-size: 1.2rem;
  margin-top: 1rem;
}

.summary-divider {
  height: 1px;
  background-color: var(--color-border);
  margin: 1rem 0;
}

.mt-8 { margin-top: 2rem; }
.mt-4 { margin-top: 1rem; }

/* --- Responsive --- */
@media (max-width: 768px) {
  .hero-container {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .hero-text p {
    margin: 0 auto 2rem;
  }
  
  .nav-menu {
    display: none; /* Hide nav on mobile */
  }
  
  .mobile-menu-btn {
    display: block;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .checkout-layout {
    grid-template-columns: 1fr;
  }
  
  .cart-drawer {
    width: 100%;
  }
  
  .contact-container {
    grid-template-columns: 1fr;
  }
  
  .category-list {
    justify-content: flex-start; /* Allow scroll on mobile */
  }
}
