/* ================= Variables ================= */
:root {
  --primary-color: #153a7f;
  --secondary-color: #44c2c8;
  --accent-color: #e63946;
  --text-dark: #3f3f3f;
  --text-gray: #62666d;
  --bg-light: #f0f0f1;
  --border-color: #e0e0e2;
  --white: #ffffff;
}

/* ================= Base ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Vazir", "Vazirmatn", sans-serif;
}

body {
  background-color: var(--white);
  color: var(--text-dark);
  overflow-x: hidden;
}

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

/* ================= Header ================= */
.main-header {
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  padding: 15px 0;
  border-bottom: 2px solid var(--bg-light);
}

.top-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 30px;
}

.logo a {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary-color);
  text-decoration: none;
  min-width: 120px;
}

.search-container {
  flex-grow: 1;
  max-width: 600px;
}

.search-box {
  display: flex;
  background-color: var(--bg-light);
  border-radius: 8px;
  overflow: hidden;
}

.search-box input {
  flex-grow: 1;
  padding: 12px 15px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 14px;
  color: var(--text-dark);
}

.search-box button {
  padding: 0 15px;
  background: transparent;
  border: none;
  color: var(--text-gray);
  cursor: pointer;
  display: flex;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: max-content;
}

.login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  background-color: var(--white) !important;
  transition: all 0.3s ease;
  cursor: pointer;
}

.login-btn:hover {
  background-color: #f5f5f5;
  border-color: var(--secondary-color);
  color: var(--secondary-color);
}

.action-divider {
  width: 1px;
  height: 24px;
  background-color: var(--border-color);
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-dark);
  text-decoration: none;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--accent-color);
  color: var(--white);
  font-size: 12px;
  font-weight: bold;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid var(--white);
}

/* ================= Header Nav ================= */
.header-bottom {
  background-color: var(--white);
  padding: 10px 0;
  border-bottom: 2px solid var(--bg-light);
}

.bottom-container {
  display: flex;
  align-items: center;
  gap: 20px;
}

.vertical-divider {
  width: 1px;
  height: 20px;
  background-color: var(--border-color);
}

.main-nav ul,
.nav-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 24px;
  align-items: center;
}

.main-nav a,
.nav-links a {
  text-decoration: none;
  color: var(--text-gray);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.main-nav a:hover,
.nav-links a:hover {
  color: var(--secondary-color);
}

/* ================= Dropdowns ================= */
.dropdown-container {
  position: relative;
  display: inline-block;
}

.category-btn,
.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-dark);
  cursor: pointer;
  padding: 0;
}

.dropdown-toggle * {
  pointer-events: none;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  min-width: 180px;
  margin-top: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.category-dropdown {
  min-width: 240px;
}

.category-dropdown ul {
  list-style: none;
  padding: 10px 0;
  margin: 0;
}

.category-dropdown li a,
.dropdown-menu a {
  display: block;
  padding: 12px 20px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s ease;
}

.category-dropdown li a:hover,
.dropdown-menu a:hover {
  background-color: var(--bg-light);
  color: var(--secondary-color);
}

.category-dropdown li a:hover {
  padding-right: 25px;
}

.user-profile-dropdown {
  border: 2px #0056b3;
}

.profile-dropdown-menu a {
  border-bottom: 1px solid #f0f0f0;
}

.profile-dropdown-menu a:last-child {
  border-bottom: none;
}

.profile-dropdown-menu .logout-link {
  color: var(--accent-color);
}

.profile-dropdown-menu .logout-link:hover {
  background-color: #fdf2f0;
  color: var(--accent-color);
}

/* ================= Slider Buttons ================= */
.slider-btn,
.product-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--white);
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 45px;
  height: 45px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.slider-btn:hover,
