/* ==========================================================================
   WooCommerce Cart & Checkout Styles (Classic Shortcodes & Modern Support)
   ========================================================================== */

/* Screen Reader Text Utility (Hides technical header labels like 'Remove item') */
.screen-reader-text {
  border: 0 !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  -webkit-clip-path: inset(50%) !important;
  clip-path: inset(50%) !important;
  height: 1px !important;
  margin: -1px !important;
  overflow: hidden !important;
  padding: 0 !important;
  position: absolute !important;
  width: 1px !important;
  word-wrap: normal !important;
}

/* Expand static page width on Cart & Checkout pages */
.static-page-container:has(.woocommerce),
body.woocommerce-cart .static-page-container,
body.woocommerce-checkout .static-page-container {
  max-width: 1200px !important;
  padding-left: 20px !important;
  padding-right: 20px !important;
}

.woocommerce {
  width: 100%;
}

/* WooCommerce System Notices */
.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
  padding: 14px 20px;
  margin-bottom: 26px;
  background: #f8f8f8;
  border-left: 3px solid #1d1f21;
  font-size: 14px;
  color: #333333;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 2px;
  list-style: none;
}

.woocommerce-error {
  border-left-color: #d21936;
  background: #fff8f8;
}

.woocommerce-message a.button,
.woocommerce-info a.button {
  background: #1d1f21;
  color: #ffffff;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  border-radius: 2px;
}

/* Fix emoji images inside cart and titles */
img.emoji {
  display: inline !important;
  border: none !important;
  height: 1.1em !important;
  width: 1.1em !important;
  margin: 0 0.15em 0 0.15em !important;
  vertical-align: -0.15em !important;
  background: none !important;
  padding: 0 !important;
}

/* ==========================================================================
   1. CLASSIC CART SHORTCODE [woocommerce_cart]
   ========================================================================== */

/* Cart Layout Grid for Desktop */
@media (min-width: 992px) {
  .woocommerce:has(.woocommerce-cart-form),
  body.woocommerce-cart .page-article-content .woocommerce {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: flex-start;
    margin-bottom: 60px;
  }

  .woocommerce-notices-wrapper {
    grid-column: 1 / -1;
    width: 100%;
  }

  .woocommerce-cart-form {
    grid-column: 1;
    margin-bottom: 0;
  }

  .cart-collaterals {
    grid-column: 2;
  }
}

/* Cart Table */
table.shop_table.cart {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin-bottom: 30px;
  background: #ffffff;
}

table.shop_table.cart thead th {
  padding: 14px 12px;
  border-bottom: 2px solid #1d1f21;
  font-family: var(--title_font_family);
  font-size: 14px;
  font-weight: 600;
  color: var(--title_color);
  text-align: left;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

table.shop_table.cart thead th.product-remove {
  width: 32px;
  padding: 14px 4px;
}

table.shop_table.cart thead th.product-thumbnail {
  width: 90px;
  padding: 14px 8px;
}

table.shop_table.cart thead th.product-price,
table.shop_table.cart thead th.product-quantity,
table.shop_table.cart thead th.product-subtotal {
  text-align: center;
}

table.shop_table.cart tbody td {
  padding: 18px 12px;
  border-bottom: 1px solid #eeeeee;
  vertical-align: middle;
  font-size: 14px;
}

/* Remove Product Icon */
table.shop_table.cart td.product-remove {
  width: 32px;
  text-align: center;
  padding-left: 0;
  padding-right: 6px;
}

table.shop_table.cart td.product-remove a.remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #999999;
  font-size: 20px;
  line-height: 1;
  text-decoration: none;
  transition: all 0.2s ease;
}

table.shop_table.cart td.product-remove a.remove:hover {
  background-color: #f7f7f7;
  color: #d21936;
}

/* Product Thumbnail */
table.shop_table.cart td.product-thumbnail {
  width: 90px;
  padding: 16px 8px;
}

table.shop_table.cart td.product-thumbnail img,
.woocommerce-cart-form td.product-thumbnail img,
.wc-block-cart-item__image img,
.wc-block-components-product-image img {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px !important;
  max-height: 80px !important;
  min-width: 80px !important;
  min-height: 80px !important;
  object-fit: cover !important;
  border-radius: 4px !important;
  display: block !important;
  border: 1px solid #f0f0f0;
}

