/**
 * TES CERAMIC Woo Tools — frontend styles.
 */

/* ------------------------------------------------------------
 * Price units
 * ------------------------------------------------------------ */

.tes-price-unit {
  font-size: 0.9em;
  opacity: 0.85;
  white-space: nowrap;
}

/* ------------------------------------------------------------
 * Single product package notice
 * ------------------------------------------------------------ */

.single-product form.cart input.qty {
  width: 7.8em;
  min-width: 108px;
}

.tes-single-package-notice {
  margin: 22px 0 14px;
  line-height: 1.5;
  font-size: 16px;
  color: #5f6b7a;
}

.tes-single-package-notice strong {
  font-weight: 700;
  color: #142333;
}

/* ------------------------------------------------------------
 * Cart units
 * ------------------------------------------------------------ */

.woocommerce-cart table.cart td.product-price,
.woocommerce-cart table.cart td.product-quantity {
  white-space: nowrap;
}

.woocommerce-cart table.cart td.product-price {
  min-width: 130px;
}

.woocommerce-cart table.cart td.product-quantity {
  min-width: 120px;
}

.woocommerce-cart table.cart input.qty,
.woocommerce-checkout table.shop_table input.qty {
  width: 7.8em;
  min-width: 108px;
}

.woocommerce-cart .product-price .tes-cart-price-unit {
  display: inline;
  margin-left: 2px;
  white-space: nowrap;
  font-size: inherit;
  line-height: inherit;
}

.woocommerce-cart .tes-cart-qty-wrap {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.woocommerce-cart .product-quantity .quantity {
  display: inline-flex !important;
  align-items: center;
  vertical-align: middle;
  margin-right: 6px;
}

.woocommerce-cart .product-quantity .tes-cart-qty-unit {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  margin-left: 4px;
  font-weight: 600;
  white-space: nowrap;
}

/* ------------------------------------------------------------
 * Cart line meta / weight rows
 * ------------------------------------------------------------ */

.tes-cart-line-meta {
  margin-top: 6px;
  line-height: 1.4;
  opacity: 0.85;
}

.tes-goods-weight-row th,
.tes-goods-weight-row td,
.tes-admin-logistics-weight-row th,
.tes-admin-logistics-weight-row td {
  vertical-align: top;
}

/* ------------------------------------------------------------
 * Free delivery box
 * ------------------------------------------------------------ */

.tes-free-delivery-box {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid #d7e3d0;
  border-radius: 10px;
  background: #f6fbf3;
  line-height: 1.5;
}

.tes-free-delivery-box strong {
  font-weight: 700;
}

.tes-free-delivery-box small {
  display: inline-block;
  margin-top: 6px;
  opacity: 0.75;
}

/* ------------------------------------------------------------
 * Package notice in cart
 * ------------------------------------------------------------ */

.tes-package-notice {
  margin: 0 0 18px;
  padding: 12px 14px;
  border: 1px solid #dbe3ec;
  border-radius: 10px;
  background: #f7f9fc;
  line-height: 1.5;
}

.tes-package-notice strong {
  font-weight: 700;
}

/* ------------------------------------------------------------
 * Continue shopping button
 * ------------------------------------------------------------ */

.tes-cart-continue-shopping {
  margin-top: 24px;
  margin-bottom: 24px;
}

/* ------------------------------------------------------------
 * Checkout 24h banner
 * ------------------------------------------------------------ */

.tes-checkout-24h-banner {
  display: none;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid #d9ead3;
  border-radius: 12px;
  background: #f3fbf0;
  color: #1f3d1f;
  font-size: 15px;
  line-height: 1.4;
}

.tes-checkout-24h-banner.is-visible {
  display: flex;
}

.tes-checkout-24h-banner__icon {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
}

.tes-checkout-24h-banner__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tes-checkout-24h-banner__text strong {
  font-weight: 700;
}

/* ------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------ */

@media (max-width: 768px) {
  .woocommerce-cart table.cart td.product-price,
  .woocommerce-cart table.cart td.product-quantity {
    white-space: normal;
  }

  .woocommerce-cart .product-price .tes-cart-price-unit,
  .woocommerce-cart .product-quantity .tes-cart-qty-unit {
    white-space: nowrap;
  }
}

@media (max-width: 600px) {
  .tes-checkout-24h-banner {
    align-items: flex-start;
    padding: 12px 14px;
    margin-bottom: 18px;
  }
}

.tes-unique-price-delivery-notice {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(150, 115, 60, 0.28);
  border-radius: 12px;
  background: #fff8ed;
  font-size: 15px;
  line-height: 1.45;
}

.tes-unique-price-delivery-notice__title {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  color: #132f4c;
}

.tes-unique-price-delivery-notice__text {
  display: block;
  color: #132f4c;
}

.tes-unique-price-delivery-notice__text strong {
  font-weight: 700;
}

.woocommerce-cart .tes-unique-price-delivery-notice-row td {
  padding: 10px 0 18px;
  border: 0;
}

.tes-checkout-edit-order-row td {
  padding: 18px 0 22px;
  border: 0;
  text-align: center;
}

.tes-checkout-edit-order-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 24px;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
  margin: 12px 0;
}

/* Мобільний: кнопка широка, щоб було зручно натискати */
@media (max-width: 767px) {
  .tes-checkout-edit-order-button {
    width: 100%;
  }
}

/* Планшет і десктоп: не розтягуємо на всю ширину */
@media (min-width: 768px) {
  .tes-checkout-edit-order-button {
    width: auto;
    min-width: 280px;
    max-width: 360px;
  }
}

/* Custom WooCommerce quantity +/- buttons */

