/* Base styles and resets */

* {
  box-sizing: border-box;
}

:host {
  display: block;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  --primary-color: #4a6eb5;
  --secondary-color: #333333;
  --border-color: #e0e0e0;
  --hover-color: #f5f7fa;
  --selected-color: #e3eaf5;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --radius-sm: 4px;
  --radius-md: 8px;
  --transition-speed: 0.2s;
  --sidebar-width: 500px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--secondary-color);
}

.store-locator-container {
  display: flex;
  flex-direction: row;
  height: 600px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

/* Sidebar styles */
.sidebar {
  width: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color);
  background-color: #ffffff;
  z-index: 1;
}

.search-container {
  position: relative;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.search-input {
  width: 100%;
  padding: 10px 40px 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 16px;
  outline: none;
  transition: border-color var(--transition-speed);
}

.search-input:focus {
  border-color: var(--primary-color);
}

.search-button {
  position: absolute;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 5px;
  cursor: pointer;
  color: var(--secondary-color);
}

.search-button:hover {
  color: var(--primary-color);
}

.filters-container {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.filter-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background-color: #f5f7fa;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--transition-speed);
  flex: 1;
  margin-right: 10px;
}

.filter-toggle:hover {
  background-color: #e9eef5;
}

.filter-toggle .chevron {
  transition: transform var(--transition-speed);
}

.filter-toggle[aria-expanded="true"] .chevron {
  transform: rotate(180deg);
}

.sort-container {
  display: flex;
  align-items: center;
  font-size: 14px;
}

.sort-container label {
  margin-right: 6px;
  white-space: nowrap;
}

.sort-select {
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background-color: #ffffff;
  width: 100%;
}

.filter-options {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background-color: #ffffff;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-group h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
  font-size: 14px;
}

.filter-checkbox input {
  margin-right: 8px;
}

.filter-select {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  background-color: #ffffff;
}

.filter-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.apply-filters-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background-color: var(--primary-color);
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  color: white;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.reset-filters-btn {
  display: block;
  width: 100%;
  padding: 8px 12px;
  background-color: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.reset-filters-btn:hover {
  background-color: var(--hover-color);
}

.apply-filters-btn:hover {
  background-color: var(--hover-color);
}

.locations-list {
  flex: 1;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #d0d0d0 #f5f5f5;
}

.locations-list::-webkit-scrollbar {
  width: 8px;
}

.locations-list::-webkit-scrollbar-track {
  background: #f5f5f5;
}

.locations-list::-webkit-scrollbar-thumb {
  background-color: #d0d0d0;
  border-radius: 4px;
}

.location-card {
  display: flex;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color var(--transition-speed);
}

.location-card:hover {
  background-color: var(--hover-color);
}

.location-card:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: -2px;
}

.location-card.selected {
  background-color: var(--selected-color);
}

.location-image {
  flex-shrink: 0;
  margin-right: 12px;
}

.location-image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.location-info {
  flex: 1;
  min-width: 0;
}

.location-website a {
  color: currentColor;
}

.location-name {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-color);
}

.location-meta {
  display: flex;
  margin-bottom: 6px;
  gap: 12px;
  font-size: 14px;
}

.location-distance {
  color: #666;
}

.location-rating {
  color: #f5a623;
  font-weight: 500;
}

.location-description {
  margin: 0 0 8px 0;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.location-details {
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
  font-size: 14px;
}

.location-phone a {
  color: var(--primary-color);
  text-decoration: none;
}

.location-phone a:hover {
  text-decoration: underline;
}

.location-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.feature-tag {
  font-size: 12px;
  padding: 2px 6px;
  background-color: #f0f4f9;
  border-radius: 12px;
  color: var(--primary-color);
}

.loading-indicator {
  padding: 12px;
  text-align: center;
  font-size: 14px;
  color: var(--secondary-color);
  background-color: #f9f9f9;
  font-weight: 500;
}

.no-results {
  padding: 20px;
  text-align: center;
  color: var(--secondary-color);
  font-style: italic;
}

/* Map styles */
.map-container {
  flex: 1;
  position: relative;
}

.map {
  width: 100%;
  height: 100%;
}

/* Map overlay styling */

.map-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  pointer-events: none;
}

/* Zoom in window styling */

.zoom-in-window {
  position: absolute;
  top: 45%;
  color: white;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 16px;
  border-radius: var(--radius-md);
  z-index: 1000;
  pointer-events: none;
}

/* Info window styling */
.gm-style .gm-style-iw-c {
  padding: 16px;
  max-width: 350px !important;
}

.info-window {
  font-family: inherit;
}

.info-window-header {
  margin-bottom: 12px;
}

.info-window h3 {
  margin: 0 0 8px 0;
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
}

.info-window a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

.info-window a:hover {
  text-decoration: underline;
}

.info-window-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.info-window-image {
  margin: 12px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.info-window-image img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.info-window-caption {
  margin-top: 6px;
  font-size: 13px;
  color: var(--secondary-color);
  line-height: 1.4;
}

.info-window-content {
  margin: 12px 0;
}

.info-window-address {
  font-style: normal;
  font-size: 14px;
  color: var(--secondary-color);
  margin-bottom: 8px;
  line-height: 1.4;
}

.info-window-phone {
  margin: 8px 0;
  font-size: 14px;
}

.info-window-phone a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 14px;
  font-weight: normal;
}

.info-window-phone a:hover {
  text-decoration: underline;
}

.info-window-distance {
  color: #666;
  font-size: 14px;
}

.info-window-rating {
  color: #f5a623;
  font-weight: 500;
  font-size: 14px;
}

.info-window-features {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

/* Ensure info window is responsive */
@media (max-width: 480px) {
  .gm-style .gm-style-iw-c {
    max-width: 280px !important;
  }

  .info-window-image img {
    height: 120px;
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .store-locator-container {
    flex-direction: column;
    height: 800px;
  }
  
  .sidebar {
    width: 100%;
    height: 50%;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .map-container {
    height: 50%;
  }
  
  .filter-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-toggle {
    margin-right: 0;
    margin-bottom: 8px;
  }
  
  .sort-container {
    justify-content: space-between;
  }
}

@media (max-width: 480px) {
  .location-card {
    flex-direction: column;
  }
  
  .location-image {
    margin-right: 0;
    margin-bottom: 8px;
  }
  
  .location-image img {
    width: 100%;
    height: auto;
    max-height: 120px;
  }
}

/* Accessibility focus states */
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Animation for loading */
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.loading-indicator:not([hidden]) {
  animation: pulse 1.5s infinite ease-in-out;
}
