/**
 * Sutore Buy Now — Order-Pay panel
 * Checkout/kargo/coupon stilleri: flatsome-child/style.css + sutore-coupons/css/coupon.css
 */

/* Fallback: hide WC order-pay table if default template still renders */
body.sutore-buy-now-active #order_review table.shop_table {
  display: none !important;
}

/* === Order-Pay Panel === */
.sutore-buy-now-panel {
  width: 100%;
  margin: 0 0 24px;
  padding: 0;
}

/* Kolon sırası: mobilde fatura → kargo → sepet özeti → sözleşmeler (checkout form-checkout.php) */
.sutore-buy-now-panel > .row.pt-0 {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.sutore-buy-now-panel > .row.pt-0 > .large-8.col:first-child {
  order: 1;
}

.sutore-buy-now-panel > .row.pt-0 > .checkout-summary-container {
  order: 2;
}

.sutore-buy-now-panel > .row.pt-0 > .sutore-buy-now-terms-slot {
  order: 3;
}

@media screen and (min-width: 850px) {
  .sutore-buy-now-panel > .row.pt-0 > .large-8.col:first-child,
  .sutore-buy-now-panel > .row.pt-0 > .sutore-buy-now-terms-slot {
    flex: 0 0 66.666%;
    max-width: 66.666%;
  }

  .sutore-buy-now-panel > .row.pt-0 > .checkout-summary-container {
    flex: 0 0 33.333%;
    max-width: 33.333%;
  }
}

/* Başlık (h3) boyutları: flatsome-child/style.css — buy-now override yok */

.sutore-buy-now-panel.is-saving-billing .woocommerce-billing-fields {
  opacity: 0.65;
  pointer-events: none;
}

/* Billing spacing: tema .woocommerce-billing-fields p + .woocommerce form input margin-bottom */

body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields p.form-row > label,
body.fl-labels.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .fl-wrap > label[for]:first-child,
body.fl-labels.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields p.form-row span.woocommerce-input-wrapper > div > label {
  display: none !important;
}

body.sutore-buy-now-active #billing_country_field,
body.sutore-buy-now-active #billing_states_field,
body.sutore-buy-now-active #billing_city_field {
  display: block !important;
}

body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields select {
  height: 52px !important;
  padding: 16px !important;
  border: 1px solid rgb(230, 230, 230) !important;
  border-radius: 8px;
  outline: none;
  box-shadow: none !important;
  line-height: normal;
  margin-bottom: 15px !important;
  color: #222 !important;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
}

body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .input-text,
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields input[type="text"],
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields input[type="tel"],
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields input[type="number"],
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .fl-wrap input:not([type="checkbox"]) {
  height: 52px !important;
  padding: 16px !important;
  border: 1px solid rgb(230, 230, 230) !important;
  border-radius: 8px;
  outline: none;
  box-shadow: none !important;
  line-height: normal;
  margin-bottom: 15px !important;
  color: #222 !important;
  width: 100%;
  box-sizing: border-box;
  background-color: #fff;
}

body.fl-labels.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .fl-wrap {
  margin-bottom: 0 !important;
}

/* Select — Flatsome/checkout ile aynı chevron (right 5%, 1.4em padding) */
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields select,
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .fl-wrap select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: 52px !important;
  padding: 16px 1.4em 16px 16px !important;
  border: 1px solid rgb(230, 230, 230) !important;
  border-radius: 8px !important;
  outline: none !important;
  box-shadow: none !important;
  line-height: normal !important;
  margin-bottom: 15px !important;
  color: #222 !important;
  background-color: #fff !important;
  background-image: url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' class='feather feather-chevron-down'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 5% top 50% !important;
  background-size: 16px 16px !important;
}

body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .input-text::placeholder,
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields input::placeholder {
  color: #9a9a9a !important;
  opacity: 1;
}

body.sutore-buy-now-active form.sutore-buy-now-pay-form .woocommerce-invalid .input-text,
body.sutore-buy-now-active form.sutore-buy-now-pay-form .woocommerce-invalid select,
body.sutore-buy-now-active form.sutore-buy-now-pay-form .woocommerce-invalid-required-field .input-text,
body.sutore-buy-now-active form.sutore-buy-now-pay-form .woocommerce-invalid-required-field select {
  border-color: #e53935 !important;
}

body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .input-text:focus,
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields input:focus,
body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields select:focus {
  border-color: #222 !important;
}

body.fl-labels.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .form-row select {
  text-transform: capitalize;
}

body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .fl-wrap {
  width: 100%;
}

body.sutore-buy-now-active form.sutore-buy-now-pay-form.fl-form .woocommerce-billing-fields .woocommerce-input-wrapper {
  width: 100%;
}

/* Fatura: varsayılan masaüstü iki kolon */
body.sutore-buy-now-active .woocommerce-billing-fields__field-wrapper {
  display: flex;
  flex-wrap: wrap;
  column-gap: 4%;
  row-gap: 0;
  width: 100%;
}

body.sutore-buy-now-active .woocommerce-billing-fields .form-row-first,
body.sutore-buy-now-active .woocommerce-billing-fields .form-row-last {
  flex: 0 0 48%;
  width: 48% !important;
  max-width: 48% !important;
  float: none !important;
  clear: none;
  margin-left: 0;
  margin-right: 0;
  box-sizing: border-box;
}

body.sutore-buy-now-active .woocommerce-billing-fields .form-row-wide {
  flex: 0 0 100%;
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
}