.product-slider-btn:hover {
  background-color: var(--primary-color);
  color: var(--white);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

/* ================= Hero Slider ================= */
.hero-slider-section {
  max-width: 1400px;
  margin: 2rem auto;
  padding: 0 1rem;
  position: relative;
}

.slider-container {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.slides-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  background-color: #f5f5f5;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.5s ease-in-out, visibility 0.5s;
}

.slide.active {
  opacity: 1;
  visibility: visible;
}

.slide a,
.slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slider-section .prev-btn { right: 25px; }
.hero-slider-section .next-btn { left: 25px; }

.slider-dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.dot {
  width: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.dot.active,
.dot:hover {
  background: #fff;
  transform: scale(1.2);
}

/* ================= Product Section & Slider ================= */
.product-section {
  margin-top: 40px;
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
}

.section-header h2 {
  font-size: 1.4rem;
  color: var(--primary-color);
  margin: 0;
  position: relative;
}

.section-header h2::after {
  content: "";
  position: absolute;
  bottom: -12px;
  right: 0;
  width: 50px;
  height: 3px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

.view-all-link {
  font-size: 0.9rem;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.3s;
}

.view-all-link:hover {
  color: var(--accent-color);
}

.product-slider-wrapper {
  position: relative;
  padding: 0 10px;
}

.product-slider-wrapper .prev-btn { right: -15px; }
.product-slider-wrapper .next-btn { left: -15px; }

.product-slider {
  display: flex;
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 15px 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.product-slider::-webkit-scrollbar {
  display: none;
}

/* ================= Product Cards ================= */
.product-card {
  flex: 0 0 240px;
  scroll-snap-align: start;
  background: var(--white);
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  position: relative;
}

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

.product-link {
  text-decoration: none;
  color: inherit;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-image {
  width: 100%;
  height: 250px;
  padding: 15px;
  text-align: center;
  background-color: #f9f9f9;
}

.product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

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

.product-title {
  font-size: 1rem;
  margin: 0 0 5px 0;
  color: #333;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-author {
  font-size: 0.85rem;
  color: #777;
  margin: 0 0 15px 0;
}

.product-price-wrapper {
  margin-top: auto;
  text-align: left;
}

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

.product-price small {
  font-size: 0.8rem;
  font-weight: normal;
}

.add-to-cart-btn {
  width: 100%;
  background-color: transparent;
  color: var(--accent-color);
  border: 1px solid var(--accent-color);
  padding: 10px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  border-top: none;
  border-right: none;
  border-left: none;
}

.product-card:hover .add-to-cart-btn {
  background-color: var(--accent-color);
  color: var(--white);
}

/* ================= Publisher Slider ================= */
.publisher-card {
  flex: 0 0 auto;
  width: 140px;
  text-align: center;
  background: transparent;
  border: none;
  box-shadow: none;
}

.publisher-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  gap: 12px;
}

.publisher-logo-wrapper {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: #f9f9f9;
  border: 1px solid #eef0f2;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 15px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.publisher-link:hover .publisher-logo-wrapper {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
  border-color: var(--primary-color);
}

.publisher-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.publisher-name {
  font-size: 14px;
  color: #333;
  margin: 0;
  font-weight: 500;
  transition: color 0.3s ease;
}

.publisher-link:hover .publisher-name {
  color: var(--primary-color);
}

/* ================= Magazine Section ================= */
.magazine-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 20px;
}

@media (min-width: 768px) {
  .magazine-grid {
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
  }
}

.article-link {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.3s ease;
}

.article-link:hover {
  transform: translateY(-3px);
}

.article-image {
  overflow: hidden;
  border-radius: 12px;
}

.article-image img {
  width: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-link:hover .article-image img {
  transform: scale(1.03);
}

.hero-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-image {
  height: 260px;
  border-radius: 12px;
  overflow: hidden;
}

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

.hero-card .article-content {
  padding: 20px 0;
}

.hero-card .article-title {
  font-size: 1.5rem;
  margin-bottom: 15px;
  color: #222;
  line-height: 1.4;
}

.article-excerpt {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.8;
  margin-bottom: 15px;
  text-align: justify;
}

.list-cards {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  gap: 24px;
}

.list-card .flex-row {
  display: flex;
  align-items: center;
  gap: 15px;
}

.list-image {
  flex-shrink: 0;
  width: 140px;
  height: 120px;
  border-radius: 10px;
  overflow: hidden;
}

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

.list-card .article-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.list-card .article-title {
  font-size: 1.05rem;
  margin-bottom: 12px;
  color: #222;
  line-height: 1.5;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #888;
}

.article-meta svg {
  width: 14px;
  height: 14px;
  stroke: var(--secondary-color);
}

/* ================= Footer ================= */
.minimal-footer {
  background-color: #0f172a;
  border-top: 3px solid #0891b2;
  color: #94a3b8;
  padding: 50px 0 20px;
  margin-top: auto;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-col h3.footer-logo {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--white);
}

.footer-col h4 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 20px;
  color: var(--white);
}

.footer-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #94a3b8;
  max-width: 80%;
}

.links-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.links-col ul li {
  margin-bottom: 12px;
}

.minimal-footer a {
  text-decoration: none;
  color: #94a3b8;
  font-size: 0.95rem;
  transition: color 0.3s ease;
}

.minimal-footer a:hover {
  color: #22d3ee;
}

.social-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-bottom {
  max-width: 1200px;
  margin: 30px auto 0;
  padding: 20px 20px 0;
  border-top: 1px solid #1e293b;
  text-align: center;
  font-size: 0.85rem;
  color: #64748b;
}

/* ================= Auth Pages ================= */
.auth-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 150px);
  background-color: #f9f9f9;
  padding: 40px 20px;
}

.auth-container {
  background-color: var(--white);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 400px;
}

.auth-container h2 {
  text-align: center;
  margin-bottom: 30px;
  color: var(--primary-color);
  font-size: 1.5rem;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #555;
  font-size: 0.95rem;
  font-weight: 500;
}

.form-group input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

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

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 1.1rem;
  border-radius: 8px;
  margin-top: 10px;
  cursor: pointer;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  transition: background-color 0.3s;
}

.btn-block:hover {
  background-color: var(--secondary-color);
}

