/**
 * Codersly Shop Add-on — Licensed Pro Cart & Checkout UI
 * Version stays aligned with plugin 1.0.5.
 */

body.codersly-premium-commerce-ui{
  --cdly-commerce-surface:#fff;
  --cdly-commerce-soft:#f8fafc;
  --cdly-commerce-border:#d9dee7;
  --cdly-commerce-border-strong:#c6ced9;
  --cdly-commerce-text:var(--bt-color-text,#111827);
  --cdly-commerce-muted:#667085;
  --cdly-commerce-accent:var(--bt-color-checkout,var(--bt-color-primary,#2563eb));
  --cdly-commerce-radius:12px;
  --cdly-commerce-shadow:0 10px 32px rgba(15,23,42,.055);
  --cdly-commerce-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif;
}

/* The Pro UI deliberately matches Codersly Shop's own base font stack so page
   builder / block typography cannot make Cart and Checkout differ by domain. */
body.codersly-premium-commerce-ui .woocommerce,
body.codersly-premium-commerce-ui .woocommerce button,
body.codersly-premium-commerce-ui .woocommerce input,
body.codersly-premium-commerce-ui .woocommerce select,
body.codersly-premium-commerce-ui .woocommerce textarea,
body.codersly-premium-commerce-ui .woocommerce table,
body.codersly-premium-commerce-ui .woocommerce label{
  font-family:var(--cdly-commerce-font)!important;
  color:var(--cdly-commerce-text);
}

body.codersly-premium-commerce-ui .site-main,
body.codersly-premium-commerce-ui .content-area,
body.codersly-premium-commerce-ui .site-content{
  padding-top:28px;
}

body.codersly-premium-commerce-ui .woocommerce-notices-wrapper,
body.codersly-premium-commerce-ui .woocommerce-message,
body.codersly-premium-commerce-ui .woocommerce-error,
body.codersly-premium-commerce-ui .woocommerce-info{
  font-family:var(--cdly-commerce-font)!important;
}

/* ========================================================================== */
/* CART — licensed Pro layout                                                  */
/* ========================================================================== */
body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce{
  width:min(1120px,calc(100% - 32px));
  margin:0 auto;
  display:grid;
  grid-template-columns:minmax(0,1.7fr) minmax(300px,.86fr);
  column-gap:48px;
  row-gap:22px;
  align-items:start;
}

body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce > .woocommerce-notices-wrapper,
body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce > .woocommerce-message,
body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce > .woocommerce-error,
body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce > .woocommerce-info,
body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce > .cart-empty,
body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce > .return-to-shop{
  grid-column:1 / -1;
}

body.woocommerce-cart.codersly-premium-commerce-ui form.woocommerce-cart-form{
  grid-column:1;
  min-width:0;
  margin:0;
}

body.woocommerce-cart.codersly-premium-commerce-ui .cart-collaterals{
  grid-column:2;
  width:100%;
  margin:0;
}

body.woocommerce-cart.codersly-premium-commerce-ui table.shop_table{
  width:100%;
  margin:0;
  border:0;
  border-collapse:collapse;
  border-spacing:0;
  background:transparent;
}

body.woocommerce-cart.codersly-premium-commerce-ui table.shop_table th,
body.woocommerce-cart.codersly-premium-commerce-ui table.shop_table td{
  padding:15px 10px;
  border:0;
  border-bottom:1px solid var(--cdly-commerce-border);
  vertical-align:middle;
}

body.woocommerce-cart.codersly-premium-commerce-ui table.shop_table thead th{
  padding-top:6px;
  font-size:13px;
  line-height:1.3;
  text-transform:uppercase;
  letter-spacing:.02em;
  color:var(--cdly-commerce-muted);
  font-weight:700;
}

body.woocommerce-cart.codersly-premium-commerce-ui .product-remove a{
  text-decoration:none;
}

body.woocommerce-cart.codersly-premium-commerce-ui .product-thumbnail img{
  width:64px;
  height:auto;
  border-radius:8px;
}

body.woocommerce-cart.codersly-premium-commerce-ui .product-name a{
  font-weight:600;
}

body.woocommerce-cart.codersly-premium-commerce-ui .quantity .qty{
  min-height:40px;
  border:1px solid var(--cdly-commerce-border-strong)!important;
  border-radius:8px;
  background:#fff;
  box-shadow:none!important;
}

/* Coupon remains on the LEFT. Quantity changes auto-submit WooCommerce's hidden update action. */
body.woocommerce-cart.codersly-premium-commerce-ui td.actions{
  padding:18px 0 0;
  border-bottom:0!important;
}

body.woocommerce-cart.codersly-premium-commerce-ui td.actions > button[name="update_cart"],
body.woocommerce-cart.codersly-premium-commerce-ui td.actions > input[name="update_cart"]{
  display:none!important;
}

body.woocommerce-cart.codersly-premium-commerce-ui td.actions .coupon{
  display:flex;
  float:left;
  align-items:center;
  gap:10px;
  max-width:430px;
}

body.woocommerce-cart.codersly-premium-commerce-ui td.actions .coupon input.input-text{
  width:210px!important;
  height:44px!important;
  min-height:44px!important;
  margin:0!important;
  padding:0 12px!important;
  border:1px solid var(--cdly-commerce-border-strong)!important;
  border-radius:8px!important;
  background:#fff!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
}

body.woocommerce-cart.codersly-premium-commerce-ui td.actions .coupon .button{
  height:44px!important;
  min-height:44px!important;
  padding:0 18px!important;
  border:0!important;
  border-radius:8px!important;
  box-sizing:border-box!important;
  font-weight:700!important;
}

body.woocommerce-cart.codersly-premium-commerce-ui td.actions .coupon .button{
  background:var(--cdly-commerce-accent)!important;
  color:#fff!important;
}


body.woocommerce-cart.codersly-premium-commerce-ui .cart-collaterals .cart_totals{
  float:none!important;
  width:100%!important;
  margin:0!important;
  padding:24px!important;
  background:var(--cdly-commerce-surface);
  border:1px solid var(--cdly-commerce-border)!important;
  border-radius:var(--cdly-commerce-radius);
  box-shadow:var(--cdly-commerce-shadow);
}

body.woocommerce-cart.codersly-premium-commerce-ui .cart_totals h2{
  margin:0 0 12px;
  font-size:20px;
  line-height:1.3;
}

body.woocommerce-cart.codersly-premium-commerce-ui .cart_totals table th,
body.woocommerce-cart.codersly-premium-commerce-ui .cart_totals table td{
  padding:14px 8px;
}

body.woocommerce-cart.codersly-premium-commerce-ui .cart_totals .checkout-button{
  display:flex!important;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:52px;
  margin:18px 0 0!important;
  padding:12px 18px!important;
  border:0!important;
  border-radius:9px!important;
  background:var(--cdly-commerce-accent)!important;
  color:#fff!important;
  font-size:16px!important;
  font-weight:700!important;
  line-height:1.3!important;
  text-align:center;
  text-decoration:none!important;
}

/* ========================================================================== */
/* CHECKOUT — licensed Pro layout                                              */
/* ========================================================================== */
body.woocommerce-checkout.codersly-premium-commerce-ui .woocommerce form.checkout{
  width:min(1180px,calc(100% - 32px));
  margin:0 auto;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .woocommerce-form-coupon-toggle,
body.woocommerce-checkout.codersly-premium-commerce-ui form.checkout_coupon{
  display:none!important;
}

body.woocommerce-checkout.codersly-premium-commerce-ui #customer_details,
body.woocommerce-checkout.codersly-premium-commerce-ui #order_review{
  background:var(--cdly-commerce-surface);
  border:1px solid var(--cdly-commerce-border);
  border-radius:var(--cdly-commerce-radius);
  padding:22px;
  box-shadow:var(--cdly-commerce-shadow);
}

body.woocommerce-checkout.codersly-premium-commerce-ui input[type="text"],
body.woocommerce-checkout.codersly-premium-commerce-ui input[type="email"],
body.woocommerce-checkout.codersly-premium-commerce-ui input[type="tel"],
body.woocommerce-checkout.codersly-premium-commerce-ui input[type="password"],
body.woocommerce-checkout.codersly-premium-commerce-ui select,
body.woocommerce-checkout.codersly-premium-commerce-ui textarea{
  min-height:46px;
  padding:10px 12px;
  border:1px solid var(--cdly-commerce-border-strong)!important;
  border-radius:9px!important;
  background:#fff!important;
  box-shadow:none!important;
  box-sizing:border-box;
}

body.woocommerce-checkout.codersly-premium-commerce-ui textarea{
  min-height:110px;
}

body.woocommerce-checkout.codersly-premium-commerce-ui input:focus,
body.woocommerce-checkout.codersly-premium-commerce-ui select:focus,
body.woocommerce-checkout.codersly-premium-commerce-ui textarea:focus{
  outline:2px solid rgba(37,99,235,.14);
  outline-offset:1px;
  border-color:var(--cdly-commerce-accent)!important;
}

body.woocommerce-checkout.codersly-premium-commerce-ui h3{
  margin:0 0 16px;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .woocommerce-checkout-review-order-table{
  width:100%;
  margin:0;
  border:0!important;
  border-collapse:collapse;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .woocommerce-checkout-review-order-table th,
body.woocommerce-checkout.codersly-premium-commerce-ui .woocommerce-checkout-review-order-table td{
  padding:12px 8px;
  border:0;
  border-bottom:1px solid var(--cdly-commerce-border);
  vertical-align:middle;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .woocommerce-checkout-review-order-table td{
  text-align:right;
}

/* Coupon lives INSIDE order totals directly below Total. It is intentionally compact. */
body.woocommerce-checkout.codersly-premium-commerce-ui tr.codersly-pro-checkout-coupon-row th,
body.woocommerce-checkout.codersly-premium-commerce-ui tr.codersly-pro-checkout-coupon-row td{
  padding-top:11px;
  padding-bottom:11px;
}

body.woocommerce-checkout.codersly-premium-commerce-ui tr.codersly-pro-checkout-coupon-row th{
  width:34%;
  font-weight:700;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-controls{
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:7px;
  width:100%;
}

body.woocommerce-checkout.codersly-premium-commerce-ui input.codersly-pro-checkout-coupon-input{
  flex:1 1 130px;
  width:100%;
  max-width:180px;
  height:38px!important;
  min-height:38px!important;
  padding:0 9px!important;
  border:1px solid var(--cdly-commerce-border-strong)!important;
  border-radius:7px!important;
  background:#fff!important;
  font-size:13px!important;
  line-height:38px!important;
}

body.woocommerce-checkout.codersly-premium-commerce-ui button.codersly-pro-checkout-coupon-button{
  flex:0 0 auto;
  height:38px!important;
  min-height:38px!important;
  margin:0!important;
  padding:0 12px!important;
  border:0!important;
  border-radius:7px!important;
  background:var(--cdly-commerce-accent)!important;
  color:#fff!important;
  font-size:13px!important;
  font-weight:700!important;
  line-height:38px!important;
  box-shadow:none!important;
  box-sizing:border-box!important;
}

body.woocommerce-checkout.codersly-premium-commerce-ui button.codersly-pro-checkout-coupon-button:disabled{
  opacity:.65;
  cursor:wait;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message{
  margin-top:6px;
  font-size:12px;
  line-height:1.35;
  text-align:left;
  color:var(--cdly-commerce-muted);
}

body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message:empty{
  display:none;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message .woocommerce-error,
body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message .woocommerce-message,
body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message .woocommerce-info{
  margin:0!important;
  padding:6px 8px!important;
  border:0!important;
  background:transparent!important;
  font-size:12px!important;
  box-shadow:none!important;
}

body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message .woocommerce-error::before,
body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message .woocommerce-message::before,
body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-message .woocommerce-info::before{
  display:none!important;
}

body.woocommerce-checkout.codersly-premium-commerce-ui #payment{
  margin-top:18px;
  background:var(--cdly-commerce-soft)!important;
  border-radius:10px!important;
}

body.woocommerce-checkout.codersly-premium-commerce-ui #payment .payment_box{
  border-radius:8px;
}

body.woocommerce-checkout.codersly-premium-commerce-ui #place_order{
  width:100%;
  min-height:52px;
  padding:13px 18px!important;
  border:0!important;
  border-radius:9px!important;
  background:var(--cdly-commerce-accent)!important;
  color:#fff!important;
  font-size:16px!important;
  font-weight:700!important;
}

@media (min-width:992px){
  body.woocommerce-checkout.codersly-premium-commerce-ui #order_review_heading{
    display:none!important;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui form.woocommerce-checkout{
    display:flex!important;
    flex-wrap:wrap!important;
    gap:3%!important;
    align-items:flex-start;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui form.woocommerce-checkout > .woocommerce-NoticeGroup,
  body.woocommerce-checkout.codersly-premium-commerce-ui form.woocommerce-checkout > .woocommerce-notices-wrapper,
  body.woocommerce-checkout.codersly-premium-commerce-ui form.woocommerce-checkout > ul.woocommerce-error,
  body.woocommerce-checkout.codersly-premium-commerce-ui form.woocommerce-checkout > .woocommerce-error,
  body.woocommerce-checkout.codersly-premium-commerce-ui form.woocommerce-checkout > .woocommerce-message,
  body.woocommerce-checkout.codersly-premium-commerce-ui form.woocommerce-checkout > .woocommerce-info{
    flex:0 0 100%!important;
    max-width:100%!important;
    order:-1;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui #customer_details{
    flex:0 0 55%!important;
    max-width:55%!important;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui #order_review{
    flex:0 0 42%!important;
    max-width:42%!important;
    margin-left:auto!important;
    position:sticky;
    top:100px;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui #order_review::before{
    content:"Your order";
    display:block;
    margin:0 0 14px;
    font-size:20px;
    line-height:1.3;
    font-weight:700;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui #customer_details .col2-set{
    display:block!important;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui #customer_details .col-1,
  body.woocommerce-checkout.codersly-premium-commerce-ui #customer_details .col-2{
    float:none!important;
    width:100%!important;
    max-width:100%!important;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui #customer_details .col-2{
    margin-top:22px;
  }
}

/* ========================================================================== */
/* Order received / thank-you                                                  */
/* ========================================================================== */
body.woocommerce-order-received.codersly-premium-commerce-ui .woocommerce-order{
  width:min(900px,calc(100% - 32px));
  margin:0 auto;
}

body.woocommerce-order-received.codersly-premium-commerce-ui .woocommerce-thankyou-order-received,
body.woocommerce-order-received.codersly-premium-commerce-ui ul.woocommerce-order-overview,
body.woocommerce-order-received.codersly-premium-commerce-ui table.woocommerce-table--order-details,
body.woocommerce-order-received.codersly-premium-commerce-ui .woocommerce-customer-details address{
  background:var(--cdly-commerce-surface);
  border:1px solid var(--cdly-commerce-border);
  border-radius:var(--cdly-commerce-radius);
  box-shadow:var(--cdly-commerce-shadow);
}

body.woocommerce-order-received.codersly-premium-commerce-ui .woocommerce-thankyou-order-received{
  padding:18px 20px;
}

body.woocommerce-order-received.codersly-premium-commerce-ui ul.woocommerce-order-overview{
  padding:18px 20px;
}

/* ========================================================================== */
/* Responsive                                                                  */
/* ========================================================================== */
@media (max-width:991px){
  body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce{
    grid-template-columns:1fr;
    row-gap:28px;
  }

  body.woocommerce-cart.codersly-premium-commerce-ui form.woocommerce-cart-form,
  body.woocommerce-cart.codersly-premium-commerce-ui .cart-collaterals{
    grid-column:1;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui #customer_details,
  body.woocommerce-checkout.codersly-premium-commerce-ui #order_review{
    padding:18px;
  }
}

@media (max-width:600px){
  body.woocommerce-cart.codersly-premium-commerce-ui .woocommerce,
  body.woocommerce-checkout.codersly-premium-commerce-ui .woocommerce form.checkout{
    width:calc(100% - 20px);
  }

  body.woocommerce-cart.codersly-premium-commerce-ui td.actions .coupon{
    float:none;
    display:grid;
    grid-template-columns:minmax(0,1fr) auto;
    width:100%;
    max-width:none;
  }

  body.woocommerce-cart.codersly-premium-commerce-ui td.actions .coupon input.input-text{
    width:100%!important;
  }


  body.woocommerce-cart.codersly-premium-commerce-ui .cart-collaterals .cart_totals{
    padding:16px!important;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui .codersly-pro-checkout-coupon-controls{
    gap:6px;
  }

  body.woocommerce-checkout.codersly-premium-commerce-ui input.codersly-pro-checkout-coupon-input{
    max-width:none;
    min-width:0;
  }
}
