/* Base Styles */
.home-container {
  margin: 1rem auto 0;
  max-width: 95%;
  min-height: 60vh;
}

.home-container h1 {
  font-size: 30px;
  font-weight: 700;
  color: #067577;
}

/* Header Elements */
.back-btn {
  margin-top: 0.5rem;
  width: 100%;
  text-align: left;
  max-width: 500px;
}

.back-btn a {
  text-decoration: none;
  color: #004d66;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
}

.back-btn a::before {
  content: "<";
  font-size: 20px;
  margin-right: 8px;
}

.sub-heading {
  display: flex;
  justify-content: space-between;
}

.progress-details {
  font-size: 12px;
  font-weight: 400;
  line-height: 15.62px;
  letter-spacing: -0.03em;
  color: #1a629e;
}

/* Location & Form Styles */
.selection-container {
  padding: 10px;
  gap: 0;
  border-radius: 10px;
  background: white;
  display: flex;
  flex-direction: column;
  text-align: center;
  max-width: 100%;
  box-shadow: rgba(0, 0, 0, 0.16) 0px 10px 36px 0px,
    rgba(0, 0, 0, 0.06) 0px 0px 0px 1px;
  margin: auto 0;
}

.address-form-container {
  background-color: #f0f8ff;
  padding: 20px 0;
  width: 100%;
  display: flex;
  justify-content: center;
  border-radius: 10px;
  margin: 10px 0 5px 0;
}

.cards-container {
  min-height: 90vh;
}

.address-fields {
  display: flex;
  align-items: center;
  max-width: 1200px;
  gap: 10px;
  justify-content: center;
}

.address-input {
  padding: 12px 15px;
  text-align: center;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  color: #1a629e;
  outline: none;
  width: 800px;
  flex: none;
  min-width: 0;
  box-shadow: 0px 4px 4px 0px #0000001a inset;
}

.or-divider {
  color: #0077b6;
  font-weight: bold;
  font-size: 20px;
  padding: 0 10px;
}

.validation-section {
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
}

.valid-postcode {
  font-weight: 700;
  font-size: 18px;
  color: #067577;
}

/* Common Button Styles */
#shm-validate-btn,
#shm-add-to-cart {
  padding: 10px;
  border-radius: 10px;
  color: white;
  font-weight: 700;
  line-height: 26.04px;
  transition: background 0.3s ease, transform 0.2s ease;
  background: linear-gradient(270deg, #1d9097 0%, rgba(9, 47, 49, 0.8) 100%);
  border-color: unset;
}

#shm-validate-btn:hover,
#shm-add-to-cart:hover  {
  background: linear-gradient(270deg, #1d9097 0%, rgba(9, 47, 49, 1) 100%);
  transform: scale(1.05);
}

#shm-validate-btn {
  width: 180px;
  font-size: 20px;
}


#shm-add-to-cart {
  margin: auto;
  width: 180px;
  font-size: 20px;
}

#dm-continue:hover,
#dm-add-to-cart:hover {
  background: linear-gradient(270deg, #1d9097 0%, rgba(9, 47, 49, 1) 100%);
  transform: scale(1.05);
}

