* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: Tahoma, Arial, sans-serif;
  direction: rtl;
  color: #222;
  background: #f7f7f9;
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* TOP BAR (لوگو + سرچ باکس) */
.top-bar {
  background: #fff;
  border-bottom: 1px solid #eee;
}
.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  height: 80px;
}
.logo {
  font-weight: bold;
  font-size: 1.2rem;
  text-decoration: none;
  color: #222;
  flex-shrink: 0;
}
.logo img {
  width: 200px;
  height: 60px;
  display: block;
}
.search-box {
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 480px;
  border: 1px solid #ddd;
  border-radius: 22px;
  overflow: hidden;
  background: #f7f7f9;
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  padding: 10px 16px;
  font-family: inherit;
  font-size: .9rem;
  color: #222;
}
.search-box button {
  border: none;
  background: #6c63ff;
  color: #fff;
  width: 44px;
  height: 100%;
  min-height: 40px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-box button:hover { background: #574fd6; }

/* HEADER */
.header {
  background: #fff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 28px;
  height: 64px;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
}
.nav {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}
.nav a {
  text-decoration: none;
  color: #333;
  font-size: .95rem;
}
.nav a:hover { color: #6c63ff; }

/* AUTH BUTTONS (ورود / ثبت‌نام) */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
}
.nav-auth .auth-link {
  color: #333;
  font-size: .9rem;
  text-decoration: none;
  padding: 8px 14px;
}
.nav-auth .auth-link:hover { color: #6c63ff; }
.nav-auth .auth-btn {
  background: #6c63ff;
  color: #fff !important;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 20px;
  transition: background .2s;
}
.nav-auth .auth-btn:hover {
  background: #574fd6;
  color: #fff !important;
}

/* DROPDOWN */
.nav-item-dropdown {
  position: relative;
}
.nav-item-dropdown > a {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.nav-item-dropdown > a::after {
  content: '▾';
  font-size: .7rem;
}
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: auto;
  left: 0;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  min-width: 180px;
  padding: 8px;
  z-index: 60;
  text-align: right;
}
.nav-item-dropdown:hover .dropdown {
  display: block;
}
.dropdown a {
  display: block;
  padding: 9px 12px;
  border-radius: 6px;
  font-size: .88rem;
  color: #333;
  text-decoration: none;
  text-align: right;
}
.dropdown a:hover {
  background: #f5f4ff;
  color: #6c63ff;
}

/* DOUBLE BANNER */
.banner-double {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-top: 24px;
}
.banner-item {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  height: 180px;
  border: 1px solid #eee;
  transition: transform .2s, box-shadow .2s;
}
.banner-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0,0,0,.12);
}
.banner-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* HERO */
.hero {
  background: linear-gradient(135deg,#6c63ff,#8b7bff);
  color: #fff;
  text-align: center;
  padding: 50px 20px;
}
.hero h1 { font-size: 1.6rem; margin-bottom: 10px; }
.hero p { opacity: .9; font-size: .95rem; }

/* SECTIONS */
section.container { padding: 40px 20px; }
h2 { margin-bottom: 20px; font-size: 1.2rem; }

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.category-grid a {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 18px 10px;
  text-align: center;
  text-decoration: none;
  color: #333;
  font-size: .9rem;
  transition: .2s;
}
.category-grid a:hover { border-color: #6c63ff; color: #6c63ff; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.product-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  text-align: center;
}
.product-card .img-placeholder {
  background: #f0f0f5;
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
  padding:2px 2px;
}
.product-card .img-placeholder img {
  width: 100%;
  height: 100%;
  object-position: center;
}
.product-card h3 { font-size: .92rem; margin: 8px 0 3px; padding: 0 10px; }
.product-card p { color: #6c63ff; font-weight: bold; margin-bottom: 8px; padding: 0 10px; }
.product-card a.btn {
  display: block;
  margin: 0 10px 14px;
  background: #6c63ff;
  color: #fff;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 22px;
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
}

/* FOOTER */
.footer {
  background: #1a1a2e;
  color: #e0e0e0;
  margin-top: 40px;
}
.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  padding: 40px 20px;
}
.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 200px;
}
.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 12px;
}
.footer-col a {
  display: block;
  color: #c0c0e0;
  text-decoration: none;
  font-size: .88rem;
}
.footer-col p {
  font-size: .85rem;
  color: #aaa;
  margin-bottom: 6px;
}
.social-icons {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
}
.footer img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.footer-logo {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.footer-logo img {
  width: 200px;
  height: auto;
  display: block;
}
/* RESPONSIVE */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #fff;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 50;
  }
  .nav.open { display: flex; }
  .nav a {
    width: 100%;
    text-align: right;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
  }
  .nav-item-dropdown {
    width: 100%;
  }
  .nav-item-dropdown > a {
    border-bottom: 1px solid #eee;
    justify-content: flex-start;
  }
  .nav-item-dropdown .dropdown {
    display: none;
    position: static;
    box-shadow: none;
    border: none;
    background: #fafafe;
    width: 100%;
    padding: 0 10px 0 0;
  }
  .nav-item-dropdown.open .dropdown {
    display: block;
  }
  .nav-item-dropdown.open > a::after {
    content: '▴';
  }
  .nav-auth {
    width: 100%;
    margin-right: 0;
    margin-top: 10px;
    justify-content: flex-start;
  }
  .footer-grid {
    flex-direction: column;
  }
  .banner-double {
    gap: 12px;
  }
  .banner-item {
    height: 150px;
  }

  /* top-bar در موبایل: لوگو و سرچ زیر هم */
  .top-bar-inner {
    height: auto;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 20px;
  }
  .logo img {
    width: 140px;
    height: 42px;
  }
  .search-box {
    max-width: 100%;
    flex: 1 1 100%;
    order: 3;
  }
}

