* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: #2E2838;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.hero-container {
  width: 100%;
  max-width: 900px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: url('img/mer-bg.jpg');
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: top center;
}

/* Cloud Header Badge */
.cloud-header {
  width: 100%;
  max-width: 450px;
  height: 120px;
  border-radius: 50px 50px 70px 70px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 80px;
  position: relative;
}

.badge {
  background: #ffffff;
  color: #111;
  border-radius: 50%;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.badge img {
  width: 100%;
  height: auto;
}

.badge-inner {
  font-size: 10px;
  text-align: center;
  line-height: 1.2;
}

.badge-inner strong {
  font-size: 11px;
  display: block;
}

/* Typography */
.hero-title {
  font-family: 'Landa', serif;
  font-size: 5rem;
  font-style: normal;
  font-weight: 700;
  line-height: 78%; /* 109.785px */
}

.hero-subtitle {
  font-family: 'Landa', serif;
  font-size: 2rem;
  opacity: 0.9;
  margin: 20px auto 30px auto;
  line-height: 110%; /* 109.785px */
}

/* Locator Card Wrapper */
.locator-card {
  display: flex;
  width: 100%;
  height: 480px;
  background-color: #131722;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid #33394b;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Map Section */
.map-container {
  flex: 1.3;
  height: 100%;
}

/* Sidebar & Scrolling List */
.sidebar {
  flex: 1;
  background-color: #272726;
  padding: 20px;
  display: flex;
  flex-direction: column;
  text-align: left;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.3;
}

.store-list {
  flex: 1;
  overflow-y: auto;
  padding-right: 5px;
}

/* Scrollbar Customization */
.store-list::-webkit-scrollbar {
  width: 6px;
}
.store-list::-webkit-scrollbar-thumb {
  background: #3a3f52;
  border-radius: 4px;
}

/* Individual Store Cards */
.store-item {
  display: block;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background-color: #242938;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid #33394b;
}

.store-item:hover, .store-item.active {
  background-color: #2e3548;
  border-color: #4f5875;
}

.store-info {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.store-img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.store-details h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.store-details p {
  font-size: 0.8rem;
  color: #a0a6b8;
}

/* Button Group Styling */
.store-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-map, 
.btn-website {
  padding: 8px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Map Button */
.btn-map {
  background-color: #3b4259;
  color: #ffffff;
  border: 1px solid #4f5875;
}

.btn-map:hover, 
.btn-map.active {
  background-color: #8a63d2; /* Highlight color for currently selected map */
  border-color: #a27ce6;
}

/* Website Button */
.btn-website {
  background-color: transparent;
  color: #f7d4e3;
  border: 1px solid #f7d4e3;
}

.btn-website:hover {
  background-color: #f7d4e3;
  color: #111111;
}

/* Footer */
.footer {
    width: 100%;
    background-color: black;
    padding: 5% 0;
    opacity: 0;
}

.marimed-logo img {
    max-width: 120px;
}

.store-item {
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.store-item.active {
  background-color: #2e3548;
  border-left: 4px solid #8a63d2; /* Accent marker for active selection */
  padding-left: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .cloud-header {
    margin-bottom: 10px;
  }

  .locator-card {
    flex-direction: column; /* Stacks vertically on mobile */
    min-height: 500px; /* Prevents Safari from collapsing the height */
  }
  
  .locator-card {
    flex-direction: column;
    height: auto;
  }

  .map-container {
    height: 250px;
    flex-shrink: 0; /* Prevent Safari from compressing or expanding the map */
  }

  .sidebar {
    height: 320px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* CRITICAL FOR SAFARI: Allows child flex elements to scroll */
    overflow: hidden;
  }

  .store-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch; /* Ensures smooth touch scrolling in iOS Safari */
    min-height: 150px; /* Guarantees store list remains visible */
  }

  .store-actions {
    width: 100%;
    margin-top: 8px;
  }
  
  .btn-map, .btn-website {
    flex: 1;
    text-align: center;
  }
}