/**
 * Cart / checkout / login — align local WooCommerce markup with shop.elianware.com CSS.
 * Relies on checkout1_styles.css + headercartcheckout_styles.css + login_styles.css.
 */

/* ===== Minimal shell (cart + checkout) ===== */
body.ew-minimal-site,
.ew-minimal-site {
  background: #f6f6f6 !important;
  min-height: 100vh;
}

.ew-minimal-site h1.h1-title {
  display: none !important;
}

#HeaderCartCheckoutStyle .navbar .navbar-collapse.show {
  display: flex !important;
  width: 100%;
  align-items: center;
  justify-content: space-between;
}

#HeaderCartCheckoutStyle .uni-top-header-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 0;
}

#HeaderCartCheckoutStyle .uni-top-header-nav .display-small {
  font-size: 20px;
  font-weight: 400;
  line-height: 24px;
  color: #0c2028;
}

#HeaderCartCheckoutStyle .uni-top-header-right-nav {
  display: flex;
  align-items: center;
  margin-left: auto;
}

#HeaderCartCheckoutStyle .navbar-brand .next-image-container,
#HeaderCartCheckoutStyle .navbar-brand .evtedN {
  width: 160px;
  height: 48px;
  position: relative;
  display: block;
}

#HeaderCartCheckoutStyle .navbar-brand .next-image {
  object-fit: contain !important;
}

#HeaderCartCheckoutStyle .account-icon-w-text {
  background-color: #0c2028;
}

/* Let checkout1 control checkout-area; only fix conflicts from theme */
.ew-cart-area.checkout-area,
.ew-checkout-page .checkout-area {
  padding-top: 120px !important;
  padding-bottom: 48px !important;
  background-color: #f6f6f6 !important;
}

@media (max-width: 1132px) {
  .ew-cart-area.checkout-area,
  .ew-checkout-page .checkout-area {
    padding-top: 80px !important;
    padding-bottom: 80px;
  }
}

.checkout-area .one-page-checkout-form .container {
  max-width: 600px !important;
  margin: 0 auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  padding-bottom: 48px;
}

@media (max-width: 1132px) {
  .checkout-area .one-page-checkout-form .container {
    max-width: 100% !important;
  }
}

/* Hide WooCommerce chrome that original does not show */
.ew-minimal-site .woocommerce-notices-wrapper,
.ew-minimal-site .woocommerce-message,
.ew-minimal-site .woocommerce-info,
.ew-minimal-site .woocommerce-error {
  display: none !important;
}

.ew-minimal-site .checkout_coupon,
.ew-minimal-site .woocommerce-form-coupon-toggle {
  display: none !important;
}

/* ===== Bootstrap-ish helpers used in templates ===== */
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.w-100 { width: 100%; }
.mb-2 { margin-bottom: 8px; }
.me-2 { margin-right: 8px; }
.me-3 { margin-right: 12px; }
.heading.bold { font-weight: 700; }

/* ===== Products ordered (bridge until checkout1 selectors match) ===== */
.one-page-checkout-form .products-ordered {
  margin-bottom: 0;
  background: transparent;
}

.one-page-checkout-form .products-ordered .un-box-flat {
  background: #fff !important;
}

.one-page-checkout-form .products-ordered > .product-details-table {
  padding: 0 24px 24px;
}

.one-page-checkout-form .products-ordered .product-summary-voucher,
.one-page-checkout-form .products-ordered .product-summary-total {
  padding: 16px 24px;
}

.one-page-checkout-form .products-ordered .place-order {
  padding: 16px 24px 24px;
  border-top: 2px solid rgba(0, 0, 0, 0.06) !important;
  background-color: #f3fff3 !important;
}

.one-page-checkout-form .products-ordered .products-ordered-title a {
  display: inline-block !important;
  font-size: 14px !important;
  color: #007ce0 !important;
  text-decoration: none;
  cursor: pointer;
}

.checkout .ew-checkout-shipping-header {
  padding: 16px 24px !important;
  margin-bottom: 12px;
}

.checkout .ew-checkout-shipping-header .w-100.mb-2 {
  font-size: 16px;
  color: #0c2028;
  margin-top: 12px;
}

.checkout .order-payment .payment-methods {
  background: #fff;
  margin-bottom: 0;
}

.checkout .order-payment .ew-shipping-box {
  margin-bottom: 12px;
}