/* Product Name & Variations */
table.shop_table.cart td.product-name {
  font-family: var(--general_font_family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: #222222;
}

table.shop_table.cart td.product-name a {
  color: #1d1f21;
  transition: color 0.2s ease;
  font-weight: 500;
}

table.shop_table.cart td.product-name a:hover {
  color: #666666;
}

table.shop_table.cart td.product-name dl.variation {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #777777;
}

table.shop_table.cart td.product-name dl.variation dt {
  float: left;
  clear: left;
  font-weight: 600;
  margin-right: 4px;
}

table.shop_table.cart td.product-name dl.variation dd {
  margin: 0 0 2px 0;
}

/* Price & Subtotal */
table.shop_table.cart td.product-price {
  text-align: center;
  color: #666666;
  font-weight: 500;
  white-space: nowrap;
}

table.shop_table.cart td.product-subtotal {
  text-align: center;
  color: var(--buying_parice_color);
  font-weight: 700;
  font-size: 15px;
  white-space: nowrap;
}

/* Quantity input */
table.shop_table.cart td.product-quantity {
  text-align: center;
  white-space: nowrap;
}

table.shop_table.cart td.product-quantity .quantity {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

table.shop_table.cart td.product-quantity input.qty {
  width: 58px;
  height: 40px;
  text-align: center;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  color: #1d1f21;
  outline: none;
  box-sizing: border-box;
}

table.shop_table.cart td.product-quantity input.qty:focus {
  border-color: #1d1f21;
}

/* Actions Row: Coupon & Update Cart */
table.shop_table.cart td.actions {
  padding: 24px 0;
  border-bottom: none;
}

table.shop_table.cart td.actions .coupon {
  display: flex;
  align-items: center;
  gap: 10px;
  float: left;
}

table.shop_table.cart td.actions .coupon label {
  display: none;
}

table.shop_table.cart td.actions .coupon input.input-text {
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d0d0d0;
  border-radius: 3px;
  font-size: 13px;
  outline: none;
  width: 180px;
  box-sizing: border-box;
}

table.shop_table.cart td.actions .coupon input.input-text:focus {
  border-color: #1d1f21;
}

table.shop_table.cart td.actions button.button {
  height: 44px;
  padding: 0 22px;
  background-color: #1d1f21;
  color: #ffffff;
  border: 1px solid #1d1f21;
  border-radius: 3px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
}

table.shop_table.cart td.actions button.button:hover {
  background-color: #383838;
  border-color: #383838;
}

table.shop_table.cart td.actions button[name="update_cart"] {
  float: right;
  background-color: #ffffff;
  color: #1d1f21;
  border-color: #d0d0d0;
}

table.shop_table.cart td.actions button[name="update_cart"]:hover {
  background-color: #f5f5f5;
  border-color: #1d1f21;
}

table.shop_table.cart td.actions button[name="update_cart"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Cart Collaterals & Totals */
.cart-collaterals .cart_totals {
  background: #fbfbfb;
  border: 1px solid #ebebeb;
  border-radius: 4px;
  padding: 28px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.cart-collaterals .cart_totals h2 {
  font-family: var(--title_font_family);
  font-size: 22px;
  font-weight: 600;
  color: var(--title_color);
  margin-top: 0;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eaeaea;
}

.cart-collaterals .cart_totals table.shop_table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.cart-collaterals .cart_totals table.shop_table th,
.cart-collaterals .cart_totals table.shop_table td {
  padding: 14px 0;
  border-bottom: 1px solid #eaeaea;
  font-size: 14px;
  color: #444;
}

.cart-collaterals .cart_totals table.shop_table th {
  font-weight: 500;
  text-align: left;
}

.cart-collaterals .cart_totals table.shop_table td {
  text-align: right;
  font-weight: 600;
  color: #1d1f21;
}

.cart-collaterals .cart_totals table.shop_table tr.order-total th,
.cart-collaterals .cart_totals table.shop_table tr.order-total td {
  font-size: 18px;
  font-weight: 700;
  padding-top: 18px;
  border-bottom: none;
}

.cart-collaterals .cart_totals table.shop_table tr.order-total .amount {
  color: var(--buying_parice_color);
}

/* Proceed to Checkout Button */
.wc-proceed-to-checkout a.checkout-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 100% !important;
  height: 50px;
  background-color: #1d1f21 !important;
  color: #ffffff !important;
  border: 1px solid #1d1f21 !important;
  border-radius: 3px !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  box-sizing: border-box;
  transition: all 0.25s ease;
  margin-bottom: 14px;
}

.wc-proceed-to-checkout a.checkout-button:hover {
  background-color: #383838 !important;
  border-color: #383838 !important;
}

/* PayPal button in cart totals */
.cart-collaterals .cart_totals .wcppec-checkout-buttons,
.cart-collaterals .cart_totals [id*="paypal"],
.cart-collaterals .cart_totals .wc-proceed-to-checkout + * {
  text-align: center;
  margin-top: 10px;
}

/* Empty Cart View */
.woocommerce .wc-empty-cart-message,
.woocommerce .cart-empty {
  text-align: center;
  padding: 40px 20px;
  font-size: 18px;
  color: #666666;
  background: #fbfbfb;
  border: 1px solid #f0f0f0;
  border-radius: 4px;
  margin-bottom: 24px;
}

.woocommerce .return-to-shop {
  text-align: center;
  margin-bottom: 60px;
}

.woocommerce .return-to-shop a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background-color: #1d1f21;
  color: #ffffff;
  border-radius: 3px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.25s ease;
}

.woocommerce .return-to-shop a.button:hover {
  background-color: #383838;
}

/* ==========================================================================
   2. RESPONSIVE CART (Mobile Cards Layout for < 768px)
   ========================================================================== */
@media (max-width: 768px) {
  table.shop_table.cart thead {
    display: none;
  }

  table.shop_table.cart,
  table.shop_table.cart tbody {
    display: block;
    width: 100%;
  }

  table.shop_table.cart tr.woocommerce-cart-form__cart-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    grid-template-areas:
      "thumb name remove"
      "thumb meta remove"
      "thumb qty subtotal";
    gap: 10px 14px;
    padding: 18px 0;
    border-bottom: 1px solid #eeeeee;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
  }

  table.shop_table.cart td.product-thumbnail {
    grid-area: thumb;
    padding: 0;
    width: 80px;
  }

  table.shop_table.cart td.product-name {
    grid-area: name;
    padding: 0;
    font-size: 14px;
    line-height: 1.4;
  }

  table.shop_table.cart td.product-remove {
    grid-area: remove;
    padding: 0;
    text-align: right;
    align-self: start;
  }

  table.shop_table.cart td.product-price {
    display: none;
  }

  table.shop_table.cart td.product-quantity {
    grid-area: qty;
    padding: 0;
    text-align: left;
  }

  table.shop_table.cart td.product-subtotal {
    grid-area: subtotal;
    padding: 0;
    text-align: right;
    font-weight: 700;
    white-space: nowrap;
  }

  table.shop_table.cart td.actions {
    display: block;
    padding: 20px 0;
    width: 100%;
    box-sizing: border-box;
  }

  table.shop_table.cart td.actions .coupon {
    float: none;
    display: flex;
    width: 100%;
    margin-bottom: 12px;
    gap: 8px;
  }

  table.shop_table.cart td.actions .coupon input.input-text {
    flex: 1;
    width: auto;
  }

  table.shop_table.cart td.actions button.button {
    flex-shrink: 0;
  }

  table.shop_table.cart td.actions button[name="update_cart"] {
    float: none;
    width: 100%;
    height: 44px;
  }

  .cart-collaterals .cart_totals {
    padding: 20px 16px;
    margin-top: 10px;
  }
}

/* ==========================================================================
   3. CHECKOUT SHORTCODE [woocommerce_checkout]
   ========================================================================== */

/* Coupon toggle */
.woocommerce-form-coupon-toggle {
  margin-bottom: 24px;
}

form.checkout_coupon {
  display: flex;
  gap: 12px;
  max-width: 500px;
  margin-bottom: 30px;
  padding: 16px;
  background: #fdfdfd;
  border: 1px solid #e5e5e5;
  border-radius: 4px;
}

form.checkout_coupon input.input-text {
  flex: 1;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #ccc;
  border-radius: 2px;
}

form.checkout_coupon button.button {
  height: 42px;
  padding: 0 20px;
  background: #1d1f21;
  color: #fff;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

/* Checkout Grid */
form.woocommerce-checkout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 48px;
  align-items: flex-start;
  margin-top: 10px;
}

/* Headings */
form.woocommerce-checkout h3 {
  font-family: var(--title_font_family);
  font-size: 22px;
  font-weight: 600;
  color: var(--title_color);
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid #eeeeee;
}

/* Fields Wrapper */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper,
.woocommerce-additional-fields__field-wrapper,
#customer_details {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 20px;
}

