/* Regions Flags Background color.*/
/* For search-esimcountries.js and for single-region-template.php */

.region-img {
  background-color: var(--e-global-color-primary) !important;
}

.result-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 0.0625rem solid #ddd;
  cursor: pointer;
  transition: background 0.3s ease-in-out;
}

.result-item:hover {
  background: var(--e-global-color-primary);
}

.country-flag {
  width: 1.875rem;
  height: auto;
  margin-right: 1.25rem;
  border-radius: 0.1875rem;
}

.country-name {
  font-size: 1rem;
  font-weight: 500;
  color: #000000;
  line-height: 1em;
}

.no-results {
  color: #000000;
  text-align: center;
  padding: 0.625rem;
}

/* Wrapper */
.custom-esims-search-bar {
  width: 100%;
  margin: 0;
}

.custom-esims-search-bar form {
  width: 100%;
  margin: 0;
}

.custom-esims-search-bar button {
  background-color: var(--e-global-color-primary);
  color: #fff;
  border: none;
  padding: 0.5625rem;
  margin-right: 2px;
  font-size: 2rem;
  cursor: pointer;
  border-radius: 8px;
  line-height: 1em;
}

.custom-esims-search-bar button:hover {
  background-color: var(--e-global-color-primary);
}



/* Search Box */
.search-box {
  display: flex;
  position: relative;
  align-items: center;
  justify-content: space-between;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #474AD2;
  /* blue border */
  padding: 1px;
  width: 100%;
  box-sizing: border-box;
}

.search-box input {
  flex: 1;
  padding: 0.9375rem 1.5625rem;
  font-size: 15px;
  border: none;
  outline: none;
  font-family: var(--e-global-typography-primary-font-family);
  height: 3.125rem;
  color: #666666;
}

.search-box input::placeholder {
  color: #21272A;
}

/* Search Button */
.search-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #474AD2;
  color: #ffffff;
  border: none;
  padding: 0.5625rem;
  font-size: 1.25rem;
  /* adjust icon size */
  cursor: pointer;
  border-radius: 8px;
  line-height: 1em;
  width: 45px;
  height: 45px;
  transition: background 0.3s ease-in-out;
}

.search-icon {
  width: 2rem;
  height: 2rem;
}

/* Style for Tabs */
/* Wrapper */
.esim-wrapper {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 0 60px 0;
  font-family: var(--e-global-typography-primary-font-family);
}

/* Header row: title left, tabs right */
.esim-header {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 3.75rem;
}

.esim-title h2 {
  font-weight: 700;
  font-size: 2rem;
  line-height: 1em;
  margin: 0 0 1rem;
  color: #000;
  display: none;
}

.esim-title p {
  margin: 0;
  font-weight: 400;
  font-size: 1rem;
  line-height: 1em;
  color: #000;
  display: none;
}

.esim-tabs {
  display: flex;
  gap: 1.25rem;
}

.esim-tabs button {
  background: none;
  background-color: transparent;
  border: none;
  font-size: 1rem;
  padding: 0.625rem 0.75rem;
  cursor: pointer;
  color: #000;
  line-height: 1em;
  border-bottom: 0.0625rem solid transparent;
  font-weight: 500;
  border-radius: 0;
}

.esim-tabs button:hover {
  color: var(--e-global-color-primary);
}

.esim-tab.active,
.esim-tabs button:hover {
  color: var(--e-global-color-primary);
  border-color: var(--e-global-color-primary);
  font-weight: 700;
  background-color: transparent !important;
}

/* Hide all tab content wrappers by default */
.tab-content-wrapper {
  display: none;
}

/* Show active tab content wrapper */
.tab-content-wrapper.active {
  display: block;
}

/* Grid layout: 4 per row */
.esim-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

.esim-card {
  display: flex;
  align-items: center;
  background: #fff;
  border: 0.0625rem solid #E6E6E6;
  padding: 1rem 1rem;
  border-radius: 10px;
  transition: all 0.3s;
  cursor: pointer;
}

.esim-card:hover {
  border-color: var(--e-global-color-primary);
  box-shadow: 0 0 0 0.125rem rgba(59, 73, 223, 0.1);
}

.esim-card img {
  width: 50px;
  height: 50px;
  margin-right: 10px;
  object-fit: cover;
  border-radius: 50%;
}

.esim-card[data-tab="regions"] img {
  border-radius: 50%;
}

.esim-card-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.esim-card-content h4 {
  font-size: 15px;
  font-weight: 700;
  color: #000;
  margin: 0;
  text-align: left;
}

.esim-packages {
  font-size: 13px;
  line-height: 1em;
  color: #666;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.525rem;
}


.esim-packages .arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  color: #666;
  transition: transform 0.2s ease;
}

.esim-card:hover .arrow {
  transform: translateX(0.125rem);
  color: #3b49df;
}

.esim-packages svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* Button wrapper */
.esim-button-wrapper {
  grid-column: 1 / -1;
  margin-top: 1.875rem;
  text-align: center;
}

.esim-button-wrapper button {
  background: var(--e-global-color-primary) !important;
  border: 0.0625rem solid var(--e-global-color-accent);
  color: #fff;
  padding: 1rem 2rem;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1em;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
}