.alert {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  text-align: center;
}

.alert-danger {
  background-color: #f8d7da;
  color: var(--accent-color);
  border: 1px solid #f5c6cb;
}

.auth-links {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #666;
}

.auth-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.auth-links a:hover {
  text-decoration: underline;
  color: var(--secondary-color);
}

/* ================= Utility ================= */
.text-danger {
  color: var(--accent-color) !important;
}

.text-danger:hover {
  background-color: #ffe6e6 !important;
}

/* ================= Single Blog Post ================= */
.rb-single-wrapper {
  background-color: #f9f9f9;
  padding: 50px 20px;
  direction: rtl;
}

.rb-single-container {
  max-width: 850px;
  margin: 0 auto;
  background-color: var(--white);
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.rb-single-header {
  text-align: center;
  margin-bottom: 30px;
}

.rb-single-title {
  font-size: 2.2rem;
  color: #333;
  line-height: 1.5;
  margin-bottom: 10px;
}

.rb-single-meta {
  font-size: 0.9rem;
  color: #888;
}

.rb-single-image-wrapper {
  margin-bottom: 30px;
  border-radius: 8px;
  overflow: hidden;
}

.rb-single-image {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.rb-single-intro {
  background-color: #f1f8ff;
  border-right: 4px solid var(--primary-color);
  padding: 20px;
  margin-bottom: 30px;
  border-radius: 4px;
  font-size: 1.15rem;
  color: #444;
  line-height: 1.8;
  font-weight: bold;
}

.rb-single-intro p {
  margin: 0;
}

.rb-single-content {
  font-size: 1.1rem;
  line-height: 2;
  color: #333;
  text-align: justify;
}

.rb-single-content h2,
.rb-single-content h3 {
  margin-top: 35px;
  margin-bottom: 15px;
  color: #222;
}

.rb-single-content p {
  margin-bottom: 20px;
}

.rb-single-footer {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px solid #eaeaea;
  text-align: right;
}

.rb-back-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.rb-back-btn:hover {
  background-color: var(--secondary-color);
}

/* ================= Category Pages ================= */
.cat-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  direction: rtl;
}

.cat-header-title {
  font-size: 24px;
  color: #333;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--secondary-color);
  padding-bottom: 10px;
  display: inline-block;
}

.cat-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.cat-product-card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.cat-product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.cat-product-image {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 15px;
}

.cat-product-title {
  font-size: 16px;
  color: #333;
  text-align: center;
  margin-bottom: 15px;
  line-height: 1.6;
  font-weight: bold;
}

.cat-product-footer {
  margin-top: auto;
  text-align: center;
}

.cat-product-price {
  font-size: 15px;
  color: var(--primary-color);
  font-weight: bold;
  margin-bottom: 15px;
}

.cat-add-to-cart-btn {
  display: block;
  width: 100%;
  padding: 10px 0;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 4px;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: background-color 0.2s;
  font-family: inherit;
}

.cat-add-to-cart-btn:hover {
  background-color: var(--secondary-color);
}

.cat-empty-msg {
  text-align: center;
  color: #777;
  font-size: 16px;
  padding: 50px;
  background: #f9f9f9;
  border-radius: 8px;
  grid-column: 1 / -1;
}

/* ================= Breadcrumb ================= */
.breadcrumb {
  max-width: 1200px;
  margin: 20px auto 10px;
  padding: 0 15px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #777;
}

.breadcrumb a {
  text-decoration: none;
  color: #555;
  transition: color 0.2s ease;
}

.breadcrumb a:hover {
  color: var(--secondary-color);
}

.breadcrumb-separator {
  color: #bbb;
  font-size: 12px;
}

.breadcrumb-current {
  color: #222;
  font-weight: 600;
}

/* ================= Publishers List Page ================= */
.pub-page-wrapper {
  width: 100%;
  direction: rtl;
  padding: 40px 0;
}

.pub-page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.pub-page-heading {
  font-size: 22px;
  color: #333;
  margin-bottom: 40px;
  border-bottom: 3px solid var(--secondary-color);
  padding-bottom: 12px;
  display: inline-block;
  font-weight: 800;
}

.pub-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 40px 20px;
  justify-items: center;
  align-items: start;
}

.pub-page-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.pub-page-link {
  text-decoration: none !important;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.pub-page-logo {
  width: 110px;
  height: 110px;
  border-radius: 50% !important;
  object-fit: contain;
  background-color: var(--white);
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #efefef;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pub-page-card:hover .pub-page-logo {
  transform: translateY(-10px);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.1);
  border-color: var(--secondary-color);
}

.pub-page-name {
  font-size: 0.95rem;
  color: #2c3e50;
  margin: 0;
  font-weight: 600;
  text-align: center;
  transition: color 0.3s ease;
}

.pub-page-card:hover .pub-page-name {
  color: var(--secondary-color);
}

.pub-page-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  background: #fcfcfc;
  border: 1px dashed #ddd;
  border-radius: 15px;
  color: #888;
}

