/**
 * PHILO Store Location Styles
 * Professional styling for the store location widget
 */

/* Force CSS specificity to override theme styles */
.elementor-widget-philo_store_location .philo-store-location-container,
.philo-store-location-container {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 20px 0;
}

/* Font Awesome Icon Fallbacks */
.elementor-widget-philo_store_location .fas,
.elementor-widget-philo_store_location .far,
.elementor-widget-philo_store_location .fab,
.philo-store-location-container .fas,
.philo-store-location-container .far,
.philo-store-location-container .fab {
  font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro",
    "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome" !important;
  font-weight: 900 !important;
  font-style: normal !important;
  font-variant: normal !important;
  text-rendering: auto !important;
  line-height: 1 !important;
  -webkit-font-smoothing: antialiased !important;
  -moz-osx-font-smoothing: grayscale !important;
}

/* Icon fallback text if Font Awesome fails */
.elementor-widget-philo_store_location .fa-map-marker-alt:before,
.philo-store-location-container .fa-map-marker-alt:before {
  content: "📍" !important;
}

.elementor-widget-philo_store_location .fa-phone:before,
.philo-store-location-container .fa-phone:before {
  content: "📞" !important;
}

.elementor-widget-philo_store_location .fa-clock:before,
.philo-store-location-container .fa-clock:before {
  content: "🕐" !important;
}

.elementor-widget-philo_store_location .fa-envelope:before,
.philo-store-location-container .fa-envelope:before {
  content: "✉️" !important;
}

.elementor-widget-philo_store_location .fa-globe:before,
.philo-store-location-container .fa-globe:before {
  content: "🌐" !important;
}

.elementor-widget-philo_store_location .fa-search:before,
.philo-store-location-container .fa-search:before {
  content: "🔍" !important;
}

.elementor-widget-philo_store_location .fa-info-circle:before,
.philo-store-location-container .fa-info-circle:before {
  content: "ℹ️" !important;
}

.elementor-widget-philo_store_location .fa-location-arrow:before,
.philo-store-location-container .fa-location-arrow:before {
  content: "🧭" !important;
}

/* Filters */
.elementor-widget-philo_store_location .philo-store-filters,
.philo-store-filters {
  background: #f8f9fa !important;
  padding: 20px !important;
  border-bottom: 1px solid #e9ecef !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
}

.philo-search-container {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.philo-search-input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  color: #495057;
  transition: all 0.3s ease;
}

.philo-search-input:focus {
  outline: none;
  border-color: #001338;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.philo-search-icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #6c757d;
  font-size: 16px;
  pointer-events: none;
}

.philo-filter-row {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
}

.philo-filter-select {
  padding: 10px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #ffffff;
  font-size: 14px;
  color: #495057;
  min-width: 200px;
  transition: all 0.3s ease;
}