/* Campaign Section */
.campaign-section {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.campaign-section h1 {
  width: 100%;
  max-width: 420px;
  color: #004d61;
  background: #eef6fc;
  padding: 10px;
  margin: 0 auto 1.5rem;
  border-radius: 10px;
  font-size: clamp(20px, 4vw, 26px);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  box-shadow: 0px 4px 4px 0px #00000040;
}

.new-location {
  margin-left: 10px;
  padding: 8px 20px;
  border: none;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  color: #fff;
  background-image: linear-gradient(#1d9097, #092f31cc);
}

.new-location:hover {
  background-image: linear-gradient(#092f31cc, #1d9097);
}

.campaign-section span {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: 700;
  line-height: 1.3;
  color: #1d9097;
}

/* Form Elements */
.form-group {
  position: relative;
  width: 100%;
  max-width: 350px;
  display: flex;
  align-items: center;
}

.form-group .icon {
  position: absolute;
  left: 10px;
  width: 20px;
  height: 20px;
  pointer-events: none;
}

#current_location {
  width: 100%;
  padding: 8px 8px 8px 40px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 16px;
}

/* Map Layers Section */
.map-layers {
  height: calc(100vh - 100px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #1a629e transparent;
  background: #ffffff;
  border-radius: 5px;
  box-shadow: 0px 4px 4px 0px #00000040;
}

.map-layers::-webkit-scrollbar {
  width: 8px;
}

.map-layers::-webkit-scrollbar-thumb {
  background-color: #007bff;
  border-radius: 5px;
}

.map-layers h2 {
  font-size: 15px;
  font-weight: 400;
  line-height: 15.62px;
  letter-spacing: -0.03em;
  text-align: center;
  color: #1a629e;
}

.btn-section {
  display: flex;
  justify-content: space-around;
}

.clear-btn {
  font-weight: 400;
  font-size: 15px;
  text-decoration: underline;
  color: #1a629e;
  cursor: pointer;
}

/* Feature Section */
.feature-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1rem auto 0;
  background: #dcecf9;
  border-radius: 10px;
  padding: 10px 20px;
  transition: border-radius 0.3s, box-shadow 0.3s;
  box-shadow: 0px 4px 4px 0px #00000040;
}

.feature-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
  cursor: pointer;
}

.feature-section span {
  font-size: 16px;
  color: #044c4e;
}

/* Active states for feature sections */
.feature-section.demographics-active,
.feature-section.mileage-active,
.feature-section.adsize-active,
.feature-section.designtype-active {
  border-radius: 10px;
  box-shadow: rgba(0, 0, 0, 0.25) 0px 0px 4px 0px;
  max-width: 86%;
  padding: 5px;
}

.feature-content.demographics-active,
.feature-content.mileage-active,
.feature-content.adsize-active,
.feature-content.designtype-active {
  flex-direction: row;
  gap: 1rem;
}

.feature-content.demographics-active img,
.feature-content.mileage-active img,
.feature-content.adsize-active img,
.feature-content.designtype-active img {
  width: 20px;
  height: 20px;
}

/* Clickable sections */
.layer-wrapper:has([alt="mileage-radius"]) .feature-content,
.layer-wrapper:has([alt="select-ad-size"]) .feature-content,
.layer-wrapper:has([alt="select-design-type"]) .feature-content {
  cursor: pointer;
}

.layer-wrapper:has([alt="mileage-radius"]) .feature-content *,
.layer-wrapper:has([alt="select-ad-size"]) .feature-content *,
.layer-wrapper:has([alt="select-design-type"]) .feature-content * {
  pointer-events: none;
}

.layer-wrapper:has([alt="mileage-radius"]) .feature-content input,
.layer-wrapper:has([alt="mileage-radius"]) .feature-content label,
.layer-wrapper:has([alt="select-ad-size"]) .feature-content input,
.layer-wrapper:has([alt="select-ad-size"]) .feature-content label,
.layer-wrapper:has([alt="select-design-type"]) .feature-content input,
.layer-wrapper:has([alt="select-design-type"]) .feature-content label,
.rate-chart-section small,
.clear-selections small {
  pointer-events: auto;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 45px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #e6e6e6;
  transition: 0.4s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

input:checked + .toggle-slider {
  background: linear-gradient(180deg, #1a629e 0%, rgba(26, 98, 158, 0.3) 100%);
}

input:checked + .toggle-slider:before {
  transform: translateX(21px);
}

/* Options Container */
.options-container {
  display: none;
  padding: 10px;
  margin-top: 5px;
  width: 100%;
}

.options-container.show {
  display: block;
  background: #f6fbff;
  color: #1a629e;
}

.radio-section {
  width: 100%;
  text-align: left;
}

.filter-btn {
  background: linear-gradient(270deg, rgba(29, 144, 151, 0.8) 0%, rgba(161, 206, 208, 0.6) 100%);
  font-size: 14px;
  font-weight: 600;
  line-height: 15.62px;
  letter-spacing: -0.03em;
  color: #044c4e;
  padding: 5px 15px;
  border-radius: 10px;
  max-width: 70%;
  cursor: pointer;
}

.radio-section-header {
  color: #1a629e;
  font-size: 18px;
  font-weight: 700;
  line-height: 23.44px;
  margin-bottom: 5px;
}

.radio-options {
  text-align: left;
  border: 1px solid #1d9097;
  background: #ffffff;
  padding: 10px;
  border-radius: 5px;
  color: #1a629e;
}

/* Rate Chart & Clear Sections */
.rate-chart-section {
  text-align: right;
}

.rate-chart-section small,
#clear-design-type-options {
  margin: 20px 10px 0px;
  font-style: italic;
  color: #1a629e;
  text-decoration: underline;
  font-size: 15px;
  font-weight: 400;
  cursor: pointer;
}

/* Modal Styles */
.modal-dialog {
  max-width: 70%;
  margin: 1.75rem auto;
}

.modal-content {
  border-radius: 10px;
}

.modal-header {
  border-bottom: 1px solid #dee2e6;
  padding: 1rem;
}

.modal-body {
  padding: 1.5rem;
  overflow-x: auto;
}

.rate-chart-section table {
  min-width: 800px;
  width: 100%;
  margin-bottom: 0;
  border-radius: 10px;
  box-shadow: 4px 4px 100px 10px #00000026;
}

.rate-chart-section table th,
.rate-chart-section table td {
  border: 1px solid #9fccf1;
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #ddd;
  white-space: nowrap;
}

.rate-chart-section table th {
  background-color: #eef6fc;
  color: #044c4e;
  font-size: 1.1rem;
  position: sticky;
  top: 0;
}

.rate-chart-section table td {
  background-color: #ffffff;
  font-size: 1rem;
  color: #044c4e;
}

.rate-chart-section table td:first-child {
  font-weight: 700;
  position: sticky;
  left: 0;
  background-color: #ffffff;
  z-index: 1;
}

.rate-chart-section table tr:hover td {
  background-color: #ecf0f1;
}

/* Map Section */
.map-section {
  height: calc(100vh - 100px);
  background: #ffffff;
  border-radius: 5px;
  box-shadow: 0px 4px 4px 0px #00000040;
  position: relative;
  display: flex;
  flex-direction: column;
}

#map {
  position: relative;
  width: 100%;
  height: 90%;
}

.map-notes {
  width: 100%;
  height: 20%;
  background-color: #eef6fc;
  border-top: 1px solid #dce6f0;
  padding: 8px 12px;
  font-size: 16px;
  color: #067577;
  text-align: left;
  overflow-y: auto;
  border-radius: 0 0 5px 5px;
}

path.leaflet-interactive:focus {
  outline: none;
}

/* Demographic Controls */
.demographic-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scrollbar-width: thin;
  background: #f6fbff;
  height: calc(100vh - 100px);
  overflow-y: auto;
  border-radius: 5px;
  scrollbar-color: #007bff transparent;
  box-shadow: 0px 4px 4px 0px #00000040;
}

