/* Cart page — aligned with product-v2 visual language */
.tecsalab-cart,
body.woocommerce-cart {
  --cart-accent: #663DA5;
  --cart-accent-hover: #552e8a;
  --cart-accent-soft: #F4EEFF;
  --cart-border: #E4E7ED;
  --cart-bg: #F8F9FB;
  --cart-text: #1A1D23;
  --cart-muted: #8A919E;
}

body.woocommerce-cart {
  background: var(--cart-bg);
}

body.woocommerce-cart .site-main > .container.mx-auto {
  max-width: 1200px;
}

.tecsalab-cart {
  margin: 0 0 48px;
}

.tecsalab-cart__inner {
  width: 100%;
}

.tecsalab-cart__header {
  margin-bottom: 24px;
}

.tecsalab-cart__title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cart-text);
  line-height: 1.2;
}

.tecsalab-cart__subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--cart-muted);
}

.tecsalab-cart__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 24px;
  align-items: start;
}

.tecsalab-cart-table-wrap,
.tecsalab-cart-totals {
  background: #fff;
  border: 1px solid var(--cart-border);
  border-radius: 12px;
  overflow: hidden;
}

.tecsalab-cart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
}

.tecsalab-cart-table thead th {
  padding: 14px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cart-muted);
  background: #fff;
  border-bottom: 1px solid var(--cart-border);
}

.tecsalab-cart-table tbody td {
  padding: 18px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--cart-border);
  color: var(--cart-text);
  font-size: 14px;
}

.tecsalab-cart-table tbody tr.cart_item:last-of-type td {
  border-bottom: 1px solid var(--cart-border);
}

.tecsalab-cart-table tbody tr.cart_item:hover {
  background: #FCFBFE;
}

.tecsalab-cart-table .product-thumbnail img,
body.woocommerce-cart table.cart img {
  width: 72px !important;
  height: 72px !important;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--cart-border);
  background: #fff;
  margin: 0 !important;
  box-shadow: none;
}

.tecsalab-cart-table .product-name a {
  color: var(--cart-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14.5px;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.tecsalab-cart-table .product-name a:hover {
  color: var(--cart-accent);
}

.tecsalab-cart-table .product-name .variation,
.tecsalab-cart-table .product-name dl.variation {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--cart-muted);
}

.tecsalab-cart-table .product-price,
.tecsalab-cart-table .product-subtotal {
  font-weight: 600;
  white-space: nowrap;
}

.tecsalab-cart-table .product-subtotal {
  color: var(--cart-accent);
}

.tecsalab-cart-table .quantity {
  margin: 0;
}

.tecsalab-cart-table .quantity .qty {
  width: 64px;
  height: 40px;
  padding: 0 8px;
  text-align: center;
  border: 1px solid var(--cart-border);
  border-radius: 8px;
  background: #fff;
  color: var(--cart-text);
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tecsalab-cart-table .quantity .qty:focus {
  border-color: var(--cart-accent);
  box-shadow: 0 0 0 3px rgba(102, 61, 165, 0.12);
}

.tecsalab-cart-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--cart-border);
  color: var(--cart-muted);
  background: #fff;
  text-decoration: none !important;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tecsalab-cart-remove:hover {
  color: #B91C1C;
  border-color: #FECACA;
  background: #FEF2F2;
  transform: none;
}

.tecsalab-cart-actions-row td {
  padding: 0 !important;
  border-bottom: none !important;
}

.tecsalab-cart-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: #FAFBFC;
  border-top: 1px solid var(--cart-border);
}

.tecsalab-cart-coupon {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
}

