:root {
  --hd-brand-color: #38a3a5; /* Mosque brand color */
  --hd-brand-color-hover: #2d888a; /* Slightly darker for hover states */
}


/* ===== Base Styles ===== */
.hd-bar-search,
/* Update the controls row */
.hd-bar-controls {
  display: flex;
  align-items: center; /* Vertically center items */
  gap: 10px;
  padding: 8px 16px;
  background: #fff;
  flex-wrap: nowrap; /* Prevent wrapping */
}

/* Make the category dropdown more compact */
#hd-category-filter {
  padding: 8px 12px;
  background: #fff;
  color: #404f60;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-weight: 600;
  min-width: 150px; /* Reduced from default */
  max-width: 320px; /* Prevent it from getting too wide */
  flex-shrink: 1; /* Allow it to shrink if needed */
}

/* Keep the button styles but adjust for single line */
.hd-adv-btn {
  padding: 8px 12px;
  background: #38a3a5;
  color: #fff;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  white-space: nowrap; /* Prevent text wrapping */
  flex-shrink: 0; /* Don't let the button shrink */
  transition: background 0.2s ease;
}

.hd-adv-btn:hover {
  background: #2d888a;
}

/* For mobile responsiveness */
@media (max-width: 768px) {
  .hd-bar-controls {
    flex-wrap: wrap; /* Allow wrapping on mobile */
  }
  
  #hd-category-filter {
    min-width: auto; /* Even more compact on mobile */
    flex-grow: 1; /* Take available space */
  }
  
  .hd-adv-btn {
    flex-grow: 1; /* Full width on mobile */
  }
}

/* Updated button styles */
.hd-bar-controls .hd-adv-btn {
  padding: 8px 12px;
  background: #38a3a5; /* Mosque brand color */
  color: #fff;
  border-radius: 4px;
  border: none;
  font-weight: 600;
  transition: background 0.2s ease; /* Smooth color transition */
}

.hd-bar-controls .hd-adv-btn:hover {
  background: #2d888a; /* Slightly darker shade for hover */
}

/* ===== Typography ===== */
.hd-section-title {
  margin: 24px 16px 8px;
  font-size: 1.25rem;
  color: #404f60;
}

/* ===== Card Styles ===== */
.hd-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 16px;
  position: relative;
  flex: 1 1 240px;
  max-width: 300px;
  min-width: 200px;
  transition: transform 0.2s ease, background 0.2s ease;
}

.hd-card:hover {
  transform: translateY(-4px);
  background: #f9f9fa;
}