.woocommerce .quantity {
  --tes-qty-height: 44px;
  --tes-qty-button-width: 42px;
  --tes-qty-input-width: 112px;
  --tes-qty-border: #cbd5df;
  --tes-qty-border-hover: #9aacbd;
  --tes-qty-text: #132f4c;
  --tes-qty-bg: #ffffff;
  --tes-qty-button-bg: #ffffff;
  --tes-qty-button-bg-hover: #f3f6f9;

  display: inline-grid !important;
  grid-template-columns:
    var(--tes-qty-button-width)
    var(--tes-qty-input-width)
    var(--tes-qty-button-width);
  align-items: stretch;
  width: auto;
  max-width: 100%;
  margin: 0;
  vertical-align: middle;
}

.woocommerce .quantity .tes-quantity-button,
.woocommerce .quantity input.qty {
  box-sizing: border-box !important;
  height: var(--tes-qty-height) !important;
  min-height: var(--tes-qty-height) !important;
  max-height: var(--tes-qty-height) !important;
  margin: 0 !important;
  box-shadow: none !important;
}

.woocommerce .quantity .tes-quantity-button {
  appearance: none;
  width: var(--tes-qty-button-width) !important;
  min-width: var(--tes-qty-button-width) !important;
  padding: 0 !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  border: 1px solid var(--tes-qty-border) !important;
  background: var(--tes-qty-button-bg) !important;
  color: var(--tes-qty-text) !important;

  font-size: 19px !important;
  font-weight: 600 !important;
  line-height: 1 !important;

  cursor: pointer;
  opacity: 1 !important;
}

.woocommerce .quantity .tes-quantity-button--minus {
  border-radius: 7px 0 0 7px !important;
  border-right: 0 !important;
}

.woocommerce .quantity .tes-quantity-button--plus {
  border-radius: 0 7px 7px 0 !important;
  border-left: 0 !important;
}

.woocommerce .quantity .tes-quantity-button:hover,
.woocommerce .quantity .tes-quantity-button:focus {
  background: var(--tes-qty-button-bg-hover) !important;
  color: #0b1f33 !important;
  border-color: var(--tes-qty-border-hover) !important;
}

.woocommerce .quantity input.qty {
  width: var(--tes-qty-input-width) !important;
  min-width: 0 !important;
  padding: 0 10px !important;

  text-align: center;
  border: 1px solid var(--tes-qty-border) !important;
  border-radius: 0 !important;
  background: var(--tes-qty-bg) !important;
  color: var(--tes-qty-text) !important;

  font-size: 15px !important;
  font-weight: 400 !important;
  line-height: var(--tes-qty-height) !important;
}

.woocommerce .quantity input.qty:focus {
  outline: none;
  border-color: var(--tes-qty-border-hover) !important;
  box-shadow: 0 0 0 2px rgba(19, 47, 76, 0.06) !important;
}

.woocommerce .quantity input.qty::-webkit-outer-spin-button,
.woocommerce .quantity input.qty::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.woocommerce .quantity input.qty {
  -moz-appearance: textfield;
}

/* Cart alignment */

.woocommerce-cart table.cart td.product-quantity .quantity {
  justify-content: flex-start;
}

/* Cart layout fix: allow long product names to wrap */

.woocommerce-cart table.cart td.product-name,
.woocommerce-cart table.cart td.product-name > a {
  white-space: normal !important;
}

.woocommerce-cart table.cart td.product-name > a {
  overflow-wrap: anywhere;
  word-break: normal;
}

.woocommerce-cart .tes-cart-line-meta,
.woocommerce-cart .tes-cart-line-meta div {
  white-space: normal !important;
}

.woocommerce-cart table.cart td.product-quantity {
  white-space: nowrap;
}

.woocommerce-cart .tes-cart-qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Single product alignment with add-to-cart button */

.single-product form.cart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.single-product form.cart .quantity {
  margin-right: 0 !important;
}

.single-product form.cart .single_add_to_cart_button {
  min-height: 44px;
}

/* Mobile */

@media (max-width: 768px) {
  .woocommerce .quantity {
    --tes-qty-height: 44px;
    --tes-qty-button-width: 42px;
    --tes-qty-input-width: minmax(92px, 1fr);

    grid-template-columns:
      var(--tes-qty-button-width)
      var(--tes-qty-input-width)
      var(--tes-qty-button-width);
    width: 100%;
    max-width: 224px;
  }

  .woocommerce .quantity input.qty {
    width: 100% !important;
  }
}

/* Cart quantity compact mode */

@media (min-width: 769px) {
  .woocommerce-cart table.cart td.product-quantity .quantity {
    --tes-qty-height: 40px;
    --tes-qty-button-width: 36px;
    --tes-qty-input-width: 92px;

    grid-template-columns:
      var(--tes-qty-button-width)
      var(--tes-qty-input-width)
      var(--tes-qty-button-width);

    width: auto;
    max-width: 164px;
  }

  .woocommerce-cart
    table.cart
    td.product-quantity
    .quantity
    .tes-quantity-button {
    font-size: 18px !important;
  }

  .woocommerce-cart table.cart td.product-quantity .quantity input.qty {
    font-size: 14px !important;
    padding: 0 8px !important;
  }
}

.tes-is-checking-cart {
  pointer-events: none;
  opacity: 0.6;
  cursor: wait !important;
}

@media (max-width: 768px) {
  .woocommerce
    table.shop_table_responsive
    td:has(.tes-free-delivery-box)::before,
  .woocommerce-page
    table.shop_table_responsive
    td:has(.tes-free-delivery-box)::before {
    content: none !important;
    display: none !important;
  }
}