/* ================= Publisher Detail Page ================= */
.pub-main-container {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 20px;
  color: #333;
}

.pub-breadcrumb {
  padding: 15px 0;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: #666;
  border-bottom: 1px solid #eee;
}

.pub-breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.pub-breadcrumb a:hover {
  color: var(--secondary-color);
}

.pub-separator {
  margin: 0 8px;
  color: #aaa;
}

.pub-current {
  color: #333;
  font-weight: 500;
}

.pub-info-section {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
}

.pub-info-wrapper {
  display: flex;
  align-items: center;
  gap: 30px;
}

.pub-logo {
  width: 150px;
  height: 150px;
  object-fit: contain;
  border: 1px solid #f0f0f0;
  border-radius: 50%;
  padding: 10px;
  background-color: var(--white);
  flex-shrink: 0;
}

.pub-logo-placeholder {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f5f5f5;
  border-radius: 50%;
  font-size: 50px;
  color: #ccc;
  flex-shrink: 0;
}

.pub-details {
  flex: 1;
}

.pub-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 15px;
  color: #222;
}

.pub-description {
  font-size: 1rem;
  line-height: 1.8;
  color: #555;
  text-align: justify;
}

.pub-books-section {
  margin-top: 2rem;
}

.pub-section-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: #333;
}

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 25px;
}

.pub-card {
  text-decoration: none;
  color: inherit;
  background-color: var(--white);
  border: 1px solid #e9e9e9;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.pub-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.pub-card-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  background-color: #f9f9f9;
}

.pub-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pub-card-content {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.pub-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pub-card-author {
  font-size: 0.85rem;
  color: #777;
  margin-bottom: 12px;
  flex-grow: 1;
}

.pub-card-price {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary-color);
  text-align: left;
}

.pub-empty-state,
.pub-error {
  text-align: center;
  padding: 50px 20px;
  background-color: #fafafa;
  border: 1px dashed #ddd;
  border-radius: 8px;
  color: #888;
}

/* ================= Product Detail Page ================= */
.prod-main-container {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 20px;
  direction: rtl;
}

.prod-breadcrumb {
  padding: 15px 0;
  margin-bottom: 2rem;
  font-size: 0.9rem;
  color: #666;
  border-bottom: 1px solid #eee;
}

.prod-breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
}

.prod-breadcrumb a:hover {
  text-decoration: underline;
}

.prod-breadcrumb .separator {
  margin: 0 8px;
  color: #aaa;
}

.prod-breadcrumb .current {
  color: #333;
  font-weight: 500;
}