/* Form Rows */
.woocommerce form .form-row,
.form-row,
.woocommerce-form-row {
  margin: 0;
  width: 100%;
  box-sizing: border-box;
  display: block;
}

.woocommerce form .form-row-first,
.form-row-first,
.woocommerce-form-row--first {
  width: calc(50% - 10px) !important;
  float: none;
}

.woocommerce form .form-row-last,
.form-row-last,
.woocommerce-form-row--last {
  width: calc(50% - 10px) !important;
  float: none;
}

.woocommerce form .form-row-wide,
.form-row-wide,
.woocommerce-form-row--wide {
  width: 100% !important;
  clear: both;
}

.woocommerce form .form-row label,
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 6px;
}

.woocommerce form .form-row label .required,
.form-row label .required {
  color: #d21936;
  text-decoration: none;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row textarea,
.woocommerce form .form-row select,
.form-row input.input-text,
.form-row textarea,
.form-row select,
.woocommerce-checkout .select2-container--default .select2-selection--single {
  width: 100% !important;
  height: 44px !important;
  line-height: 44px;
  padding: 0 14px !important;
  border: 1px solid #d0d0d0 !important;
  border-radius: 3px !important;
  background-color: #ffffff;
  font-size: 14px;
  color: #333;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus,
.woocommerce form .form-row select:focus,
.form-row input.input-text:focus,
.form-row textarea:focus,
.form-row select:focus,
.woocommerce-checkout .select2-container--default.select2-container--focus .select2-selection--single {
  border-color: #1d1f21 !important;
}

.woocommerce form .form-row textarea,
.form-row textarea {
  height: 100px !important;
  padding: 10px 14px !important;
  line-height: 1.5;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 42px !important;
  padding-left: 0 !important;
  color: #333 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 42px !important;
}

/* Right Column: Order Review Box */
#order_review_heading {
  display: none;
}

#order_review {
  background: #fbfbfb;
  border: 1px solid #ebebeb;
  border-radius: 4px;
  padding: 28px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

#order_review::before {
  content: "Your order";
  display: block;
  font-family: var(--title_font_family);
  font-size: 22px;
  font-weight: 600;
  color: var(--title_color);
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid #eaeaea;
}

