/* 
  PURE CSS STYLESHEET 
  Font: Vazirmatn
  Theme: Modern Light RTL
*/

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

:root {
  --primary: #0f172a; /* Darker Slate */
  --accent: #3b82f6; /* Blue 500 */
  --accent-hover: #2563eb;
  --danger: #ef4444;
  --success: #10b981;
  --bg-body: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --container-width: 1280px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Vazirmatn', sans-serif;
}

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

main {
    flex: 1;
}

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

ul {
  list-style: none;
}

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

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

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

.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

/* --- UTILITIES --- */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-8 { gap: 2rem; }
.grid { display: grid; }
.hidden { display: none !important; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }
.text-sm { font-size: 0.875rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.bg-white { background-color: white; }
.shadow { box-shadow: var(--shadow-md); }
.rounded { border-radius: var(--radius); }
.p-4 { padding: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.w-full { width: 100%; }

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  gap: 0.5rem;
  font-size: 0.95rem;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: #020617;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3);
}

.btn-accent {
  background-color: var(--accent);
  color: white;
}
.btn-accent:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-outline {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: #f1f5f9;
}

.btn-white {
    background: white;
    color: var(--text-main);
    border: 1px solid #e2e8f0;
}
.btn-white:hover {
    background: #f8fafc;
}

.btn-block {
  width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
    border-radius: 50%;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background: #f1f5f9;
}

/* --- FORMS --- */
.form-container {
  background: white;
  padding: 2.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 450px;
  margin: 2rem auto;
  border: 1px solid var(--border);
}

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

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  transition: 0.2s;
  background: #f8fafc;
}

.form-input:focus {
  border-color: var(--accent);
  background: white;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

textarea.form-input {
  resize: vertical;
}


/* --- HEADER --- */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar {
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  padding: 0.6rem 0;
  text-align: center;
  letter-spacing: 0.5px;
}

.nav-container {
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.nav-links {
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-weight: 500;
  color: var(--text-main);
  position: relative;
  font-size: 1rem;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: 0.3s;
}
.nav-links a:hover::after {
    width: 100%;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.icon-btn {
  position: relative;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--text-main);
  transition: 0.2s;
}
.icon-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.badge {
  position: absolute;
  top: -5px;
  right: -8px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  font-size: 1.8rem;
  cursor: pointer;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  background: white;
  z-index: 200;
  padding: 2.5rem;
  box-shadow: -10px 0 30px rgba(0,0,0,0.1);
  transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 3rem;
}
.mobile-nav-links a {
    font-size: 1.1rem;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.5rem;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(2px);
  z-index: 150;
  display: none;
  opacity: 0;
  transition: 0.3s;
}
.overlay.active { display: block; opacity: 1; }

/* --- HERO SECTION --- */
.hero {
  height: 550px;
  background: linear-gradient(to left, rgba(0,0,0,0.2), rgba(0,0,0,0.6)), url('https://images.unsplash.com/photo-1483985988355-763728e1935b?q=80&w=1600&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  color: white;
  margin-bottom: 3rem;
  border-radius: 0 0 3rem 3rem;
  position: relative;
}

.hero-content {
    text-align: right;
    max-width: 600px;
    padding-right: 4rem;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.2;
  font-weight: 900;
}

.hero-content p {
  font-size: 1.3rem;
  margin-bottom: 2.5rem;
  opacity: 0.95;
  font-weight: 300;
}

/* --- SECTIONS --- */
.section-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 3rem;
  text-align: center;
  position: relative;
  color: var(--primary);
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background: var(--accent);
  margin: 1rem auto 0;
  border-radius: 10px;
}

/* --- PRODUCT CARDS --- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2.5rem;
}

.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  transition: 0.3s ease;
  position: relative;
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}

.product-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(-8px);
  border-color: #f1f5f9;
}

.product-img {
  height: 280px;
  overflow: hidden;
  background: #f8fafc;
  position: relative;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: 0.3s;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

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

.product-category {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.product-title {
  font-weight: 700;
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
  line-height: 1.4;
  flex: 1;
}
.product-title a:hover {
    color: var(--accent);
}

.product-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

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

.btn-add-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #f1f5f9;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--primary);
    transition: 0.2s;
}
.btn-add-icon:hover {
    background: var(--primary);
    color: white;
}

/* --- FEATURES --- */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  text-align: center;
}

.feature-item {
  padding: 2.5rem;
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  transition: 0.3s;
}
.feature-item:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
}

