/**
 * 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;
  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 {
  padding: 20px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 15px !important;
}

.philo-search-container {
  position: relative;
  width: 100%;
}

.philo-search-input {
  width: 100%;
  padding: 12px 45px 12px 15px;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  background: #ffffff;
  transition: all 0.3s ease;
  color: var(--colors-neutral-700, #404040);
  font-family: "Barlow", Sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
  line-height: 150%;
  /* 1.5rem */
}

.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: 7px;
  flex-wrap: wrap;
  align-items: center;
  flex-direction: row;
}

.philo-filter-select {
  padding: 7px 7px;
  border: 1px solid #666;
  border-radius: 3px;
  background: #ffffff;
  font-size: 14px;
  color: #495057;
  min-width: 120px;
  transition: all 0.3s ease;
  width: calc((100% - 7px)/2);
}

.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 {
  margin-block-end: 0;
  margin-block-start: 0;
  padding: 80px 0 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.philo-store-list-header h3 {
  color: #0394C6 !important;
  font-family: "Barlow", Sans-serif;
  font-size: 2.5rem;
  font-style: normal;
  font-weight: 700;
  line-height: 110%;
  /* 2.75rem */
  text-transform: capitalize;
}

.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 {
  margin: 1rem;
  padding: 1rem;
  border: 1px solid #f1f3f4;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  gap: 1rem;
  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;
  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;
  border-bottom: 1px solid #f1f3f4 !important;
}

.philo-store-item.highlighted {
  background: #e3f2fd;
}

.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: 100%;
}