.one-page-checkout-form .products-ordered .place-order .place-order-btn,
.one-page-checkout-form .products-ordered .place-order a.place-order-btn,
.one-page-checkout-form .products-ordered .place-order a.confirm-btn {
  display: block;
  width: 100%;
  text-align: center;
  text-decoration: none;
  border: 0.4px solid #5acc5a !important;
  background-color: #5acc5a !important;
  color: #fff !important;
  height: 46px !important;
  line-height: 46px !important;
  border-radius: 4px !important;
  font-size: 18px !important;
  font-weight: 400;
}

.product-details-table-mobile {
  display: none;
}

@media (max-width: 1132px) {
  .one-page-checkout-form .desktop-only-component.product-details-table {
    display: none !important;
  }

  .product-details-table-mobile {
    display: block;
  }
}

.product-details-table .ant-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.product-details-table .ant-table th:nth-child(1),
.product-details-table .ant-table td:nth-child(1) {
  width: 42%;
}

.product-details-table .ant-table th:nth-child(2),
.product-details-table .ant-table td:nth-child(2) {
  width: 16%;
  text-align: right;
  white-space: nowrap;
}

.product-details-table .ant-table th:nth-child(3),
.product-details-table .ant-table td:nth-child(3) {
  width: 18%;
  text-align: center;
}

.product-details-table .ant-table th:nth-child(4),
.product-details-table .ant-table td:nth-child(4) {
  width: 16%;
  text-align: right;
  white-space: nowrap;
}

.product-details-table .ant-table th.ew-col-remove,
.product-details-table .ant-table td.product-remove {
  width: 8%;
  text-align: center;
  padding-left: 4px !important;
}

.product-details-table .product-remove .remove {
  color: #007ce0;
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
}

.product-details-table .d-flex.align-items-center {
  gap: 12px;
}

.product-details-table-mobile .product-row {
  display: flex;
  gap: 12px;
}

.product-details-table-mobile .product-content {
  flex: 1;
  min-width: 0;
}

/* Qty stepper */
.ew-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.ew-qty-stepper button {
  width: 28px;
  height: 28px;
  border: none;
  background: #f6f6f6;
  color: #0c2028;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}

.ew-qty-stepper .ew-qty-input {
  width: 40px;
  height: 28px;
  border: none;
  border-left: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  text-align: center;
  font-size: 14px;
  padding: 0;
  -moz-appearance: textfield;
}

.ew-qty-stepper .ew-qty-input::-webkit-outer-spin-button,
.ew-qty-stepper .ew-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.ew-coupon-field {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.ew-coupon-field .input-text {
  flex: 1;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 10px 12px;
}

.ew-cart-actions .ew-update-cart-btn {
  display: none !important;
}

/* Voucher "Apply Voucher" must be text link, not a bordered button */
.one-page-checkout-form .product-summary-voucher .action-btn,
.one-page-checkout-form .product-summary-voucher .ew-voucher-toggle,
.one-page-checkout-form button.ew-voucher-toggle {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
  color: #007ce0 !important;
  font-size: 16px !important;
  font-weight: 400 !important;
  line-height: 1.4 !important;
  cursor: pointer;
  text-align: right;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.one-page-checkout-form .products-ordered .un-text-truncate2 a,
.one-page-checkout-form .products-ordered .product-image a,
.one-page-checkout-form .product-details-table-mobile .body a,
.one-page-checkout-form .product-details-table-mobile .un-text-truncate2 a {
  color: #0c2028 !important;
  text-decoration: none !important;
}

.one-page-checkout-form .products-ordered-title a {
  color: #007ce0 !important;
}

.one-page-checkout-form .products-ordered {
  margin-bottom: 12px;
}

.one-page-checkout-form .order-payment {
  background: transparent !important;
}

.one-page-checkout-form .order-payment > .ew-shipping-box,
.one-page-checkout-form .order-payment > .payment-methods {
  background: #fff !important;
  margin-bottom: 12px;
}

/* ===== Checkout fields ===== */
.checkout .ew-shipping-box,
.checkout .payment-methods {
  background: #fff;
  margin-bottom: 12px;
}

.checkout .woocommerce-billing-fields h3,
.checkout .woocommerce-shipping-fields h3 {
  display: none;
}

.checkout .woocommerce-billing-fields__field-wrapper,
.checkout .woocommerce-shipping-fields__field-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.checkout #billing_address_1_field,
.checkout #billing_address_2_field,
.checkout #shipping_address_1_field,
.checkout #shipping_address_2_field,
.checkout #order_comments_field {
  grid-column: 1 / -1;
}

.checkout .form-row {
  margin: 0 0 12px;
  padding: 0;
}

.checkout .form-row label {
  display: block;
  font-size: 14px;
  color: #0c2028;
  margin-bottom: 4px;
}

.checkout .form-row .input-text,
.checkout .form-row select,
.checkout .form-row textarea {
  width: 100%;
  height: 35px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 6px 12px;
  font-size: 16px;
  color: #0c2028;
  background: #fff;
}

.checkout .form-row textarea {
  height: auto;
  min-height: 80px;
}

.checkout .woocommerce-checkout-payment {
  background: #fff;
  padding: 0 24px 24px;
}

.checkout .woocommerce-checkout-payment .wc_payment_methods {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
}

.checkout .woocommerce-checkout-payment .wc_payment_method {
  padding: 10px 0;
  border-bottom: 1px solid #e5e5e5;
}

.checkout .place-order,
.checkout .place-order-mobile {
  position: static !important;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  box-shadow: none !important;
  margin: 0 !important;
  padding: 16px 0 0 !important;
}

.checkout #place_order {
  width: 100%;
  margin-top: 12px;
}

.checkout .order-summary {
  padding: 16px 24px;
}

.checkout .order-summary .total-payment-row {
  padding: 6px 0;
}

.checkout .order-summary .order-summary,
.checkout .order-summary > .product-summary-total + .product-summary-total {
  display: none !important;
}

.checkout .order-summary .total-payment-amount,
.checkout .order-summary .total-payment-amount .amount {
  color: #11aa4f !important;
  font-weight: 700;
}

/* Prevent payment block from participating in billing grid */
.checkout .payment-methods,
.checkout #order_review,
.checkout #payment {
  display: block;
  width: 100%;
}

