/* Rep Locator Container */
.rep-locator-container {
  width: 100%;
  padding: 0 12px;
  margin: 0 auto;
}

/* Rep Locator Layout */
.rep-locator-layout {
  display: block;
  width: 100%;
}

.rep-locator-content {
  width: 100%;
}

/* Filters Area */
.rep-filters {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  margin-bottom: 2rem;
  position: relative;
}

.rep-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
  width: 300px;
}

.rep-filter-label {
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}

.rep-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  background-color: white;
  color: #374151;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  cursor: pointer;
  position: relative;
}

/* Ensure dropdown appears below */
.rep-select option {
  position: absolute;
  background-color: white;
  border: none;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Grid Layout */
.rep-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.rep-grid-empty {
  padding: 2rem;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 0.5rem;
  border: 1px solid #e5e7eb;
}

/* Individual Rep Card - CONSISTENT SPACING */
.rep-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  overflow: hidden;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease !important;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 210px; /* Ensure consistent minimum height */
}

.rep-card:hover {
  transform: translateY(-2px) !important;
  box-shadow:
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

.rep-card-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* HEADER SECTION - Fixed height area */
.rep-card-header {
  min-height: 3rem; /* Reduced from 5rem */
  margin-bottom: 1.4rem; /* Reduced from 1.5rem for tighter spacing */
}

/* CONSISTENT TITLE SPACING */
.rep-card-title {
  margin: 0 0 0.75rem 0;
  color: #111827;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
}

/* CONSISTENT SUBTITLE SPACING */
.rep-card-subtitle {
  color: #6b7280;
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.4;
}

.rep-location {
  display: inline-block;
  margin-left: 0.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid #e5e7eb;
}

/* CONTACT DETAILS - Aligned to bottom */
.rep-card-details {
  color: #6b7280;
  margin-top: auto; /* Push to bottom - industry standard approach */
  display: flex;
  flex-direction: column;
}

/* CONSISTENT CONTACT ITEM SPACING */
.rep-contact-item {
  display: flex;
  align-items: flex-start; /* Align to top for multi-line content */
  gap: 0.75rem;
  margin-bottom: 0.875rem; /* Consistent spacing between items */
  min-height: 1.25rem; /* Ensure consistent item height */
}

.rep-contact-item:last-child {
  margin-bottom: 0; /* Remove margin from last item */
}

.rep-contact-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: #f2562c;
  flex-shrink: 0;
  margin-top: 0.125rem; /* Slight adjustment for better alignment */
}

.rep-contact-link,
.rep-contact-text {
  color: #4b5563;
  font-size: 0.875rem;
  line-height: 1.5;
  text-decoration: none !important;
  font-weight: 400;
  font-family: inherit;
  font-style: normal;
  word-break: break-word;
  transition: color 0.2s ease !important;
  margin: 0; /* Remove any default margins */
}

.rep-contact-link:hover {
  color: #f2562c !important;
  text-decoration: underline !important;
}

/* ADDRESS SPECIFIC STYLING - for multi-line addresses */
.rep-contact-item .rep-contact-text {
  line-height: 1.4; /* Tighter line height for addresses */
}

/* Responsive Design */
@media (max-width: 1200px) {
  .rep-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rep-filter-group {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 768px) {
  .rep-locator-container {
    padding: 0.75rem;
  }

  .rep-cards-grid {
    grid-template-columns: 1fr;
  }

  .rep-filters {
    flex-direction: column;
    gap: 1rem;
  }

  .rep-filter-group {
    width: 100%;
    max-width: none;
  }

  .rep-card-title {
    font-size: 1.125rem;
  }

  .rep-card {
    min-height: auto; /* Allow more flexible height on mobile */
  }
}