.demographic-controls::-webkit-scrollbar {
  width: 8px;
}

.demographic-controls::-webkit-scrollbar-thumb {
  background-color: #007bff;
  border-radius: 5px;
}

.user-selections-section {
  box-shadow: 0px 4px 4px 0px #00000040;
  padding: 10px;
  border-radius: 5px;
  background: #eef6fc;
}

/* Table Styles */
.table th {
  font-size: 14px;
  font-weight: 700;
  line-height: 23.44px;
  text-align: left;
  color: #067577;
}

.table td {
  font-size: 14px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.03em;
  text-align: left;
  color: #067577;
}

.price-breakup {
  cursor: pointer;
  text-align: right;
  font-style: italic;
  text-decoration: underline;
  color: #1a629e;
}

.table.price-table th {
  font-size: 12px;
  font-weight: 400;
  line-height: 16px;
  letter-spacing: -0.03em;
}

/* noUiSlider Styles */
.js-nouislider.age,
.js-nouislider.income,
.js-nouislider.mileage {
  height: 4px;
  margin: 20px 10px;
}

.noUi-target {
  border: none;
  box-shadow: none;
  background: #e2e8f0;
}

.noUi-connect {
  background: #4299e1;
}

.noUi-handle {
  width: 20px !important;
  height: 20px !important;
  right: -10px !important;
  top: -8px !important;
  border-radius: 50%;
  background: #2c5282;
  box-shadow: none;
  border: none;
  cursor: pointer;
}