.checkout .payment-methods.un-box-flat {
  padding: 12px 0 0 !important;
}

.checkout .payment-methods .ew-section-title {
  padding: 0 24px 12px;
  margin-bottom: 0;
}

.checkout .woocommerce-checkout-payment {
  padding: 0 !important;
}

.checkout #payment .wc_payment_methods {
  list-style: none;
  margin: 0;
  padding: 0 24px 12px;
}

.checkout #payment .wc_payment_method {
  border: none;
  padding: 8px 0;
}

.checkout #payment .wc_payment_methods label {
  font-size: 14px;
  color: #0c2028;
  cursor: pointer;
}

.checkout #payment .wc_payment_methods label img {
  max-height: 22px;
  vertical-align: middle;
  margin-left: 6px;
}

.checkout #payment .payment_box {
  padding: 0 24px 12px;
}

.checkout #payment .payment_box > p {
  font-size: 12px;
  color: #647176;
  margin: 0 0 8px;
}

.checkout #payment .input-radio {
  margin-right: 8px;
}

.checkout #payment .woocommerce-privacy-policy-text {
  font-size: 12px;
  color: #647176;
  line-height: 1.5;
  margin-bottom: 12px;
}

.checkout #payment .place-order {
  background: #f3fff3 !important;
  padding: 16px 24px 24px !important;
  border-top: 2px solid rgba(0, 0, 0, 0.06) !important;
  margin: 0 !important;
}

.checkout #payment #place_order {
  width: 100% !important;
  height: 46px !important;
  background: #5acc5a !important;
  color: #fff !important;
  border: 0.4px solid #5acc5a !important;
  border-radius: 4px !important;
  font-size: 18px !important;
  font-weight: 400 !important;
  cursor: pointer;
  box-shadow: none !important;
  text-transform: none !important;
}

.checkout #payment #place_order:hover {
  background: #11aa4f !important;
  border-color: #11aa4f !important;
}

.checkout .ew-shipping-box {
  padding: 12px 24px 24px !important;
}

.checkout .ew-checkout-guest-bar,
.checkout .ew-checkout-shipping-header {
  padding: 16px 24px !important;
}

.checkout .ew-checkout-guest-bar .display-small {
  font-size: 16px;
  font-weight: 400;
  color: #0c2028;
  margin-bottom: 12px;
}

.checkout .ew-shipping-box .ew-section-title {
  margin-bottom: 16px;
}

.checkout .ew-checkout-fields {
  padding: 0;
}

.ew-cart-empty-state {
  background: #fff;
  padding: 24px;
}

.ew-cart-empty-state .return-to-shop {
  text-align: center;
  padding: 24px;
}

.ew-empty-cart-message {
  text-align: center;
  color: #647176;
  padding: 32px 24px;
}

@media (max-width: 640px) {
  .checkout .woocommerce-billing-fields__field-wrapper,
  .checkout .woocommerce-shipping-fields__field-wrapper {
    grid-template-columns: 1fr;
  }
}