.esim-button-wrapper button:hover,
.esim-button-wrapper button:focus {
  background-color: var(--e-global-color-primary);
  background: var(--e-global-color-primary);
  color: #fff;
}

.hidden-card {
  display: none;
}

/* ================ */
/* Responsive CSS */
/* ================ */
@media screen and (min-width: 2400px) {
  /* Widder SCREENs */
}

@media screen and (max-width: 1366px) {

  /* DESKTOP SCREENS */
  .esim-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .package-card h2 {
    font-size: 1.25rem;
  }

  .package-details li {
    padding: 1rem 0;
  }

  .package-details span {
    font-size: 1rem;
  }
}

@media screen and (min-width: 1025px) {
  /* DESKTOP SCREENS */
}

@media screen and (max-width: 1024.98px) {

  /* TABLET SCREENS */
  .esim-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .package-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .package-card {
    padding: 3.125rem 1rem 2.5rem;
  }

  .package-card h2 {
    font-size: 1.5rem;
  }

  .package-details li {
    padding: 1rem 0;
  }

  .package-details span {
    font-size: 1rem;
  }
}

@media screen and (max-width: 767.98px) {

  /* MOBILE SCREENS */
  .search-box {
    padding: 0.5625rem;
  }

  .search-box input {
    font-size: 0.75rem;
    padding: 0.5rem 1rem;
    height: 2rem;
  }

  .search-icon {
    width: 1.25rem;
    height: 1.25rem;
  }

  .search-button {
    padding: 0.375rem;
    border-radius: 8px;
  }

  .custom-esims-search-bar button {
    padding: 0.375rem;
    border-radius: 0.625rem;
  }

  .esim-wrapper {
    padding: 2.5rem 0;
  }

  .esim-grid {
    grid-template-columns: 1fr;
  }

  .package-grid {
    grid-template-columns: 1fr;
  }

  .esim-header {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
  }

  .esim-tabs {
    width: 100%;
    justify-content: space-between;
  }

  .esim-tabs button {
    font-size: 1rem;
  }

  .esim-tab.active {
    font-size: 1rem;
  }

  .package-card {
    padding: 3.125rem 1.5rem 2.5rem;
  }
}

@media screen and (max-width: 640.98px) {
  /* SMALL MOBILE SCREENS */
}

@media screen and (max-width: 480.98px) {

  /* SMALL MOBILE SCREENS */
  .package-card {
    padding: 3.125rem 1rem 2.5rem;
  }
}

/* Wrap the search bar section */
.esim-search-container {
  display: flex;
  justify-content: center;
  /* horizontal center */
  align-items: center;
  /* vertical center (if parent has height) */
  width: 65%;
  margin: 0 auto;
  padding: 2rem 1rem;
  /* spacing top/bottom */
}

/* Start of Selection */
.esim-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 10px;
  margin-top: 0.25rem;
  z-index: 1000;
  max-height: 25rem;
  overflow-y: auto;
  border: 1px solid #E6E6E6;

  /* Custom scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: #c1c1c1 #f1f1f1;
}

.esim-search-results::-webkit-scrollbar {
  width: 8px;
  margin-right: 4px;
}

.esim-search-results::-webkit-scrollbar-track {
  background: transparent;
  margin: 0.5rem 0;
}

.esim-search-results::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 1rem;
  border: 2px solid transparent;
  background-clip: content-box;
  transition: background 0.3s ease;
}

.esim-search-results::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
  background-clip: content-box;
}

.esim-search-results::-webkit-scrollbar-corner {
  background: transparent;
}

/* End of Selection */

.esim-search-results:not(:empty) {
  border: 1px solid #E6E6E6;
}

/* End of Selection */

.search-results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 0.25rem 0.25rem;
}

.search-result-item {
  display: flex;
  align-items: center;
  padding: 0;
  transition: all 0.3s;
  cursor: pointer;
}

.search-result-item .country-flag {
  width: 45px;
  height: 45px;
  margin-right: 0.75rem;
  border-radius: 50%;
  object-fit: cover;
}

.search-result-item .result-content {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search-result-item h4 {
  font-size: 0.75rem;
  font-weight: 700;
  color: #000000;
  margin: 0;
  text-align: left;
  line-height: 1.1em;
}

.search-result-item .package-count {
  font-size: 0.55rem;
  line-height: 1em;
  color: #000000;
  opacity: 0.5;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 0.525rem;
}

.search-result-item .arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.25rem;
  color: var(--e-global-color-primary);
  transition: transform 0.2s ease;
}

.no-results,
.error {
  padding: 1rem;
  text-align: center;
  color: #000000 !important;
}

.error {
  color: #dc3545;
}

/* Mobile Responsive Styles */
@media screen and (max-width: 767.98px) {
  .search-results-grid {
    grid-template-columns: 1fr;
  }

  .search-result-item {
    padding: 0.75rem;
  }

  .search-result-item .country-flag {
    width: 40px;
    height: 40px;
    margin-right: 0.75rem;
    border-radius: 50%;
    object-fit: cover;
  }

  .esim-search-container {
    width: 100%;
  }
}