/* representatives-styles.css — استایل اختصاصی صفحه نمایندگان
   منو، فوتر، دکمه‌ها، سکشن‌ها و شمارنده‌ها از styles.css / menu-styles.css / home-styles.css می‌آیند */

/* ========== Hero ========== */
/* هیروی این صفحه از کلاس‌های .hero-section/.hero-content/.hero-image/.hero-video
   در home-styles.css می‌آید (هم‌سبک صفحهٔ اصلی) — استایل اختصاصی لازم ندارد. */

/* ========== Filter ========== */
.filter-section {
  background-color: #f8f9fa;
  padding: 50px 0;
  border-bottom: 1px solid #eaeaea;
}

.filter-wrapper {
  max-width: 1000px;
  margin: 0 auto;
}

.search-box {
  position: relative;
  margin-bottom: 25px;
}

.search-box i {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #888;
}

.search-box input {
  width: 100%;
  padding: 15px 50px 15px 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 50px;
  color: #333;
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.3s ease;
}

.search-box input:focus {
  outline: none;
  border-color: #1a5f8a;
  box-shadow: 0 0 0 3px rgba(26, 95, 138, 0.15);
}

.filter-options {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  flex: 1;
  min-width: 200px;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #333;
  font-weight: 500;
  font-size: 0.9rem;
}

.filter-group label i {
  color: #1a5f8a;
}

.filter-select {
  width: 100%;
  padding: 12px 15px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #333;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: #1a5f8a;
}

.reset-btn {
  background-color: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 12px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-family: inherit;
  transition: all 0.3s ease;
}

.reset-btn:hover {
  border-color: #1a5f8a;
  color: #1a5f8a;
  background-color: rgba(26, 95, 138, 0.06);
}

/* ========== Representatives Grid ========== */
.representatives-section {
  padding: 80px 0;
  background-color: #fff;
}

.representatives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.representative-card {
  background-color: #fff;
  border-radius: 15px;
  border: 1px solid #eaeaea;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  padding: 25px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.representative-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border-color: #1a5f8a;
}

.rep-header {
  display: flex;
  align-items: center;
  gap: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #f0f0f0;
}

/* آواتار با حرف اول نام — بدون وابستگی به سرویس عکس خارجی */
.rep-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  background-color: #1a5f8a;
}

.rep-avatar-lg {
  width: 80px;
  height: 80px;
  font-size: 2rem;
}

/* حالت عکس‌دار */
.rep-avatar-photo {
  overflow: hidden;
  border: 3px solid #1a5f8a;
  background-color: #f0f0f0;
}