.prod-content-wrapper {
  display: flex;
  gap: 40px;
  background-color: var(--white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.prod-image-wrapper {
  flex: 0 0 300px;
}

.prod-image {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #f0f0f0;
}

.prod-details-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.prod-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-top: 0;
  margin-bottom: 1rem;
  color: #1e293b;
  line-height: 1.4;
}

.prod-meta {
  list-style: none;
  padding: 0 0 1rem 0;
  margin: 0 0 1.5rem 0;
  font-size: 1rem;
  color: #555;
  border-bottom: 1px solid #eee;
}

.prod-meta li {
  margin-bottom: 12px;
}

.prod-meta strong {
  font-weight: 600;
  margin-left: 8px;
  color: #333;
}

.prod-meta a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.prod-meta a:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

.prod-price-box {
  margin-bottom: 1.5rem;
}

.prod-price {
  font-size: 2.2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.prod-currency {
  font-size: 1.1rem;
  margin-right: 5px;
  color: #64748b;
}

.prod-description {
  font-size: 1rem;
  line-height: 1.8;
  color: #444;
  text-align: justify;
  margin-bottom: 2rem;
}

.prod-add-to-cart {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 15px 40px;
  font-size: 18px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  display: inline-block;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.prod-add-to-cart:hover {
  background-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.prod-add-to-cart:active {
  transform: translateY(0);
}

.prod-error-container {
  text-align: center;
  padding: 50px 20px;
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.prod-error-container h2 {
  color: var(--accent-color);
  margin-bottom: 15px;
}

.prod-error-container p {
  color: #555;
  margin-bottom: 25px;
}

.prod-error-container a {
  display: inline-block;
  padding: 10px 20px;
  background: var(--primary-color);
  color: var(--white);
  border-radius: 5px;
  text-decoration: none;
  transition: background 0.3s;
}

.prod-error-container a:hover {
  background: var(--secondary-color);
}

/* ================= Cart Page ================= */
.ktb-cart-wrapper {
  max-width: 1100px;
  margin: 40px auto;
  background: var(--white);
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  direction: rtl;
}

.ktb-cart-title {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 15px;
  margin-bottom: 25px;
  font-size: 24px;
  font-weight: bold;
}

.ktb-cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.ktb-cart-table th {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 15px;
  text-align: right;
  font-size: 16px;
}

.ktb-cart-table td {
  padding: 15px;
  border-bottom: 1px solid #eee;
  vertical-align: middle;
  color: #333;
}

.ktb-cart-img {
  width: 70px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ktb-cart-qty-input {
  width: 60px;
  padding: 8px;
  text-align: center;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-family: inherit;
}

.ktb-cart-btn {
  padding: 8px 15px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  color: var(--white);
  font-size: 14px;
  transition: background-color 0.3s;
}

.ktb-cart-btn-update { background-color: #28a745; }
.ktb-cart-btn-update:hover { background-color: #218838; }

.ktb-cart-btn-remove { background-color: var(--accent-color); }
.ktb-cart-btn-remove:hover { background-color: #c82333; }

.ktb-cart-total-row {
  background-color: #f8f9fa;
  font-weight: bold;
  font-size: 18px;
}

.ktb-cart-empty {
  text-align: center;
  padding: 60px 20px;
  font-size: 18px;
  color: #777;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.ktb-cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
}

.ktb-cart-btn-checkout {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 12px 25px;
  text-decoration: none;
  font-size: 16px;
  border-radius: 5px;
  transition: background 0.3s;
}

.ktb-cart-btn-checkout:hover {
  background-color: var(--secondary-color);
  color: var(--white);
}

.ktb-cart-btn-continue {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.ktb-cart-btn-continue:hover {
  text-decoration: underline;
}

/* ================= Blog List Page ================= */
.blog-page-container {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
  direction: rtl;
}

.blog-page-title {
  text-align: center;
  color: var(--primary-color);
  margin-bottom: 40px;
  font-size: 2rem;
  font-weight: bold;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 30px;
  margin-bottom: 50px;
}

@media (min-width: 768px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(3, 1fr); }
}

.article-card {
  background: var(--white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

.article-card .article-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.article-card .article-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.article-date {
  font-size: 0.85rem;
  color: #6b7280;
  margin-bottom: 10px;
}

.article-card .article-title {
  font-size: 1.25rem;
  color: #111827;
  margin: 0 0 10px 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card .article-excerpt {
  color: #4b5563;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

.read-more-btn {
  display: inline-block;
  color: var(--secondary-color);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
  align-self: flex-start;
}

.read-more-btn:hover {
  color: var(--primary-color);
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  list-style: none;
  padding: 0;
}

.pagination a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: #f3f4f6;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.pagination a:hover {
  background: #e5e7eb;
}

.pagination a.active {
  background: var(--secondary-color);
  color: var(--white);
}

.alert-message {
  text-align: center;
  padding: 20px;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 8px;
}

.empty-message {
  text-align: center;
  padding: 40px;
  color: #6b7280;
  font-size: 1.1rem;
}

/* ================= Responsive ================= */
@media (max-width: 992px) {
  .top-container { gap: 15px; }
  .search-container { max-width: 400px; }
  .main-nav ul, .nav-links { gap: 15px; }
  .pub-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
  .container { padding: 0 15px; }

  .top-container {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .logo { order: 1; }
  .header-actions { order: 2; }

  .search-container {
    order: 3;
    max-width: 100%;
    width: 100%;
    margin-top: 10px;
  }

  .bottom-container {
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
  }

  .bottom-container::-webkit-scrollbar { height: 4px; }
  .bottom-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
  }

  .slides-wrapper { aspect-ratio: 16 / 9; }

  .slider-btn,
  .product-slider-btn {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }

  .hero-slider-section .prev-btn { right: 10px; }
  .hero-slider-section .next-btn { left: 10px; }
  .product-slider-wrapper .prev-btn { right: -5px; }
  .product-slider-wrapper .next-btn { left: -5px; }

  .auth-container { padding: 25px 20px; }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
  }

  .footer-desc {
    max-width: 100%;
    margin: 0 auto;
  }

  .pub-main-container { margin: 1rem auto; }

  .pub-info-wrapper {
    flex-direction: column;
    text-align: center;
  }

  .pub-logo,
  .pub-logo-placeholder {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
  }

  .pub-title { font-size: 1.8rem; }
  .pub-section-title { font-size: 1.5rem; }

  .pub-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .pub-card-title { font-size: 1rem; }
  .pub-card-price { font-size: 1rem; }

  .prod-content-wrapper { flex-direction: column; }

  .prod-image-wrapper {
    flex-basis: auto;
    max-width: 300px;
    margin: 0 auto;
  }

  .prod-title { font-size: 1.8rem; }
  .prod-price { font-size: 1.8rem; }
  .prod-add-to-cart { width: 100%; }

  .rb-single-container { padding: 20px; }
  .rb-single-title { font-size: 1.6rem; }
  .rb-single-intro { font-size: 1rem; }
  .rb-single-content { font-size: 1rem; }
}

@media (max-width: 600px) {
  .pub-page-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .pub-page-logo {
    width: 90px;
    height: 90px;
  }
}

@media (max-width: 480px) {
  .header-actions { gap: 10px; }
  .login-btn { padding: 6px 10px; font-size: 12px; }
  .action-divider { display: none; }
  .logo a { font-size: 22px; }

  .pub-grid { grid-template-columns: repeat(2, 1fr); }
}
/* ==========================================
   اصلاح ساختار بدنه برای ثابت ماندن فوتر در پایین
========================================== */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* کل ارتفاع مرورگر را پوشش می‌دهد */
  margin: 0;
}

/* تمام محتوای اصلی بین هدر و فوتر را مجبور می‌کند فضای خالی را پر کند */
main, 
.ktb-cart-container {
  flex: 1 0 auto; 
}

/* فوتر همیشه در انتهای این چیدمان قرار می‌گیرد */
.minimal-footer {
  flex-shrink: 0;
  margin-top: auto; /* اگر محتوا کم بود، فوتر را به پایین هل می‌دهد */
}

/* ==========================================
   استایل‌های بهینه‌شده و شکیل سبد خرید
========================================== */
.ktb-cart-container {
  max-width: 1200px;
  width: 90%;          /* جلوگیری از چسبیدن به کناره‌ها در مانیتورهای کوچک */
  margin: 40px auto;   /* ایجاد فاصله مناسب از هدر و فوتر و قرارگیری در وسط */
  padding: 25px;
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.ktb-cart-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 25px;
  border-bottom: 2px solid var(--bg-light);
  padding-bottom: 15px;
}

/* ریسپانسیو کردن جدول برای موبایل */
.ktb-cart-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
  text-align: center;
}

.ktb-cart-table th {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 14px;
  font-weight: bold;
  font-size: 0.95rem;
}

.ktb-cart-table td {
  padding: 15px 10px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
  font-size: 0.9rem;
}

.ktb-cart-img {
  width: 70px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.ktb-cart-item-title {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.2s;
}

.ktb-cart-item-title:hover {
  color: var(--secondary-color);
}

/* دکمه‌ها و فرم‌های داخل جدول */
.ktb-cart-qty-input {
  width: 55px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-align: center;
}

.ktb-cart-btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s, transform 0.1s;
}

.ktb-cart-btn:active {
  transform: scale(0.96);
}

.ktb-cart-btn-update {
  background-color: var(--secondary-color);
  color: var(--white);
}

.ktb-cart-btn-update:hover {
  background-color: #35b0b6;
}

.ktb-cart-btn-remove {
  background-color: var(--accent-color);
  color: var(--white);
}

.ktb-cart-btn-remove:hover {
  background-color: #cc2a36;
}

.ktb-cart-total-row {
  background-color: var(--bg-light);
  font-weight: bold;
  font-size: 1.05rem;
}

/* بخش دکمه‌های هدایت پایانی */
.ktb-cart-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  gap: 15px;
}

.ktb-cart-btn-continue {
  padding: 12px 24px;
  background-color: transparent;
  color: var(--text-gray);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.2s;
}

.ktb-cart-btn-continue:hover {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

.ktb-cart-btn-checkout {
  padding: 12px 28px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(230, 57, 70, 0.2);
  transition: all 0.2s;
}



/* استایل سبد خرید خالی */
.ktb-cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-gray);
  font-size: 1.1rem;
}
/* ================= Fix for Category/Search Products Grid ================= */
.ktb-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 25px;
  margin: 30px auto;
  width: 100%;
}

/* هماهنگ‌سازی دکمه افزودن به سبد خرید در این گرید */
.ktb-products-grid .product-card {
  flex: none; /* غیرفعال کردن ساختار اسلایدر قدیمی */
  width: 100%;
  height: 100%;
}
/* ================= Fix for Category Product Grid (boardgames.php) ================= */
.cat-container {
  max-width: 1200px;
  width: 90%;
  margin: 40px auto;
  padding: 0 15px;
}

.cat-header-title {
  font-size: 1.8rem;
  color: var(--primary-color);
  margin-bottom: 30px;
  position: relative;
  padding-bottom: 10px;
}

.cat-header-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 60px;
  height: 3px;
  background-color: var(--secondary-color);
  border-radius: 2px;
}

/* اصلاح گرید اصلی برای چیدمان محصولات در کنار هم */
.cat-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 25px;
  width: 100%;
  margin-top: 20px;
}

/* استایل‌دهی دقیق کارت‌ها برای هم‌تراز شدن دکمه‌ها و عکس‌ها */
.cat-product-card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%;
}

.cat-product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
}

.cat-product-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.cat-product-image {
  width: 100%;
  height: 240px;
  object-fit: contain;
  background-color: #fcfcfc;
  padding: 15px;
  border-bottom: 1px solid #f0f0f2;
}

.cat-product-title {
  font-size: 1.1rem;
  margin: 15px;
  color: var(--text-dark);
  font-weight: bold;
  line-height: 1.4;
  /* جلوگیری از به هم ریختن کارت‌ها در عناوین طولانی */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cat-product-footer {
  padding: 15px;
  margin-top: auto; /* چسباندن قیمت و دکمه به کف کارت */
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cat-product-price {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--primary-color);
  text-align: left;
  margin: 0;
}

.cat-add-to-cart-btn {
  width: 100%;
  background-color: var(--primary-color);
  padding: 10px;
  font-family: inherit;
  font-weight: bold;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cat-product-card:hover .cat-add-to-cart-btn {
  background-color: var(--secondary-color);
  color: var(--white);
}

/* ریسپانسیو سازی برای گوشی‌های همراه */
@media (max-width: 576px) {
  .cat-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }
  .cat-product-image {
    height: 160px;
  }
  .cat-product-title, .cat-product-price {
    font-size: 0.95rem;
  }
}
/* ================= Two-Column Checkout Styling ================= */
.ktb-checkout-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  margin-top: 30px;
}

.ktb-checkout-main {
  flex: 2.2;
  min-width: 0;
}

.ktb-checkout-sidebar {
  flex: 1.1;
  position: sticky;
  top: 110px; /* ثابت ماندن فاکتور هنگام اسکرول صفحه */
}

/* باکس فرم اطلاعات ارسال */
.checkout-form-box {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.checkout-form-fields {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-weight: bold;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  background-color: #fafafa;
  transition: all 0.2s;
}

.form-group input[name="phone"],
.form-group input[name="postal_code"] {
  text-align: left;
  direction: ltr;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(21, 58, 127, 0.08);
}

/* استایل باکس فاکتور سمت چپ */
.invoice-box {
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 22px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.invoice-box h3 {
  font-size: 1.15rem;
  color: var(--primary-color);
  margin-bottom: 15px;
}

.invoice-box hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 15px 0;
}

.invoice-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.invoice-row.discount-row {
  color: var(--accent-color);
  font-weight: bold;
}

.shipping-free {
  color: #2ec4b6;
  font-weight: bold;
}

.invoice-row.total-row {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
}

/* بخش فرم کد تخفیف داخل فاکتور */
.coupon-section {
  margin-top: 20px;
  background-color: var(--bg-light);
  padding: 12px;
  border-radius: 8px;
}

.coupon-form {
  display: flex;
  gap: 8px;
}

.coupon-form input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.coupon-form button {
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.coupon-form button:hover {
  background-color: #0d2b63;
}

.coupon-msg {
  font-size: 0.8rem;
  margin-top: 8px;
  font-weight: bold;
}

.coupon-msg.error-msg {
  color: var(--accent-color);
}

.coupon-msg.success-msg {
  color: #2ec4b6;
}

/* دکمه اصلی ثبت نهایی سفارش */
.ktb-cart-btn-checkout-submit {
  display: block;
  width: 100%;
  padding: 14px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  margin-top: 20px;
  box-shadow: 0 4px 10px rgba(21, 58, 127, 0.2);
  transition: background 0.2s, transform 0.1s;
}

.ktb-cart-btn-checkout-submit:hover {
  background-color: #0d2b63;
}

.ktb-cart-btn-checkout-submit:active {
  transform: scale(0.98);
}

.back-to-cart-wrapper {
  text-align: center;
  margin-top: 15px;
}

.back-to-cart-wrapper a {
  color: var(--text-gray);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s;
}

.back-to-cart-wrapper a:hover {
  color: var(--text-dark);
}

/* کاملاً ریسپانسیو برای تبلت و موبایل */
@media (max-width: 992px) {
  .ktb-checkout-layout {
    flex-direction: column;
  }
  .ktb-checkout-sidebar {
    width: 100%;
    position: static;
  }
}
/* ==========================================================================
   User Dashboard Section (Single Page Layout)
   ========================================================================== */

/* کانتینر اصلی داشبورد */
.ktb-dashboard-container {
  max-width: 1300px;
  width: 100%;
  margin: 40px auto;
  padding: 0 15px;
}

/* ساختار دو ستونه (منو و محتوا) */
.ktb-dashboard-layout {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

/* --- ستون سمت راست: سایدبار ناوبری --- */
.ktb-dashboard-sidebar {
  flex: 1;
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
  position: sticky;
  top: 110px; /* چسبیدن به بالای صفحه هنگام اسکرول */
  z-index: 10;
}

/* بخش آواتار و اطلاعات بالای سایدبار */
.user-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 25px;
}

.avatar-placeholder {
  width: 70px;
  height: 70px;
  background-color: var(--primary-color);
  color: var(--white);
  font-size: 1.8rem;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  box-shadow: 0 4px 8px rgba(21, 58, 127, 0.15);
}

.user-avatar-section h3 {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 5px;
  font-weight: bold;
}

.user-avatar-section p {
  font-size: 0.8rem;
  color: var(--text-gray);
  direction: ltr;
}

/* منوی گزینه‌های داشبورد */
.dashboard-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.95rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background-color: var(--bg-light);
  color: var(--primary-color);
}

/* استایل تب فعال (انتخاب شده) */
.menu-item.active {
  background-color: rgba(21, 58, 127, 0.07);
  color: var(--primary-color);
  font-weight: bold;
}

.menu-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 15px 0;
}

/* دکمه خروج */
.menu-item.logout-item {
  color: var(--accent-color);
}

.menu-item.logout-item:hover {
  background-color: rgba(230, 57, 70, 0.06);
}


/* --- ستون سمت چپ: محتوای اصلی داشبورد --- */
.ktb-dashboard-main {
  flex: 3;
  min-width: 0; /* جلوگیری از بیرون زدن المان‌ها در جداول بزرگ */
}

/* پیام‌های سیستم (موفقیت و خطا) */
.dashboard-alert {
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 25px;
  font-size: 0.9rem;
  font-weight: bold;
  line-height: 1.6;
}

.alert-success {
  background-color: rgba(46, 196, 182, 0.12);
  color: #1ba094;
  border: 1px solid rgba(46, 196, 182, 0.3);
}

.alert-danger {
  background-color: rgba(230, 57, 70, 0.12);
  color: var(--accent-color);
  border: 1px solid rgba(230, 57, 70, 0.25);
}

/* کارت‌های آمار و گزارشات (پیشخوان) */
.dashboard-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 25px;
}

.stat-card {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.01);
}