@media (max-width: 480px) {
  .category-grid,
  .product-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .footer-grid {
    flex-direction: column;
  }
  .banner-double {
    grid-template-columns: 1fr;
  }
  .banner-item {
    height: 160px;
  }
  .logo img {
    width: 110px;
    height: 33px;
  }
}

/* BREADCRUMB */
.breadcrumb {
  font-size: .85rem;
  color: #888;
  padding: 16px 20px 0;
}
.breadcrumb a { color: #6c63ff; text-decoration: none; }

/* PRODUCT DETAIL */
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 30px 20px 10px;
}
.product-gallery .main-img {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  margin-bottom: 12px;
  overflow: hidden;
}
.product-gallery .main-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.thumb-row {
  display: flex;
  gap: 10px;
}
.thumb-row .thumb {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 8px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  overflow: hidden;
}
.thumb-row .thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.thumb-row .thumb.active { border-color: #6c63ff; }

.product-info h1 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}
.product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: .9rem;
  color: #888;
}
.product-rating .stars { color: #f5c518; }

.price-box {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
}
.price-box .old-price {
  color: #aaa;
  text-decoration: line-through;
  font-size: .85rem;
  margin-bottom: 4px;
}
.price-box .new-price {
  color: #1aab55;
  font-size: 1.5rem;
  font-weight: bold;
}
.price-box .discount-tag {
  display: inline-block;
  background: #ff6584;
  color: #fff;
  font-size: .75rem;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 20px;
  margin-right: 8px;
  vertical-align: middle;
}

.feature-list {
  list-style: none;
  margin-bottom: 20px;
}
.feature-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
  font-size: .9rem;
}
.feature-list li span:first-child { color: #888; }
.feature-list li span:last-child { font-weight: 600; }

.qty-cart {
  display: flex;
  align-items: center;
  gap: 14px;
}
.qty-box {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
}
.qty-box button {
  background: #f5f5f7;
  border: none;
  width: 36px;
  height: 38px;
  font-size: 1.1rem;
  cursor: pointer;
}
.qty-box span {
  width: 36px;
  text-align: center;
  font-weight: bold;
}
.buy-btn {
  flex: 1;
  background: #6c63ff;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: .2s;
}
.buy-btn:hover { background: #574fd6; }

.stock-status {
  margin-top: 14px;
  font-size: .85rem;
  color: #1aab55;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* DESCRIPTION TABS */
.desc-tabs {
  padding: 40px 20px;
}
.tab-buttons {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid #eee;
  margin-bottom: 20px;
}
.tab-buttons button {
  background: none;
  border: none;
  padding: 12px 18px;
  font-size: .95rem;
  cursor: pointer;
  color: #888;
  border-bottom: 2.5px solid transparent;
  font-family: inherit;
}
.tab-buttons button.active {
  color: #6c63ff;
  border-bottom-color: #6c63ff;
  font-weight: bold;
}
.tab-content { display: none; line-height: 2; color: #444; font-size: .92rem; }
.tab-content.active { display: block; }
.tab-content ul { padding-right: 20px; margin-top: 10px; }
.tab-content table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.tab-content table td {
  padding: 10px;
  border: 1px solid #eee;
  font-size: .88rem;
}
.tab-content table td:first-child { background: #f7f7f9; width: 35%; color: #888; }

/* REVIEWS */
.review-item {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
}
.review-item .review-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: .85rem;
  color: #888;
}
.review-item .review-name { font-weight: bold; color: #222; }

@media (max-width: 768px) {
  .product-detail {
    grid-template-columns: 1fr;
  }
}

/* ABOUT US - PROFILE CARDS */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.profile-card {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 14px;
  padding: 24px 18px;
  text-align: center;
  transition: .2s;
}
.profile-card:hover {
  border-color: #6c63ff;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.profile-img {
  width: 130px;
  height: 130px;
  margin: 0 auto 16px;
  border-radius: 50%;
  overflow: hidden;
  background: #f0f0f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border: 3px solid #f5f4ff;
}
.profile-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profile-name {
  font-size: 1rem;
  margin-bottom: 4px;
  color: #222;
}
.profile-role {
  font-size: .85rem;
  color: #6c63ff;
  margin-bottom: 14px;
}
.profile-contact {
  list-style: none;
  border-top: 1px solid #eee;
  padding-top: 12px;
  text-align: right;
}
.profile-contact li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  color: #555;
  padding: 6px 0;
}
.profile-contact .icon {
  font-size: .95rem;
}

@media (max-width: 768px) {
  .profile-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 480px) {
  .profile-grid {
    grid-template-columns: 1fr !important;
  }
}