.tecsalab-cart-coupon .input-text {
  min-width: 180px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--cart-border);
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  color: var(--cart-text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tecsalab-cart-coupon .input-text:focus {
  border-color: var(--cart-accent);
  box-shadow: 0 0 0 3px rgba(102, 61, 165, 0.12);
}

.tecsalab-cart-btn,
.tecsalab-cart-totals .checkout-button {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: 42px !important;
  min-height: 42px !important;
  padding: 0 18px !important;
  margin: 0 !important;
  border-radius: 9px !important;
  border-width: 1.5px !important;
  border-style: solid !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  font-family: inherit !important;
  line-height: 1.2 !important;
  letter-spacing: normal !important;
  text-align: center !important;
  text-decoration: none !important;
  vertical-align: middle !important;
  white-space: nowrap !important;
  cursor: pointer;
  box-shadow: none !important;
  transform: none !important;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease !important;
}

.tecsalab-cart-btn--primary,
.tecsalab-cart-totals .checkout-button {
  background: var(--cart-accent) !important;
  color: #fff !important;
  border-color: var(--cart-accent) !important;
}

.tecsalab-cart-btn--primary:hover,
.tecsalab-cart-totals .checkout-button:hover {
  background: var(--cart-accent-hover) !important;
  border-color: var(--cart-accent-hover) !important;
  color: #fff !important;
}

.tecsalab-cart-btn--outline,
.tecsalab-cart-btn.update_cart {
  background: #fff !important;
  color: var(--cart-accent) !important;
  border-color: var(--cart-accent) !important;
}

.tecsalab-cart-btn--outline:hover,
.tecsalab-cart-btn.update_cart:hover {
  background: var(--cart-accent-soft) !important;
}

.tecsalab-cart-btn--ghost {
  background: #fff !important;
  color: var(--cart-text) !important;
  border-color: var(--cart-border) !important;
}

.tecsalab-cart-btn--ghost:hover {
  border-color: var(--cart-accent) !important;
  color: var(--cart-accent) !important;
  background: var(--cart-accent-soft) !important;
}

.tecsalab-cart__aside {
  position: sticky;
  top: 88px;
}

.woocommerce .cart-collaterals .cart_totals,
.woocommerce-page .cart-collaterals .cart_totals,
.tecsalab-cart-collaterals .cart_totals {
  float: none !important;
  width: 100% !important;
}

.tecsalab-cart-totals {
  padding: 0;
}

.tecsalab-cart-totals__title {
  margin: 0;
  padding: 18px 20px;
  font-size: 16px;
  font-weight: 700;
  color: var(--cart-text);
  border-bottom: 1px solid var(--cart-border);
  background: #fff;
}

.tecsalab-cart-totals__table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
}

.tecsalab-cart-totals__table th,
.tecsalab-cart-totals__table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--cart-border);
  font-size: 14px;
  background: transparent !important;
}

.tecsalab-cart-totals__table th {
  font-weight: 500;
  color: var(--cart-muted);
  text-align: left;
}

.tecsalab-cart-totals__table td {
  font-weight: 600;
  color: var(--cart-text);
  text-align: right;
}

.tecsalab-cart-totals__table #shipping-calculator-form,
.tecsalab-cart-totals__table #shipping-calculator-form * {
  text-align: left;
}

.tecsalab-cart-totals .cart-subtotal {
  display: none !important;
}

.tecsalab-cart-totals__table .order-total th,
.tecsalab-cart-totals__table .order-total td {
  border-bottom: none;
  background: var(--cart-accent-soft) !important;
  padding-top: 16px;
  padding-bottom: 16px;
}

.tecsalab-cart-totals__table .order-total th {
  color: var(--cart-text);
  font-weight: 700;
  font-size: 15px;
}

.tecsalab-cart-totals__table .order-total td {
  color: var(--cart-accent);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tecsalab-cart-totals .wc-proceed-to-checkout {
  padding: 16px 20px 8px;
}

.tecsalab-cart-totals .checkout-button {
  display: flex !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 0 20px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}

.tecsalab-cart-continue {
  display: block;
  margin: 0 20px 20px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--cart-accent);
  text-decoration: none;
  padding: 8px 0 4px;
  transition: color 0.15s ease;
}

.tecsalab-cart-continue:hover {
  color: var(--cart-accent-hover);
}

.tecsalab-cart-empty {
  max-width: 420px;
  margin: 48px auto;
  padding: 40px 28px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--cart-border);
  border-radius: 12px;
}

.tecsalab-cart-empty__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 16px;
  border-radius: 16px;
  background: var(--cart-accent-soft);
  color: var(--cart-accent);
}

.tecsalab-cart-empty .cart-empty,
.tecsalab-cart-empty .woocommerce-info {
  margin: 0 0 8px;
  border: none;
  background: transparent;
  color: var(--cart-text);
  font-size: 18px;
  font-weight: 700;
  box-shadow: none;
  padding: 0;
}

.tecsalab-cart-empty .return-to-shop {
  margin: 20px 0 0;
}

.tecsalab-cart-empty .tecsalab-cart-btn {
  min-width: 200px;
}

.woocommerce .cart-collaterals::after,
.woocommerce .cart-collaterals::before,
.woocommerce-page .cart-collaterals::after,
.woocommerce-page .cart-collaterals::before {
  display: none !important;
}