.philo-store-code {
  color: var(--colors-Persian-Blue-600, #000);
  font-family: "Barlow", Sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 600;
}

.philo-store-title {
  color: var(--colors-Persian-Blue-600, #0394C6);
  font-family: "Barlow", Sans-serif;
  font-size: 1.25rem;
  font-style: normal;
  font-weight: 600;
  line-height: 120%;
  margin-block-end: 0;
  margin-block-start: 0;
  /* 1.5rem */
}

.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;
  color: #6c757d;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--colors-zinc-600, #52525B);
  font-family: "Barlow", Sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 400;
  line-height: 150%;
  /* 1.5rem */
}

.philo-store-phone a {
  color: var(--colors-Persian-Blue-600, #0394C6);
  font-family: "Barlow", Sans-serif;
  font-size: 1rem;
  font-style: normal;
  font-weight: 500;
  line-height: 150%;
  /* 1.5rem */
  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: 300px;
  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: column;
  border-radius: 12px;
}

.philo-popup-header h3 {
  margin-block-end: 0;
  margin-block-start: 0;
  color: #101828;
  font-family: "Barlow", Sans-serif;
  ;
  font-size: 2rem;
  font-style: normal;
  font-weight: 600;
  line-height: 120%;
  text-align: center;
  display: block;
  width: 100%;
}

.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: left;
  }

  .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-list-header h3 {
    margin-block-end: 0;
    margin-block-start: 0;
    font-size: 2rem;
    text-transform: capitalize;
    text-align: left;
  }

  .philo-store-filters {
    padding: 15px;
  }

  .philo-store-list-header {
    padding: 2.5rem 0 0 1rem;
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .philo-store-item {
    padding: 15px;
  }

  .philo-store-thumb {
    height: 100px;
  }

  .leaflet-popup-content .philo-popup-content {
    padding: 0 !important;
    width: 100% !important;
  }
}

/* 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;
}


/* Ẩn item mượt mà */
.philo-store-item.hidden {
  display: none !important;
  /* Hoặc dùng height: 0; opacity: 0; nếu muốn hiệu ứng trượt */
}

/* Hiển thị item */
.philo-store-item.visible {
  display: flex !important;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Highlight item khi chọn từ bản đồ */
.philo-store-item.highlighted {
  background-color: #f9f9f9;
  transition: all 0.3s ease;
}

#philo-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 20px 0;
  padding: 10px;
}

.philo-page-btn {
  border: none !important;
  background: #fff !important;
  padding: 6px 12px !important;
  color: #737373 !important;
  cursor: pointer !important;
  border-radius: 60px !important;
  transition: 0.3s !important;
  width: 33px !important;
  height: 33px;
  line-height: 1;
}

.philo-page-btn.active {
  background: #0394C6 !important;
  /* Màu thương hiệu Philo */
  color: #fff !important;
  border-color: #0394C6 !important;
}

.philo-page-btn:hover:not(.active) {
  background: #f5f5f5 !important;
  color: #001338 !important;
}

/* Container của badge */
.philo-featured-badge {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, #ffb900 0%, #ff9100 100%);
  /* Gradient vàng sang cam nhẹ */
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  border-radius: 20px;
  /* Bo tròn dạng viên thuốc */
  margin-bottom: 8px;
  box-shadow: 0 2px 4px rgba(255, 145, 0, 0.3);
  line-height: 1;
}

/* Thêm icon ngôi sao trước chữ (nếu dùng Dashicons hoặc FontAwesome) */
.philo-featured-badge::before {
  content: "\f155";
  /* Mã của Dashicons Star-filled */
  font-family: dashicons;
  /* margin-right: 5px; */
  font-size: 12px;
  vertical-align: middle;
}

/* Hiệu ứng cho Item nổi bật để đồng bộ với Badge */
.philo-store-item.is-featured {
  /* background-color: #fffaf0; */
  /* Nền kem rất nhạt */
  /* border-left: 4px solid #ffb900 !important; */
  /* Vạch vàng bên trái */
  transition: all 0.3s ease;
}

.philo-store-item.is-featured:hover {
  background-color: #fff5e1;
  transform: translateY(-2px);
  /* Bay nhẹ lên khi hover */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Chỉnh lại tiêu đề khi có badge phía trên cho đẹp */
.philo-store-item.is-featured .philo-store-title {
  /* color: #b48500; */
  /* Tiêu đề màu vàng đậm hơn một chút */
  margin-top: 2px;
}

/* Nút bộ lọc dưới search */
.philo-btn-filter {
  align-items: center;
  cursor: pointer !important;
  margin: 0;
  font-size: 14px !important;
  transition: 0.3s !important;
  border: none !important;
  display: flex !important;
  justify-content: flex-start;
  padding: 0 !important;
  color: #404040 !important;
  font-weight: 600 !important;

}

.philo-btn-filter span {
  line-height: 1.3 !important;
}

.philo-btn-filter:hover {
  background-color: transparent !important;
}

.philo-btn-filter span {
  margin-right: 5px;
  font-size: 18px;
}

/* Overlay Popup */
.philo-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  /* Ẩn mặc định */
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.philo-popup-overlay.is-open {
  display: flex;
}

/* Nội dung Popup */
.philo-popup-content {
  padding: 1.5rem;
  background: #fff;
  width: 90%;
  max-width: 500px;
  border-radius: 8px;
  overflow: hidden;
  animation: philoFadeIn 0.3s ease;
}
.leaflet-popup-content .philo-popup-content{
  padding: 0;
}
@keyframes philoFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.philo-popup-header {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.philo-popup-close {
  font-size: 24px;
  cursor: pointer;
  align-self: center;
  position: absolute;
  top: -13px;
  right: 0;
}

.philo-popup-body {
  padding: 20px;
  max-height: 400px;
  overflow-y: auto;
}

/* Grid nhãn hiệu */
.philo-brand-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.philo-brand-item {
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
  border-radius: 4px;
  cursor: pointer;
  transition: 0.3s;
}

.philo-brand-item.active {
  border-color: #000080;
  background: #f0f4f8;
  color: #000080;
  font-weight: bold;
}

.philo-brand-item:hover {
  border-color: #000080;
}

.philo-btn-apply {
  width: 100%;
  padding: 12px;
  background: #000080;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

/* Grid nhãn hiệu trong popup */
.philo-brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Chia làm 3 cột */
  gap: 15px;
  padding: 10px 0;
}

.philo-brand-item {
  border: 1px solid #eee;
  padding: 15px 10px;
  text-align: center;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
}

.brand-icon-wrapper {
  width: 50px;
  height: 50px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  /* Để logo mặc định màu xám cho sang */
  opacity: 0.6;
  transition: 0.3s;
}

.brand-name {
  font-size: 12px;
  font-weight: 600;
  color: #333;
}

/* Khi nhãn hiệu được chọn hoặc hover */
.philo-brand-item.active,
.philo-brand-item:hover {
  border-color: #000080;
  box-shadow: 0 4px 12px rgba(0, 0, 128, 0.1);
}

.philo-brand-item.active .brand-icon-wrapper img,
.philo-brand-item:hover .brand-icon-wrapper img {
  filter: grayscale(0%);
  /* Hiện màu thật của logo */
  opacity: 1;
}

.philo-brand-item.active .brand-name {
  color: #000080;
}

@media (max-width: 480px) {
  .philo-brand-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.philo-popup-footer {
  display: flex;
  gap: 10px;
  padding: 15px;
}

.philo-btn-apply {
  flex: 2;
  /* Nút áp dụng rộng hơn */
  padding: 12px;
  background: #fff;
  border: 1px solid #0394C6 !important;
  border-radius: 32px !important;
  cursor: pointer;
  font-weight: bold;
  color: #0394C6 !important;
  font-family: "Barlow", Sans-serif;
  ;
  font-size: 1.125rem;
  font-style: normal;
  font-weight: 700;
  line-height: 150%;
  /* 1.6875rem */
  text-transform: uppercase;
}

.philo-btn-reset {
  flex: 1;
  /* Nút reset nhỏ hơn */
  padding: 12px;
  background: #f8f9fa;
  color: #333;
  border: 1px solid #0394C6 !important;
  border-radius: 32px !important;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s;
  color: #0394C6 !important;
  font-family: "Barlow", Sans-serif;
  ;
  font-size: 1.125rem;
  font-style: normal;
  font-weight: 700;
  line-height: 150%;
  /* 1.6875rem */
  text-transform: uppercase;

}

.philo-btn-apply:hover,
.philo-btn-reset:hover,
.philo-btn-reset:focus {
  background: #0EAEDE !important;
  border-color: #fff;
  color: #fff !important;
}