/* Kargo — checkout sutore-kargo: mobil %100, masaüstü %48 */
body.sutore-buy-now-active .sutore-buy-now-pay-form .woocommerce-additional-fields {
  margin-top: 0;
}

body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment {
  padding-top: 45px;
  width: 100%;
  box-sizing: border-box;
}

@media screen and (min-width: 850px) {
  body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment {
    width: 48%;
  }
}

body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment input {
  display: none !important;
}

body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment > label {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 52px !important;
  padding: 16px !important;
  margin-bottom: 15px !important;
  border: 1px solid rgb(230, 230, 230) !important;
  border-bottom: 1px solid rgb(230, 230, 230) !important;
  border-radius: 8px;
  outline: none;
  box-shadow: none !important;
  line-height: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px !important;
  font-weight: 400 !important;
  color: #9a9a9a !important;
  cursor: pointer;
}

body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment > label.selected {
  border-color: #222 !important;
  color: #222 !important;
}

body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment span.amount {
  font-weight: normal;
  color: inherit;
}

/* Sözleşmeler — checkout #payment DOM (#payment > div.place-order > p.form-row-first|last) */
body.sutore-buy-now-active .sutore-buy-now-contracts-lightbox {
  display: none;
}

body.sutore-buy-now-active .sutore-buy-now-terms-slot {
  width: 100%;
  padding-top: 0;
}

body.sutore-buy-now-active .sutore-buy-now-terms-slot .sutore-buy-now-payment {
  padding-bottom: 0;
}

/* Tema: .form-row.place-order + #payment .form-row — buy-now’da ek flex/padding override yok */
body.sutore-buy-now-active #payment > div.form-row.place-order > p.form-row.form-row-first.validate-required.woocommerce-terms-and-conditions-wrapper,
body.sutore-buy-now-active #payment > div.form-row.place-order > p.form-row.form-row-last.custom-checkboxes {
  margin: 15px 0;
  box-sizing: border-box;
}

body.sutore-buy-now-active #payment > div.form-row.place-order > p.form-row.form-row-last.custom-checkboxes {
  margin-bottom: 0;
}

@media screen and (min-width: 850px) {
  body.sutore-buy-now-active #payment > div.form-row.place-order {
    column-gap: 4%;
  }

  body.sutore-buy-now-active #payment > div.form-row.place-order > p.form-row.form-row-first.validate-required.woocommerce-terms-and-conditions-wrapper,
  body.sutore-buy-now-active #payment > div.form-row.place-order > p.form-row.form-row-last.custom-checkboxes {
    flex: 0 0 48%;
    width: 48% !important;
    max-width: 48% !important;
    padding-left: 0;
    padding-right: 0;
  }
}

@media screen and (max-width: 849px) {
  body.sutore-buy-now-active #payment > div.form-row.place-order > p.form-row.form-row-first.validate-required.woocommerce-terms-and-conditions-wrapper,
  body.sutore-buy-now-active #payment > div.form-row.place-order > p.form-row.form-row-last.custom-checkboxes {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
  }
}

body.sutore-buy-now-active .sutore-buy-now-pay-form {
  padding-bottom: 120px;
}

body.sutore-buy-now-active .sutore-buy-now-cart-bottom.cart-bottom {
  display: block;
}

body.sutore-buy-now-active .sutore-buy-now-pay-form .checkout-summary-container .checkout-summary {
  position: sticky;
  top: 85px;
  align-self: start;
  padding-top: 15px;
  margin-left: 30px;
}

body.sutore-buy-now-active .sutore-buy-now-pay-form .checkout-summary h3 {
  display: flex;
}

body.sutore-buy-now-active .sutore-buy-now-pay-form div.checkout-summary-container > div > div.coupon-container > div.coupon-item-value > input {
  height: 52px !important;
  padding: 16px !important;
  border: 1px solid rgb(230, 230, 230) !important;
  border-radius: 8px;
  box-shadow: none !important;
  line-height: normal;
  margin-bottom: 15px !important;
  color: #222 !important;
}

.sutore-buy-now-panel .coupon-container .coupon-message[hidden] {
  display: none !important;
}

.sutore-buy-now-panel .coupon-container .coupon-message-error {
  color: red;
  margin-top: 15px;
}

@media screen and (max-width: 849px) {
  /* Fatura: sadece mobilde tek sütun */
  body.sutore-buy-now-active .woocommerce-billing-fields__field-wrapper {
    column-gap: 0;
  }

  body.sutore-buy-now-active .woocommerce-billing-fields .form-row,
  body.sutore-buy-now-active .woocommerce-billing-fields p.form-row,
  body.sutore-buy-now-active .woocommerce-billing-fields .form-row-first,
  body.sutore-buy-now-active .woocommerce-billing-fields .form-row-last,
  body.sutore-buy-now-active .woocommerce-billing-fields .form-row-wide {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    clear: both !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  body.sutore-buy-now-active .sutore-buy-now-pay-form .checkout-summary-container .checkout-summary {
    position: static;
    margin-left: 0;
    padding-top: 30px;
  }

  body.sutore-buy-now-active .sutore-buy-now-pay-form .checkout-summary-container {
    margin-top: 16px;
  }

  body.sutore-buy-now-active .sutore-buy-now-terms-slot .sutore-buy-now-payment .form-row.place-order {
    margin-top: 15px;
  }

  body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment {
    width: 100% !important;
  }

  body.sutore-buy-now-active .sutore-buy-now-pay-form .sutore-shipment > label {
    font-size: 13.6px !important;
    width: 100%;
  }

  body.sutore-buy-now-active .sutore-buy-now-pay-form {
    padding-bottom: 140px;
  }
}