/* Блок "Вас также может заинтересовать" (cross-sells) — сайдбар корзины узкий (340px),
   общая сетка WooCommerce (.woocommerce ul.products) рассчитана на широкий контейнер
   и в 3-4 колонки схлопывает карточки до нескольких пикселей. */
.tecsalab-cart-collaterals .cross-sells {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--cart-border);
}

.tecsalab-cart-collaterals .cross-sells h2 {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--cart-text);
}

.tecsalab-cart-collaterals .cross-sells ul.products {
  grid-template-columns: 1fr !important;
  gap: 10px !important;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-card {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--cart-border) !important;
  border-radius: 10px;
  box-shadow: none;
  transition: border-color 0.15s ease;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-card:hover {
  border-color: var(--cart-accent) !important;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-image-wrapper {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--cart-border);
  border-radius: 8px;
  background: var(--cart-bg);
  overflow: hidden;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-image-wrapper img {
  object-fit: contain !important;
  padding: 5px;
  /* Прячем alt-текст, если картинка не загрузилась — иначе он вылезает за рамку миниатюры */
  font-size: 0;
}

/* Плашка "Хорошая цена" рассчитана на крупное фото в каталоге — на миниатюре 56px не помещается */
.tecsalab-cart-collaterals .cross-sells ul.products li.product .deal-badge--floating {
  display: none;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-info {
  padding: 0 !important;
  min-width: 0;
  align-self: center;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-title {
  margin-bottom: 6px !important;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-excerpt {
  display: none;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-actions {
  align-items: flex-start !important;
  margin-top: 8px;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-actions .button,
.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-actions .added_to_cart {
  width: auto !important;
  /* Плагин цены-по-запросу задаёт height и line-height инлайн-стилем — перебиваем явно, иначе кнопка не сжимается */
  height: 30px !important;
  min-height: 30px !important;
  line-height: 1 !important;
  font-size: 12px !important;
  padding: 0 12px !important;
  border-radius: 7px !important;
}

/* Лёгкая обводка вместо сплошной заливки — три жирных фиолетовых блока подряд смотрятся тяжело */
.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-actions .button {
  background: #fff !important;
  color: var(--cart-accent) !important;
  border-color: var(--cart-accent) !important;
}

.tecsalab-cart-collaterals .cross-sells ul.products li.product .product-actions .button:hover {
  background: var(--cart-accent-soft) !important;
  color: var(--cart-accent) !important;
  border-color: var(--cart-accent) !important;
}

body.woocommerce-cart .cart-content > nav.breadcrumbs,
body.woocommerce-cart .tecsalab-cart nav.breadcrumbs {
  display: none;
}

@media (max-width: 1024px) {
  .tecsalab-cart__grid {
    grid-template-columns: 1fr;
  }

  .tecsalab-cart__aside {
    position: static;
  }
}

@media (max-width: 768px) {
  .tecsalab-cart__title {
    font-size: 24px;
  }

  .tecsalab-cart-table thead {
    display: none;
  }

  .tecsalab-cart-table,
  .tecsalab-cart-table tbody,
  .tecsalab-cart-table tr.cart_item,
  .tecsalab-cart-table tr.cart_item td {
    display: block;
    width: 100%;
  }

  .tecsalab-cart-table tr.cart_item {
    position: relative;
    padding: 16px 16px 16px 96px;
    border-bottom: 1px solid var(--cart-border);
  }

  .tecsalab-cart-table tr.cart_item:last-of-type {
    border-bottom: 1px solid var(--cart-border);
  }

  .tecsalab-cart-table tbody td {
    padding: 6px 0;
    border: none;
    text-align: left;
  }

  .tecsalab-cart-table tbody td:before {
    content: attr(data-title);
    display: block;
    margin-bottom: 2px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--cart-muted);
  }

  .tecsalab-cart-table .product-thumbnail {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 64px;
  }

  .tecsalab-cart-table .product-thumbnail:before,
  .tecsalab-cart-table .product-remove:before {
    display: none;
  }

  .tecsalab-cart-table .product-thumbnail img,
  body.woocommerce-cart table.cart img {
    width: 64px !important;
    height: 64px !important;
  }

  .tecsalab-cart-table .product-remove {
    position: absolute;
    right: 12px;
    top: 12px;
    width: auto;
  }

  .tecsalab-cart-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .tecsalab-cart-coupon {
    width: 100%;
  }

  .tecsalab-cart-coupon .input-text,
  .tecsalab-cart-btn {
    width: 100%;
  }

  .tecsalab-cart-actions-row {
    display: block;
  }

  .tecsalab-cart-actions-row td {
    display: block;
  }
}