.rep-avatar-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rep-avatar-photo.rep-type-sales       { border-color: #1a5f8a; }
.rep-avatar-photo.rep-type-technical   { border-color: #0f7a6c; }
.rep-avatar-photo.rep-type-service     { border-color: #8a6d1a; }
.rep-avatar-photo.rep-type-distributor { border-color: #5a3d8a; }

.rep-avatar.rep-type-sales       { background-color: #1a5f8a; }
.rep-avatar.rep-type-technical   { background-color: #0f7a6c; }
.rep-avatar.rep-type-service     { background-color: #8a6d1a; }
.rep-avatar.rep-type-distributor { background-color: #5a3d8a; }

.rep-info h3 {
  font-size: 1.2rem;
  color: #333;
  margin-bottom: 6px;
}

.rep-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 5px;
}

.rep-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
}

.rep-badge.rep-type-sales       { background-color: rgba(26, 95, 138, 0.1);  color: #1a5f8a; }
.rep-badge.rep-type-technical   { background-color: rgba(15, 122, 108, 0.1); color: #0f7a6c; }
.rep-badge.rep-type-service     { background-color: rgba(138, 109, 26, 0.1); color: #8a6d1a; }
.rep-badge.rep-type-distributor { background-color: rgba(90, 61, 138, 0.1);  color: #5a3d8a; }

.rep-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: #666;
  font-size: 0.9rem;
  line-height: 1.5;
}

.detail-item i {
  color: #1a5f8a;
  width: 18px;
  margin-top: 4px;
  flex-shrink: 0;
}

.rep-actions {
  display: flex;
  gap: 10px;
}

.rep-actions .btn {
  flex: 1;
  padding: 10px;
  font-size: 0.9rem;
}

.btn-nav {
  background-color: #0f7a6c;
  color: #fff;
  border-color: #0f7a6c;
  text-decoration: none;
}

.btn-nav:hover {
  background-color: #0a5e53;
  border-color: #0a5e53;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 122, 108, 0.3);
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  background-color: #f8f9fa;
  border-radius: 15px;
  border: 2px dashed #ddd;
  margin-top: 30px;
}

.no-results i {
  font-size: 3rem;
  color: #aaa;
  margin-bottom: 20px;
}

.no-results h3 {
  color: #333;
  margin-bottom: 10px;
}

.no-results p {
  color: #666;
}

/* ========== Map ========== */
.map-section {
  padding: 80px 0;
  background-color: #f8f9fa;
}

.map-container {
  height: 480px;
}

#iranMap {
  width: 100%;
  height: 100%;
  border-radius: 15px;
  overflow: hidden;
  border: 1px solid #ddd;
  background-color: #fff;
  z-index: 1;
}

.map-popup {
  font-family: 'Vazirmatn', sans-serif;
  text-align: right;
  direction: rtl;
  min-width: 150px;
}

.map-popup strong {
  display: block;
  margin-bottom: 4px;
  color: #333;
}

.map-popup-type {
  color: #1a5f8a;
  font-size: 0.85rem;
}

/* ========== Become Representative ========== */
.become-representative-section {
  padding: 80px 0;
  background-color: #fff;
}

.requirements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 25px;
  margin: 40px 0;
}

.requirement-item {
  background-color: #f8f9fa;
  border: 1px solid #eaeaea;
  border-radius: 15px;
  padding: 30px 22px;
  text-align: center;
  transition: all 0.3s ease;
}

.requirement-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  border-color: #1a5f8a;
}

.requirement-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 18px;
  background-color: rgba(26, 95, 138, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a5f8a;
  font-size: 1.5rem;
}

.requirement-item h4 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.1rem;
}

.requirement-item p {
  color: #666;
  font-size: 0.92rem;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ========== FAQ ========== */
.faq-section {
  padding: 80px 0;
  background-color: #f8f9fa;
}

.faq-container {
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background-color: #fff;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 1px solid #eaeaea;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.faq-question {
  width: 100%;
  padding: 20px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  cursor: pointer;
  background: none;
  border: none;
  text-align: right;
  font-family: inherit;
  transition: background-color 0.3s ease;
}

.faq-question:hover {
  background-color: rgba(26, 95, 138, 0.04);
}

.faq-question h4 {
  color: #333;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
}

.faq-question i {
  color: #1a5f8a;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-question i {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 25px;
}

.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 25px 22px;
}

.faq-answer p {
  color: #666;
  line-height: 1.7;
}

/* ========== Contact Form ========== */
.rep-contact-section {
  padding: 80px 0;
  background-color: #fff;
}

.rep-contact-form {
  max-width: 760px;
  margin: 0 auto;
  background-color: #f8f9fa;
  padding: 35px;
  border-radius: 15px;
  border: 1px solid #eaeaea;
}

/* honeypot - مخفی از کاربر، قابل دیدن برای ربات‌ها */
.hp-field {
  position: absolute;
  right: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  color: #333;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #1a5f8a;
  box-shadow: 0 0 0 3px rgba(26, 95, 138, 0.12);
}

.form-group textarea {
  resize: vertical;
  min-height: 130px;
}

.form-status {
  margin-bottom: 18px;
  padding: 0;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.6;
}

.form-status.success {
  background-color: rgba(15, 122, 108, 0.1);
  color: #0f7a6c;
  padding: 14px 18px;
  border: 1px solid rgba(15, 122, 108, 0.3);
}

.form-status.error {
  background-color: rgba(198, 40, 40, 0.08);
  color: #c62828;
  padding: 14px 18px;
  border: 1px solid rgba(198, 40, 40, 0.25);
}

.form-status.pending {
  background-color: rgba(26, 95, 138, 0.08);
  color: #1a5f8a;
  padding: 14px 18px;
  border: 1px solid rgba(26, 95, 138, 0.25);
}

.btn-block {
  width: 100%;
}

/* ========== Modal (جزئیات نماینده) ========== */
.rep-modal {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.rep-modal-content {
  background-color: #fff;
  border-radius: 15px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.rep-modal-header {
  padding: 20px 25px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-modal-header h3 {
  margin: 0;
  color: #333;
  font-size: 1.2rem;
}

.rep-modal-close {
  background: none;
  border: none;
  color: #888;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 5px;
  transition: color 0.2s ease;
}

.rep-modal-close:hover {
  color: #c62828;
}

.rep-modal-body {
  padding: 25px;
}

.rep-modal-profile {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.rep-modal-profile h4 {
  margin: 0 0 8px;
  color: #333;
  font-size: 1.2rem;
}

.rep-modal-services {
  background-color: #f8f9fa;
  padding: 18px;
  border-radius: 10px;
  margin-bottom: 22px;
}

.rep-modal-services h5 {
  color: #333;
  margin: 0 0 14px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rep-modal-services h5 i {
  color: #1a5f8a;
}

.rep-modal-services ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.rep-modal-services li {
  color: #555;
  font-size: 0.9rem;
  padding: 8px 12px;
  background-color: #fff;
  border-radius: 6px;
  border: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rep-modal-services li i {
  color: #0f7a6c;
  font-size: 0.8rem;
}

.rep-modal-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

.rep-modal-info-item {
  background-color: #f8f9fa;
  padding: 14px 16px;
  border-radius: 10px;
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
}

.rep-modal-info-item i {
  color: #1a5f8a;
  font-size: 1.1rem;
}

.rep-modal-info-label {
  color: #333;
  font-weight: 600;
  font-size: 0.9rem;
}

.rep-modal-info-value {
  color: #666;
  font-size: 0.9rem;
}

.rep-modal-actions {
  display: flex;
  gap: 10px;
}

/* ========== مودال واحدها (تماس برای اطلاعات بیشتر) ========== */
.units-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.unit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  background-color: #fafbfc;
  transition: all 0.25s ease;
}

.unit-item:hover {
  border-color: #1a5f8a;
  box-shadow: 0 4px 14px rgba(26, 95, 138, 0.08);
}

.unit-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.unit-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background-color: rgba(26, 95, 138, 0.1);
  color: #1a5f8a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.unit-name {
  font-weight: 600;
  color: #333;
  font-size: 0.98rem;
}

.unit-call {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 8px;
  background-color: #1a5f8a;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  direction: ltr;
}

.unit-call:hover {
  background-color: #124468;
}

.unit-call.disabled {
  background-color: #e6e8ea;
  color: #999;
  pointer-events: none;
}

.units-empty {
  text-align: center;
  color: #888;
  padding: 30px 10px;
}

.rep-modal-actions .btn {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
  text-decoration: none;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
  .map-container {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* فیلتر استان + نوع نمایندگی + دکمهٔ بازنشانی در موبایل تو یک ردیف */
  .filter-options {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: flex-end;
    gap: 10px;
  }

  .filter-group {
    min-width: 0;
    flex: 1 1 0;
  }

  .filter-group label {
    font-size: 0.78rem;
    gap: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .filter-select {
    padding: 11px 8px;
    font-size: 0.88rem;
  }

  .reset-btn {
    flex: 0 0 auto;
    padding: 11px 12px;
    white-space: nowrap;
  }

  .rep-modal-services ul {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  /* در نمایشگرهای خیلی کوچک، دکمهٔ بازنشانی فقط آیکون تا هر سه در یک ردیف جا شوند */
  .reset-btn .reset-btn-text {
    display: none;
  }

  .reset-btn {
    padding: 11px 13px;
  }
}

@media (max-width: 576px) {
  .representatives-grid {
    grid-template-columns: 1fr;
  }

  .rep-contact-form {
    padding: 22px;
  }

  /* دو دکمهٔ «ارسال درخواست نمایندگی» و «تماس برای اطلاعات بیشتر» در موبایل یک ردیف */
  .cta-buttons {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .cta-buttons .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 13px 8px;
    font-size: 0.86rem;
    justify-content: center;
    text-align: center;
    white-space: normal;
    line-height: 1.35;
  }

  .rep-modal-actions {
    flex-direction: column;
  }
}