/* Package tier indicators */
.hd-card::before {
  content: attr(data-tier);
  position: absolute;
  top: 8px;
  right: 8px;
  background: #404f60;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}

/* Package-specific colors */
.hd-card--elitepartner::before { background: #0a0a23; }
.hd-card--businessplus::before { background: #027373; }
.hd-card--professional::before { background: #3db54a; }
.hd-card--essentials::before   { background: #f7941e; }
.hd-card--listed::before       { background: #999; }

.hd-card--elitepartner   { border-top: 4px solid #0a0a23; }
.hd-card--businessplus   { border-top: 4px solid #027373; }
.hd-card--professional   { border-top: 4px solid #3db54a; }
.hd-card--essentials     { border-top: 4px solid #f7941e; }
.hd-card--listed         { border-top: 4px solid #999; }

/* ===== Card Content ===== */
.hd-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  margin-bottom: 12px;
}

.hd-text {
  width: 100%;
  text-align: left;
}

.hd-text h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.hd-text p {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 1rem;
  color: #666;
  line-height: 1.4;
}

.hd-icon {
  font-size: 1.2rem;
  color: #ef3f5a;
  flex-shrink: 0;
}

.hd-icon.dashicons-phone {
  transform: scaleX(-1);
}

/* ===== Buttons ===== */
.hd-view-details {
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  margin-top: 12px;
  transition: background 0.2s ease;
  width: 100%;
}

.hd-view-details:hover {
  background: #1d87be;
}

/* Buttons */
.hd-adv-btn {
  background: var(--hd-brand-color);
}
.hd-adv-btn:hover {
  background: var(--hd-brand-color-hover);
}

.hd-view-details {
  background: var(--hd-brand-color);
}
.hd-view-details:hover {
  background: var(--hd-brand-color-hover);
}

/* Verified badges */
.hd-verified-badge,
.hd-modal-content .hd-verified-badge {
  background: var(--hd-brand-color);
}

/* Modal close button (keeping red as it's a destructive action) */
#hd-modal-close {
  /* Keeping this red as it's a close action */
  background: #ef3f5a;
}

/* ===== Verified Badges ===== */
.hd-verified-badge {
  background: #27aae1;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 3px;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
}

/* ===== Layouts ===== */
.hd-carousel {
  display: flex;
  overflow-x: auto;
  gap: 16px;
  padding: 0 16px 16px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none; /* Hide scrollbar for Firefox */
}

.hd-carousel::-webkit-scrollbar {
  display: none; /* Hide scrollbar for Chrome/Safari */
}

.hd-carousel .hd-card {
  scroll-snap-align: center;
  flex: 0 0 auto;
}

.hd-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 0 16px 16px;
  justify-content: flex-start; 
}

/* ===== Modal Styles ===== */
#hd-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
}

.hd-modal-content {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90%;
  overflow: auto;
  margin: 5% auto;
  position: relative;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hd-modal-content img.hd-modal-logo {
  max-width: 120px;
  margin-bottom: 12px;
  border-radius: 8px;
}

.hd-modal-content h2 {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  font-size: 1.5rem;
  color: #404f60;
}

.hd-modal-content .hd-verified-badge {
  background: #27aae1;
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  margin-left: 8px;
  position: static;
  display: inline-block;
}

#hd-modal-close {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #ef3f5a;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

#hd-modal-close:hover {
  background: #d62e4a;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
  .hd-card {
    flex: 1 1 100%;
    max-width: 100%;
    min-width: 0;
  }
  
  .hd-carousel {
    flex-direction: column;
    overflow-x: visible;
    gap: 20px;
  }
  
  .hd-modal-content {
    padding: 16px;
    max-width: 95%;
    margin: 2% auto;
  }
  
  .hd-modal-content h2 {
    font-size: 1.3rem;
  }
}

/* Modal Content Styling */
.hd-modal-content .hd-info-line {
    margin: 0 0 12px;
    line-height: 1.6;
}

.hd-modal-content .dashicons {
    color: #38a3a5;
    margin-right: 8px;
    vertical-align: middle;
}

.hd-modal-content .hd-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Video Container */
.hd-video-container {
    margin: 20px 0;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.hd-video-container iframe,
.hd-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Map Container */
.hd-map-container {
    margin: 20px 0;
}

.hd-map-container iframe {
    width: 100%;
    height: 300px;
    border: none;
    border-radius: 8px;
}

/* Contact Form */
.hd-contact-form {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.hd-contact-form input,
.hd-contact-form textarea {
    width: 100%;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.hd-contact-form button {
    background: #38a3a5;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
}

/* Offer Badge */
.hd-offer-badge {
    background: #f7941e;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    font-weight: bold;
}

/* Gallery Styles */
.hd-gallery-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.hd-gallery-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.hd-gallery-image:hover {
    transform: scale(1.03);
}

/* Modal Gallery Styles */
.hd-modal-content .hd-gallery-images {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.hd-modal-content .hd-gallery-image {
    height: 120px;
}

/* Mobile View */
@media (max-width: 768px) {
    .hd-gallery-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .hd-modal-content .hd-gallery-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

.hd-map-container {
    margin: 10px 0 20px;
}
.hd-map-container iframe {
    width: 100%;
    height: 250px;
    border: none;
}