.noUi-handle:before,
.noUi-handle:after {
  display: none;
}

.noUi-tooltip {
  font-size: 12px;
  background: #2d3748;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  display: none;
}

.noUi-active .noUi-tooltip {
  display: block;
}

/* Utility Classes */
.form-check-input:checked {
  background-color: #044c4e;
  border-color: #044c4e;
}

#carrier_id {
  color: red;
}

.carrier-route-heading {
  color: #067577;
}

.user-heading {
  font-size: 18px;
  font-weight: 700;
  line-height: 23.44px;
  text-align: center;
  color: #1a629e;
}

/* Overlay & Loader */
#overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

.loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  display: none;
}

.overlay-text {
  color: white;
}

.loader-icon {
  font-size: 2em;
  vertical-align: middle;
  margin-right: 0.5em;
}

/* Image Sizing */
.feature-content img[alt="mileage-radius"] {
  width: 56px;
  height: 53px;
  transition: all 0.3s ease;
}

.feature-content img[alt="select-ad-size"] {
  width: 56px;
  height: 45px;
  transition: all 0.3s ease;
}

.feature-content img[alt="select-design-type"] {
  width: 70px;
  height: 53px;
  transition: all 0.3s ease;
}

.feature-section.mileage-active .feature-content.mileage-active img[alt="mileage-radius"],
.feature-section.adsize-active .feature-content.adsize-active img[alt="select-ad-size"],
.feature-section.designtype-active .feature-content.designtype-active img[alt="select-design-type"] {
  width: 25px;
  height: 20px;
}

/* Radio Options Styling */
.radio-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
}

.radio-option {
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.radio-option::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
}

.radio-btn {
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
}

.radio-btn input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ced4da;
  border-radius: 50%;
  outline: none;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-btn input[type="radio"]:checked {
  border-color: #0d6efd;
}

.radio-btn input[type="radio"]:checked::after {
  content: "";
  width: 10px;
  height: 10px;
  background-color: #0d6efd;
  border-radius: 50%;
  position: absolute;
  border: 1px solid #9fccf1;
}

.option-card {
  flex-grow: 1;
  border: 1px solid #ced4da;
  border-radius: 8px;
  background-color: #fff;
  transition: all 0.2s ease;
}

.radio-option:hover .option-card {
  border-color: #adb5bd;
  background-color: #f8f9fa;
}

.radio-option:has(input[type="radio"]:checked) .option-card {
  border-color: #a0d2eb;
  background-color: #9fccf1;
  box-shadow: 0 0 0 1px #a0d2eb;
}

.option-content {
  display: flex;
  flex-direction: column;
}

.option-title {
  font-weight: 600;
  font-size: 16px;
  color: #152850;
  text-align: center;
}

.option-price {
  color: #152850;
  font-size: 12px;
  margin-top: 3px;
  font-weight: 400;
  text-align: center;
}

#ad-size-radios {
  padding: 0px;
  margin-top: 1rem;
}

/* Media Queries */
@media (max-width: 768px) {
  .modal-dialog {
    max-width: 95%;
    margin: 1rem auto;
  }

  .location-header {
    flex-direction: column;
    padding: 15px;
  }

  .campaign-section,
  .location-section {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  .form-group {
    margin: 10px 0;
  }

  #OR {
    margin: 10px 0;
  }
}