/* Reset و فونت‌ها */
@font-face {
  font-family: "Vazir";
  src: url("../fonts/Vazir.woff2") format("woff2"),
    url("../fonts/Vazir.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Vazir", sans-serif;
}

body {
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  color: #333;
  line-height: 1.6;
  direction: rtl;
}

/* طرح‌بندی اصلی */
.main-container {
  min-height: calc(100vh - 200px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px 0;
  position: relative;
}

/* طراحی شیشه‌ای */
.glass-container {
  background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 100%);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 32px 0 rgba(50, 40, 135, 0.3);
  padding: 40px;
  width: 100%;
  max-width: 600px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  /* z-index: 1; */
}

.glass-container:hover {
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.2);
}

.site-title {
  color: #30b3e2;
  font-size: 2.5rem;
  margin-bottom: 20px;
  text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.1);
}

.site-description {
  color: #05668a;
  margin-bottom: 30px;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
@media (max-width: 768px) {
  .site-title {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }
  .site-description {
    margin-bottom: 30px;
    font-size: 1rem;
  }
  .glass-container {
    padding: 25px;
  }
}

/* فرم جستجو */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.search-input-group {
  position: relative;
}

.search-input-group input,
.search-input-group select {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  color: #333;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.search-input-group input:focus,
.search-input-group select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* استایل دکمه پاک کردن */
.clear-input-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 15px;
  background: rgba(240, 239, 239, 0.959);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  color: #999;
  z-index: 2;
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.search-input-group input:focus + .clear-input-btn,
.search-input-group textarea:focus + .clear-input-btn {
  opacity: 1;
  pointer-events: auto;
}

.clear-input-btn:hover {
  background: rgba(245, 213, 213, 0.95);
  color: #333;
  transform: translateY(-50%) scale(1.1);
}

/* نمایش دکمه وقتی فیلد دارای محتواست */
.search-input-group input:not(:placeholder-shown) + .clear-input-btn,
.search-input-group textarea:not(:placeholder-shown) + .clear-input-btn {
  opacity: 1;
  pointer-events: auto;
}

.search-button {
  background-color: #30b3e2;
  color: white;
  border: none;
  padding: 15px;
  border-radius: 10px;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.search-button:hover {
  background-color: #2596be;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

#description {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  font-size: 1rem;
  color: #333;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  min-height: 40px;
  max-height: 120px;
  font-family: inherit;
  resize: vertical;
  overflow-y: auto;
}

#description:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
/* هماهنگسازی textarea با inputها */
.search-input-group textarea {
  font-family: "Vazir", sans-serif;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
}

/* تنظیم ارتفاع خودکار */
#description {
  height: auto;
}

/* استایل ستاره ها */
.rating {
  color: #ffc107;
  font-size: 1.2rem;
  margin: 5px 0;
}

.rating .empty-star {
  color: #ddd;
}

/* نتایج تکمیل خودکار */
.search-input-group {
  position: relative;
  margin-bottom: 15px;
}

.autocomplete-results {
  position: absolute;
  top: 100% !important;
  left: 0 !important;
  right: 0 !important;
  background: #e9e1b0 !important;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 10px 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 10000 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: none;
}

.autocomplete-results div {
  padding: 10px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  user-select: none;
}

.autocomplete-results div:hover {
  background-color: #a0fffa;
  color: rgb(0, 0, 0);
}

.autocomplete-results div:last-child {
  border-bottom: none;
}

/* استایل برای دکمه بستن */
.autocomplete-results .close-header {
  background: #f8f9fa;
  text-align: center;
  padding: 10px 15px;
  border-bottom: 2px solid #30b3e2;
  cursor: pointer;
  font-weight: bold;
  color: #666;
  font-size: 13px;
  user-select: none;
}

.autocomplete-results .close-header:hover {
  background: #f3aca4;
  color: white;
}

/* فوتر */
.main-footer {
  background-color: #2c3e50;
  color: #ecf0f1;
  padding: 40px 0 0 0;
  margin-top: 50px;
}

.footer-flex {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: flex-start;
  gap: 40px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

.footer-section {
  flex: 1 1 0;
  min-width: 180px;
}

.footer-right {
  text-align: right;
}
.footer-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.footer-left {
  text-align: left;
  direction: rtl;
}

.footer-about span,
.footer-quicklinks-title,
.footer-contact span,
.footer-ads span {
  color: #fff;
  font-size: 1.08rem;
  font-weight: bold;
}
.footer-about p {
  margin: 8px 0 0 0;
  color: #30b3e2;
  font-size: 1rem;
  font-weight: normal;
}

.footer-quicklinks {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.footer-quicklinks a {
  color: #30b3e2;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 1rem;
}
.footer-quicklinks a:hover {
  color: #2596be;
  text-decoration: underline;
}

.footer-contact {
  margin-top: 15px;
  margin-bottom: 15px;
}
.footer-contact a {
  color: #30b3e2;
  text-decoration: none;
  transition: color 0.3s;
}
.footer-contact a:hover {
  color: #2596be;
  text-decoration: underline;
}

.footer-ads {
  margin-top: 15px;
}

.copyright {
  text-align: center;
  padding-top: 20px;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 900px) {
  .footer-flex {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
    text-align: center;
    padding: 0 20px;
  }
  .footer-section {
    min-width: 0;
    margin-bottom: 10px;
  }
  .footer-right,
  .footer-left {
    text-align: center;
  }
}

.footer-section.footer-right,
.footer-section.footer-left {
  padding: 0;
  margin: 0;
  align-items: unset;
}

/* استایل هدر */
.sticky-header {
  position: sticky;
  top: 0;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  padding: 15px 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
@media (max-width: 768px) {
  .header-container {
    justify-content: space-between;
    padding: 0 30px;
  }

  .logo {
    margin-left: 0;
  }

  .nav-items {
    margin-left: 0;
  }
}
.logo a {
  font-size: 30px;
  font-weight: bold;
  color: #30b3e2;
  text-decoration: none;
}

.search-box {
  flex-grow: 1;
  margin: 0 30px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #eee;
  border-radius: 30px;
  font-size: 16px;
}

.search-box button {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #30b3e2;
}

.main-content {
  min-height: calc(100vh - 200px);
  padding: 30px 0;
}

/* استایل صفحه تماس */
.contact-container {
  max-width: 800px;
  margin: 30px auto;
  padding: 30px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

.contact-container h1 {
  color: #30b3e2;
  text-align: center;
  margin-bottom: 30px;
}

.contact-form {
  margin-bottom: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #555;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
}

.form-group textarea {
  min-height: 150px;
  resize: vertical;
}

.submit-btn {
  background: #30b3e2;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.submit-btn:hover {
  background: #2596be;
}

.contact-info {
  border-top: 1px solid #eee;
  padding-top: 30px;
}

.contact-info h2 {
  color: #30b3e2;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.info-item .icon {
  margin-left: 15px;
  font-size: 20px;
}

.alert {
  padding: 15px;
  margin-bottom: 20px;
  border-radius: 5px;
}

.alert.error {
  background: #ffebee;
  border: 1px solid #f44336;
  color: #f44336;
}

.alert.success {
  background: #e8f5e9;
  border: 1px solid #4caf50;
  color: #4caf50;
}

.combo-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
}

datalist {
  position: absolute;
  background-color: white;
  border: 1px solid #ddd;
  border-radius: 0 0 4px 4px;
  width: auto;
}

datalist option {
  padding: 8px;
  cursor: pointer;
}

datalist option:hover {
  background-color: #f5f5f5;
}

.ad-info {
  background: linear-gradient(
    135deg,
    rgba(48, 179, 226, 0.6),
    rgba(178, 235, 242, 0.5)
  );
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 24px 0 rgba(48, 179, 226, 0.15);
  padding: 18px 24px;
  margin: 24px 0 32px 0;
  text-align: center;
  color: #000000;
  font-size: 1.15rem;
  font-weight: bold;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25), 0 1px 0 #30b3e2;
  letter-spacing: 0.5px;
  /* اضافه کردن استایل استاندارد برای تبلیغات */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* استایل برای کانتینر تبلیغات */
.ad-container {
  width: 80%; /* کاهش ابعاد */
  max-width: 90%; /* کاهش ابعاد */
  margin: 0 auto 0;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  position: relative; /* برای موقعیت‌دهی نوشته تبلیغات */
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);  */
}

.ad-container img {
  width: 100%;
  height: auto;
  display: block;
  box-sizing: border-box;
  border-radius: 10px; /* کاهش شعاع گوشه‌ها */
}

/* استایل برای نوشته تبلیغات */
.ad-label {
  position: absolute;
  top: -10px; /* موقعیت گوشه بالا */
  right: -10px; /* موقعیت گوشه بالا */
  background-color: rgba(0, 0, 0, 0.7); /* پس‌زمینه نیمه‌شفاف */
  color: #fff; /* رنگ متن */
  padding: 5px 10px; /* فاصله داخلی */
  border-radius: 5px; /* گوشه‌های گرد */
  font-size: 0.9rem; /* اندازه فونت */
  font-weight: bold; /* ضخامت فونت */
  z-index: 10; /* بالاتر از تصویر */
}

/* استایل خاص برای تبلیغات در صفحه اصلی */
.main-container .ad-container {
  width: 50%; /* کاهش ابعاد */
  max-width: 50%; /* کاهش ابعاد */
  margin: 20px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.main-container .ad-container img {
  width: 100%;
  height: auto;
  margin: 0 auto;
}

@media (max-width: 768px) {
  .ad-container {
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* اطمینان از عدم ایجاد اسکرول افقی */
  .main-container .ad-container {
    max-width: 100vw;
    margin: 10px;
    overflow-x: hidden;
    width: 100%;
  }

  .main-container .ad-container img {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .ad-label {
    font-size: 0.8rem; /* کاهش اندازه فونت برای موبایل */
    padding: 4px 8px; /* کاهش فاصله داخلی */
    top: 0px; /* موقعیت گوشه بالا */
    right: 0px; /* موقعیت گوشه بالا */
  }
}

.messenger {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0 2px;
}

.messenger-icon {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-left: 2px;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}
.shop-count-card {
  margin: 32px auto 0 auto;
  max-width: 350px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 24px;
  font-size: 1.2em;
  color: #222;
  font-family: inherit;
  position: relative;
  /* z-index: 1; */
}

.shop-count-icon {
  font-size: 2.2em;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

.shop-count-number {
  font-weight: bold;
  font-size: 1.7em;
  color: #0077ff;
  display: block;
  margin: 0 auto;
  text-align: center;
}
/* دکمه شناور لیست خرید - فقط موبایل عمودی */
@media (max-width: 480px) {
  .fab-calculator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(8, 189, 205, 0.85); /* آبی فیروزه‌ای شیشه‌ای */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 30px;
    z-index: 9999;
    transition: transform 0.3s ease, background 0.3s ease;
    text-decoration: none;
    animation: shakeFab 10s ease-in-out infinite; /* دوره کامل ۱۰ ثانیه */
  }

  .fab-calculator:hover {
    background: rgba(6, 160, 175, 0.95);
    transform: scale(1.1);
  }
  /* انیمیشن بالا-پایین ملایم برای جلب توجه */
  @keyframes shakeFab {
    0%,
    100% {
      transform: translateX(0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
      transform: translateY(-4px);
    }
    20%,
    40%,
    60%,
    80% {
      transform: translateY(4px);
    }
  }
  #local-tooltip {
    position: fixed;
    bottom: 100px; /* فاصله از دکمه شناور */
    left: 20px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    max-width: 160px;
    text-align: center;
    z-index: 10000;
    transform: translateY(0);
    opacity: 1;
    transition: opacity 0.3s, transform 0.3s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }

  #local-tooltip::after {
    content: "";
    position: absolute;
    bottom: -8px;
    left: 24px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid rgba(0, 0, 0, 0.75);
  }
  #local-tooltip.hidden {
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
  }
  #local-tooltip .close-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #fff;
  }
}

/* استایل اعلان‌ها */
.alert {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  border-radius: 12px;
  background-color: #ef233c; /* رنگ خطر از calculator.php */
  color: white;
  font-weight: bold;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  z-index: 10000;
  transform: translateX(150%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
  display: flex;
  align-items: center;
  max-width: 300px;
}

.alert.show {
  transform: translateX(0);
}

.alert i {
  margin-left: 10px;
  font-size: 1.2em;
}
