.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

.form-row {
  display: flex;
  gap: 25px;
}

.input-wrapper {
  position: relative;
  flex: 1;
}

.form-subtitle {
  margin-bottom: 23px;
}

.input-field.error {
  border-color: red;
}

.error-message {
  display: none;
  color: red;
  font-family: 'Gantari', sans-serif;
  font-size: 14px;
  margin-top: 5px;
}

.input-credit-card {
  margin-bottom: 15px;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

.payment-section-title {
  color: rgba(14, 12, 9, 1);
  font-family: "Sofia Sans Condensed", sans-serif;
  font-size: 30px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  padding-bottom: 15px;
}

.header-text {
  color: rgba(42, 39, 36, 1);
  font-size: 18px;
  font-weight: 400;
  text-align: left;
  line-height: 21px;
}

.address-section {
  display: flex;
  flex-direction: column;
}

.form-row:not(:last-child) {
  margin-bottom: 15px;
}

.input-field {
  flex: 1;
  padding: 15px;
  border: 1px solid #f2efea;
  border-radius: 3px;
  opacity: 0.7;
  color: rgba(14, 12, 9, 1);
  font-family: "Gantari", sans-serif;
  font-size: 17px;
  font-weight: 400;
  text-align: left;
  line-height: 25px;
  min-height: 57px;
  min-width: 180px;
  align-items: center;
  width: 100%;
}

/* Custom Select */
.custom-select-wrapper {
  position: relative;
  width: 40%;
  min-width: 180px;
}

.custom-select {
  position: relative;
  border: 1px solid #f2efea;

  border-radius: 3px;
  opacity: 1;
  min-height: 57px;
  cursor: pointer;
  background-color: #fff;
  padding: 17px 30px 7px 15px;
  font-family: "Gantari", sans-serif;
  font-size: 17px;
  line-height: 25px;
  align-items: center;
}

.custom-select .selected-option {
  display: flex;
  align-items: center;
  margin-top: 4px;
  color: rgba(0, 0, 0, 0.7);
}

.custom-select .flag-icon {
  width: 20.5px;
  height: auto;
  margin-right: 8.5px;
}

.custom-select .options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  border: 1px solid #f2efea;
  border-radius: 3px;
  background-color: #fff;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
}

.custom-select .options li {
  padding: 10px;
  cursor: pointer;
  color: rgba(0, 0, 0, 0.7);
}

.custom-select .options li:hover,
.custom-select .options li.selected {
  background-color: #f2efea;
}

.custom-select .options li span {
  vertical-align: middle;
}

.custom-select.open .options {
  display: block;
}

.custom-select::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-image: url('https://img.libidion.com/arrow-down.webp');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-top: 4px;
}

/* Adjust input-field for labels */

.custom-select,
.input-phone {
  position: relative;
}

.input-phone::before,
.custom-select::before {
  content: attr(data-label);
  position: absolute;
  left: 10px;
  top: 12px;
  font-size: 15px;
  line-height: 0;
  color: #5b5854;
  pointer-events: none;
  padding: 0 2px;
  z-index: 1000;
}

.input-phone {
  position: relative;
  flex: 1;
  min-width: 0;
}

.phone-container {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
  border: 1px solid #f2efea;
  border-radius: 3px;
  background-color: #fff;
  max-height: 57px;
}

.phone-prefix {
  padding: 17px 8px 7px 15px;
  font-family: "Gantari", sans-serif;
  font-size: 17px;
  color: var(--color-primary);
  white-space: nowrap;
  opacity: 0.7;
}

.input-phone .input-field {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 17px 15px 7px 0;
  font-family: "Gantari", sans-serif;
  font-size: 17px;
  line-height: 25px;
  color: var(--color-primary);
  opacity: 0.7;
}

.phone-container:focus-within {
  border: 2px solid #5b5854;
}

/* Стилі для плейсхолдера */
.input-phone .input-field::placeholder {
  color: rgba(14, 12, 9, 1);
  opacity: 0.7;
}

.input-field--full {
  flex: 1;
  width: 100%;
}

/* Payment method */

.payment-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.payment-options {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.payment-method {
  background-color: #f2efea;
  border-radius: 8px;
  transition: background-color 0.3s;
}

.payment-method.active {
  background-color: #f2efea;
}

.payment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 15px;
  cursor: pointer;
}

.payment-header-klarna {
  padding-top: 17px;
  padding-bottom: 3px;
}

.payment-header input[type="radio"] {
  width: 22px;
  height: 22px;
}

.payment-title {
  flex: 1;
  color: rgba(41, 41, 41, 1);
  font-size: 17px;
  font-weight: 600;
  text-align: justify;
  line-height: 27px;
}

.payment-icon-cards {
  max-height: 24px;
  width: auto;
}

.payment-icon-paypal {
  max-height: 22px;
  width: auto;
}

.payment-icon-klarna {
  max-height: 27px;
  width: auto;
}

.payment-details {
  display: none;
  padding: 15px;
}

.payment-method.active .payment-details {
  display: block;
}

.input-label {
  position: absolute;
  top: -30px;
  font-size: 15px;
  line-height: 25px;
  opacity: 70%;
}

.continue-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 11px;
  background-color: #c6ef43;
  color: #0e0c09;
  border: none;

  font-family: var(--font-primary);
  font-weight: 500;
  font-size: 18px;
  line-height: 100%;
  cursor: pointer;
  margin-bottom: 10px;
}

.continue-button:hover {
  background-color: #d4f567;
}

.button-icon {
  width: 20px;
  height: 20px;
}

.guarantee-text {
  font-size: 15px;
  line-height: 25px;
  text-align: center;
  opacity: 70%;
}

.klarna-info {
  font-size: 15px;
  line-height: 18px;
  color: #5b5854;
  margin: 4px 1.25rem 0.5rem 3.125rem;
}

.payment-method.active .klarna-info {
  margin-left: 15px;
}

/* radiobutton styles */
.payment-method input[type="radio"] {
  accent-color: #000;
  outline: none;
  box-shadow: none;
}

.payment-method input[type="radio"]:focus {
  outline: none;
}

.payment-method input[type="radio"]:checked {
  background-color: transparent;
}

/* new FEATURES */
.shipping-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  background-color: var(--color-secondary);
  border-radius: 8px;
  padding: 12px 16px;
}

.car-image {
  width: 24px;
  height: auto;
}

.shipping-text {
  font-weight: 400;
  font-size: 16px;
  line-height: 150%;
}

.features {
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: center;
  align-items: center;
  padding-top: 8px;
}

.rating-wrapper {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: center;
  justify-content: center;
}

.features__stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.features-star {
  width: 16px;
  height: auto;
}

.rating-text {
  font-weight: 500;
  font-size: 14px;
  line-height: 20px;
}

.features-wrapper {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 100%;
}

.feature {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  max-width: 160px;
  flex: 1 1 auto;
}

.features-image-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #DFF49B;
  min-width: 48px;
  min-height: 48px;
  flex-shrink: 0;
}

.features-image {
  width: auto;
  height: 25px;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.features-text {
  font-weight: 600;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  text-transform: uppercase;
}

@media (max-width: 470px) {
  .form-row {
    flex-wrap: wrap;
  }

  .payment-icon {
    width: 20px;
    height: 20px;
  }

  .custom-select-wrapper {
    width: 100%;
  }
}

@media (max-width: 768px) {

  .feature {
    gap: 4px;
    flex-direction: column;
  }
}