.feature-icon {
  font-size: 3rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

/* --- FOOTER --- */
footer {
  background: var(--primary);
  color: white;
  padding: 5rem 0 2rem;
  margin-top: auto; /* Pushes footer to bottom */
}

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

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

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

.footer-col ul li a {
  color: #94a3b8;
  transition: 0.2s;
}

.footer-col ul li a:hover {
  color: white;
  padding-right: 8px;
}

.copyright {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

/* --- PRODUCTS PAGE --- */
.products-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 3rem;
  align-items: start;
}

.filters-sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  position: sticky;
  top: 100px;
}

.sidebar-search {
  margin-bottom: 2rem;
  position: relative;
}

.sidebar-search input {
  width: 100%;
  padding: 0.8rem;
  padding-left: 2.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.sidebar-search i {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.filter-group {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.filter-group:last-child { border: none; padding: 0; margin: 0; }

.filter-title {
  font-weight: 700;
  margin-bottom: 1.2rem;
  display: block;
  font-size: 1.05rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text-muted);
  transition: 0.2s;
}
.checkbox-label:hover { color: var(--text-main); }

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

/* --- PRODUCT DETAILS --- */
.product-detail-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 4rem;
  background: white;
  padding: 3rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.gallery-main {
  width: 100%;
  height: 500px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: #f8fafc;
}
.gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 2rem;
}

.detail-info h1 {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.detail-price {
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: 800;
  margin-bottom: 2rem;
}

.detail-desc {
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.9;
  font-size: 1.05rem;
}

.options-group {
  margin-bottom: 2rem;
}

.option-title {
  font-weight: 600;
  margin-bottom: 0.8rem;
  display: block;
  font-size: 0.95rem;
}

.color-options, .size-options {
  display: flex;
  gap: 0.8rem;
}

.color-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid var(--border);
  transition: 0.2s;
}
.color-circle.selected { border-color: var(--primary); transform: scale(1.15); box-shadow: 0 0 0 2px white, 0 0 0 4px var(--primary); }

.size-box {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}
.size-box:hover { border-color: var(--text-muted); }
.size-box.selected { background: var(--primary); color: white; border-color: var(--primary); }

/* --- CART PAGE --- */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
}

.cart-items {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 2rem;
}

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

.cart-img {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  object-fit: cover;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  background: #f8fafc;
  width: fit-content;
  padding: 5px;
  border-radius: 8px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }

.cart-summary {
  background: white;
  padding: 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 100px;
}

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

.total-row {
  font-weight: 800;
  font-size: 1.3rem;
  border-top: 2px dashed var(--border);
  padding-top: 1.5rem;
  margin-top: 1.5rem;
  color: var(--text-main);
}

.empty-cart {
    text-align: center;
    padding: 4rem 0;
}
.empty-cart i { font-size: 4rem; color: var(--border); margin-bottom: 1rem; }

/* --- TOAST --- */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--primary);
    color: white;
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 1000;
    font-weight: 500;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
  .products-layout {
    grid-template-columns: 1fr;
  }
  .filters-sidebar {
    display: none; /* In a real app, toggle this */
  }
  .hero-content { padding-right: 0; text-align: center; margin: 0 auto; }
  .hero { justify-content: center; }
  .product-detail-grid { grid-template-columns: 1fr; padding: 1.5rem; }
  .gallery-main { height: 350px; }
}

@media (max-width: 768px) {
  .nav-links, .btn-desktop { display: none; }
  .mobile-menu-btn { display: block; }
  
  .hero h1 { font-size: 2.2rem; }
  .hero { height: 400px; border-radius: 0 0 2rem 2rem; }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr); /* EXACTLY 2 per row mobile */
    gap: 1rem;
  }
  
  .cart-layout {
    grid-template-columns: 1fr;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .container { padding: 0 1rem; }
  
  .product-img { height: 200px; }
  .product-info { padding: 0.8rem; }
  .product-title { font-size: 0.9rem; }
  .product-price { font-size: 1rem; }
  .btn-add-icon { width: 30px; height: 30px; font-size: 1rem; }
}