.stat-info h4 {
  font-size: 0.85rem;
  color: var(--text-gray);
  margin-bottom: 5px;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-dark);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* باکس‌های سفید پس‌زمینه محتوا */
.dashboard-box {
  background-color: var(--white);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.01);
}

.box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.box-header h3 {
  font-size: 1.1rem;
  color: var(--primary-color);
  font-weight: bold;
}

.box-link {
  font-size: 0.85rem;
  color: var(--secondary-color);
  text-decoration: none;
  font-weight: bold;
}

.box-link:hover {
  text-decoration: underline;
}

/* گرید نمایش اطلاعات خلاصه کاربری */
.user-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-item span {
  font-size: 0.85rem;
  color: var(--text-gray);
}

.detail-item strong {
  font-size: 0.95rem;
  color: var(--text-dark);
}


/* --- فرم‌ها و فیلدهای ورودی داخل داشبورد --- */
.dashboard-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.dashboard-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-form label {
  font-size: 0.9rem;
  font-weight: bold;
  color: var(--text-dark);
}

.dashboard-form input[type="text"],
.dashboard-form input[type="password"] {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  background-color: #fafafa;
  transition: all 0.2s ease;
}

.dashboard-form input:focus {
  border-color: var(--primary-color);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(21, 58, 127, 0.08);
}