.philo-filter-select:focus {
  outline: none;
  border-color: #001338;
  box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

/* Layout */
.philo-store-layout {
  display: flex;
  min-height: 500px;
}

/* Store List */
.philo-store-list {
  background: #ffffff;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
}

.philo-store-list-header {
  background: #f8f9fa;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.philo-store-list-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #212529;
}

.philo-store-count {
  background: #001338;
  color: #ffffff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.philo-store-list-content {
  flex: 1;
  overflow-y: auto;
  max-height: 500px;
}

/* Store Items */
.philo-store-item {
  padding: 20px;
  border-bottom: 1px solid #f1f3f4;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  gap: 15px;
  flex-direction: row;
  align-items: flex-start;
}

.philo-store-item:hover {
  background: #f8f9fa;
}

/* Store item visibility states */
.philo-store-item.hidden {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

.philo-store-item.visible {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  overflow: visible !important;
  margin: 0 !important;
  padding: 20px !important;
  border-bottom: 1px solid #f1f3f4 !important;
}

.philo-store-item.highlighted {
  background: #e3f2fd;
  border-left: 4px solid #001338;
}

.philo-store-thumb {
  flex-shrink: 0;
  width: 30%;
  height: 100%;
  overflow: hidden;
}

.philo-store-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.philo-store-info {
  flex: 1;
  width: 70%;
}

.philo-store-title {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.philo-store-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.philo-store-title a:hover {
  color: #001338;
}

.philo-store-address,
.philo-store-phone,
.philo-store-hours {
  margin: 4px 0;
  font-size: 13px;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.philo-store-phone a {
  color: inherit;
  text-decoration: none;
}

.philo-store-phone a:hover {
  color: #001338;
}

.philo-store-description {
  margin: 8px 0 0 0;
  font-size: 13px;
  color: #6c757d;
  line-height: 1.4;
}

/* No Stores Message */
.philo-no-stores {
  padding: 40px 20px;
  text-align: center;
  color: #6c757d;
}

.philo-no-stores p {
  margin: 0;
  font-size: 14px;
}

/* Map */
.philo-store-map {
  background: #f8f9fa;
  position: relative;
}

#philo-store-map-container {
  width: 100%;
  height: 100%;
  min-height: 500px;
}

/* Map Popup Styles */
.philo-store-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  width: 35rem;
  height: fit-content;
}

.philo-store-popup .leaflet-popup-content {
  margin: 0;
  padding: 0;
  width: 100% !important;
}

.philo-popup-content {
  padding: 0;
  display: flex;
  overflow: hidden;
  flex-direction: row;
  border-radius: 12px;
}

.philo-popup-image {
  width: 100%;
  height: auto;
  overflow: hidden;
}

.philo-popup-image img {
  width: 100%;
  height: 100% !important;
  object-fit: cover;
}

.philo-popup-info {
  padding: 15px;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
}

.philo-popup-title {
  margin: 0 0 10px 0;
  font-size: 16px;
  font-weight: 600;
  color: #212529;
}

.philo-popup-address,
.philo-popup-phone,
.philo-popup-email,
.philo-popup-website,
.philo-store-group-link a {
  margin: 5px 0 !important;
  font-size: 13px;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 8px;
}

.philo-popup-address i,
.philo-popup-phone i,
.philo-popup-email i,
.philo-popup-website i,
.philo-popup-hours i,
.philo-store-address i,
.philo-store-phone i,
.philo-store-hours i,
.philo-store-group-link i {
  font-size: 14px !important;
  display: block !important;
  color: #001338 !important;
}

.philo-store-group-link,
.philo-store-group-link p {
  display: flex;
  gap: 20px;
}

.philo-popup-phone a,
.philo-popup-email a,
.philo-popup-website a {
  color: inherit;
  text-decoration: none;
  width: 100%;
}

.philo-popup-phone a:hover,
.philo-popup-email a:hover,
.philo-popup-website a:hover {
  color: #001338;
}

.philo-popup-description {
  margin: 10px 0;
  font-size: 13px;
  color: #6c757d;
  line-height: 1.4;
}

.philo-popup-actions {
  width: 100%;
  display: flex;
  flex-direction: row;
  gap: 20px;
}

.philo-popup-link,
.philo-popup-direction {
  display: inline-block;
  background: #001338;
  color: #ffffff !important;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  transition: background 0.3s ease;
}

.philo-popup-link:hover,
.philo-popup-direction:hover {
  background: #005a87;
  color: #ffffff;
}

/* Responsive Design */
@media (max-width: 768px) {
  .philo-store-layout {
    flex-direction: column;
  }

  .philo-store-list,
  .philo-store-map {
    width: 100% !important;
  }

  .philo-store-list {
    border-right: none;
    border-bottom: 1px solid #e9ecef;
  }

  .philo-store-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .philo-filter-select {
    min-width: auto;
    width: 100%;
  }

  .philo-store-item {
    flex-direction: column;
    text-align: center;
  }

  .philo-store-thumb {
    width: 100%;
    height: 120px;
    margin: 0 auto 15px;
  }

  .philo-store-list-content {
    max-height: 300px;
  }

  #philo-store-map-container {
    min-height: 300px;
  }
}

@media (max-width: 480px) {
  .philo-store-location-container {
    margin: 10px 0;
    border-radius: 8px;
  }

  .philo-store-filters {
    padding: 15px;
  }

  .philo-store-list-header {
    padding: 15px;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .philo-store-item {
    padding: 15px;
  }

  .philo-store-thumb {
    height: 100px;
  }
}

/* Loading States */
.philo-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px;
  color: #6c757d;
}

.philo-loading::before {
  content: "";
  width: 20px;
  height: 20px;
  border: 2px solid #e9ecef;
  border-top: 2px solid #001338;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Custom Scrollbar */
.philo-store-list-content::-webkit-scrollbar {
  width: 6px;
}

.philo-store-list-content::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.philo-store-list-content::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.philo-store-list-content::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}