table.woocommerce-checkout-review-order-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

table.woocommerce-checkout-review-order-table th,
table.woocommerce-checkout-review-order-table td {
  padding: 14px 0;
  border-bottom: 1px solid #eaeaea;
  font-size: 14px;
  color: #444;
  vertical-align: middle;
}

table.woocommerce-checkout-review-order-table thead th {
  font-size: 13px;
  text-transform: uppercase;
  color: #888;
  letter-spacing: 0.5px;
  font-weight: 600;
}

table.woocommerce-checkout-review-order-table th:last-child,
table.woocommerce-checkout-review-order-table td:last-child {
  text-align: right;
  font-weight: 600;
  color: #1d1f21;
}

table.woocommerce-checkout-review-order-table .product-name {
  line-height: 1.4;
}

table.woocommerce-checkout-review-order-table .product-quantity {
  font-weight: 400;
  color: #888;
}

table.woocommerce-checkout-review-order-table tfoot tr.cart-subtotal th,
table.woocommerce-checkout-review-order-table tfoot tr.cart-subtotal td {
  font-weight: 500;
}

table.woocommerce-checkout-review-order-table tfoot tr.order-total th,
table.woocommerce-checkout-review-order-table tfoot tr.order-total td {
  font-size: 17px;
  font-weight: 700;
  color: #1d1f21;
  border-bottom: none;
  padding-top: 18px;
}

table.woocommerce-checkout-review-order-table tfoot tr.order-total .amount {
  color: var(--buying_parice_color);
}

#payment {
  background: transparent;
  border-top: 1px solid #eaeaea;
  padding-top: 20px;
}

#payment ul.payment_methods {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
}

#payment ul.payment_methods li {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

#payment ul.payment_methods li:last-child {
  border-bottom: none;
}

#payment ul.payment_methods li input[type="radio"] {
  margin-right: 8px;
  accent-color: #1d1f21;
}

#payment ul.payment_methods li label {
  font-size: 14px;
  font-weight: 600;
  color: #222;
  cursor: pointer;
}

#payment ul.payment_methods li .payment_box {
  background: #f2f2f2;
  border-radius: 4px;
  padding: 12px 16px;
  font-size: 13px;
  color: #555;
  margin-top: 10px;
  line-height: 1.5;
}

#payment #place_order {
  width: 100%;
  height: 50px;
  background-color: #1d1f21;
  color: #ffffff;
  border: 1px solid #1d1f21;
  border-radius: 3px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.25s ease;
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#payment #place_order:hover {
  background-color: #383838;
  border-color: #383838;
}

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

@media (max-width: 991px) {
  form.woocommerce-checkout {
    grid-template-columns: 1fr;
    gap: 36px;
  }
}

@media (max-width: 600px) {
  .woocommerce form .form-row-first,
  .woocommerce form .form-row-last,
  .form-row-first,
  .form-row-last {
    width: 100% !important;
  }
  #order_review {
    padding: 20px 16px;
  }
}