/* دکمه‌های ثبت فرم */
.dashboard-btn-submit {
  align-self: flex-start;
  padding: 12px 25px;
  background-color: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s, transform 0.1s;
}

.dashboard-btn-submit:hover {
  background-color: #0d2b63;
}

.dashboard-btn-submit.btn-accent {
  background-color: var(--accent-color);
}

.dashboard-btn-submit.btn-accent:hover {
  background-color: #cc2a36;
}

.dashboard-btn-submit:active {
  transform: scale(0.98);
}


/* --- جدول سوابق سفارشات داخل داشبورد --- */
.dashboard-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  text-align: center;
}

.dashboard-orders-table th {
  background-color: var(--bg-light);
  color: var(--text-dark);
  padding: 14px 10px;
  font-weight: bold;
}

.dashboard-orders-table td {
  padding: 15px 10px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-dark);
  vertical-align: middle;
}

/* نشان‌ها (Badges) برای وضعیت‌ها */
.badge {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: bold;
  display: inline-block;
}

.badge-success { background-color: rgba(46, 196, 182, 0.15); color: #2ec4b6; }
.badge-warning { background-color: rgba(255, 159, 67, 0.15); color: #ff9f43; }
.badge-danger { background-color: rgba(230, 57, 70, 0.15); color: var(--accent-color); }

/* دکمه عملیات جدول خریدها */
.table-btn {
  padding: 6px 14px;
  background-color: var(--primary-color);
  color: var(--white);
  border-radius: 6px;
  text-decoration: none;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.table-btn:hover { background-color: #0d2b63; }

/* کامپوننت عدم وجود سفارش */
.dashboard-empty-state {
  text-align: center;
  padding: 40px 10px;
  color: var(--text-gray);
}

.start-shopping-btn {
  display: inline-block;
  margin-top: 15px;
  padding: 10px 22px;
  background-color: var(--secondary-color);
  color: var(--white);
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.start-shopping-btn:hover {
  background-color: #35b0b6;
}


/* ==========================================================================
   Responsive Design (بروزرسانی برای تبلت و موبایل)
   ========================================================================== */

@media (max-width: 992px) {
  .ktb-dashboard-layout {
    flex-direction: column; /* چیدمان ستونی منو و محتوا در موبایل */
  }
  
  .ktb-dashboard-sidebar {
    width: 100%;
    position: static; /* غیرفعال شدن منوی ثابت در موبایل برای فضای بیشتر */
  }
}

@media (max-width: 576px) {
  .dashboard-btn-submit {
    width: 100%; /* دکمه ذخیره در موبایل تمام‌عرض می‌شود */
    text-align: center;
  }
  
  .dashboard-box {
    padding: 15px;
  }
}