/* СантехМир — кнопки корзины в компактной стилистике разделов каталога. */

/* ===== Кнопки «В корзину» в карточках товаров ===== */
#grid .product-cart-btn {
  --cart-mts-brand: var(--brand-orange-2, #f39e32);
  --cart-mts-light: #ffc273;
  --cart-mts-deep: var(--brand-orange, #e8771b);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100%;
  min-height: 48px;
  padding: 5px 18px 5px 9px !important;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid rgba(34, 34, 34, 0.08) !important;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 158, 50, 0.23), transparent 58%),
    linear-gradient(180deg, #fffaf3, #f1f2f4) !important;
  box-shadow:
    0 12px 24px rgba(31, 35, 40, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.94) !important;
  color: var(--brand-dark, #2c2c2c);
  transform: translateZ(0);
  transition:
    transform 0.34s cubic-bezier(0.2, 0.78, 0.2, 1),
    border-color 0.34s ease,
    box-shadow 0.38s ease,
    color 0.34s ease;
}

#grid .product-cart-btn::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -1px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.34), transparent 52%),
    linear-gradient(145deg, var(--cart-mts-light), var(--cart-mts-brand) 55%, var(--cart-mts-deep));
  opacity: 0;
  transform: scale(0.9);
  transition:
    opacity 0.34s ease,
    transform 0.48s cubic-bezier(0.2, 0.78, 0.2, 1);
  pointer-events: none;
}

#grid .product-cart-btn::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, 0.88) 42%, transparent 63%);
  opacity: 0;
  transform: translateX(-145%) skewX(-16deg);
  pointer-events: none;
}

#grid .product-cart-btn__icon,
#grid .product-cart-btn__label {
  position: relative;
  z-index: 2;
}

#grid .product-cart-btn__icon {
  width: 38px !important;
  height: 38px !important;
  margin: 0;
  object-fit: contain;
  filter: drop-shadow(0 0 7px rgba(243, 158, 50, 0.48));
  transition:
    transform 0.36s cubic-bezier(0.2, 0.78, 0.2, 1),
    filter 0.34s ease;
}

#grid .product-cart-btn__label {
  color: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.08;
  transition:
    color 0.34s ease,
    text-shadow 0.34s ease;
}

#grid .product-cart-btn:hover,
#grid .product-cart-btn:focus-visible {
  border-color: rgba(243, 158, 50, 0.45) !important;
  color: #b96200;
  outline: none;
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 20px 34px rgba(86, 53, 13, 0.16),
    0 0 0 4px rgba(243, 158, 50, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.98) !important;
}

#grid .product-cart-btn:hover::after,
#grid .product-cart-btn:focus-visible::after {
  opacity: 1;
  animation: cartMtsShine 0.85s ease both;
}

#grid .product-cart-btn:hover .product-cart-btn__icon,
#grid .product-cart-btn:focus-visible .product-cart-btn__icon {
  transform: translateY(-2px) rotate(-3deg) scale(1.06);
  filter: drop-shadow(0 0 9px rgba(243, 158, 50, 0.72));
}

#grid .product-cart-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.08s;
  box-shadow:
    0 7px 14px rgba(86, 53, 13, 0.13),
    inset 0 2px 5px rgba(120, 68, 10, 0.1) !important;
}

#grid .product-cart-btn--added {
  color: #fff;
}

#grid .product-cart-btn--added::before {
  opacity: 1;
  transform: scale(1);
}

#grid .product-cart-btn--added .product-cart-btn__label {
  color: #fff;
  text-shadow: 0 1px 7px rgba(117, 58, 0, 0.24);
}

#grid .product-cart-btn--added .product-cart-btn__icon {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)) drop-shadow(0 0 14px rgba(255, 174, 66, 0.7));
}

/* ===== Основные действия на странице корзины ===== */
.cart-page .cart-btn {
  --cart-mts-brand: var(--brand-orange-2, #f39e32);
  --cart-mts-light: #ffc273;
  --cart-mts-deep: var(--brand-orange, #e8771b);
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 48px;
  padding: 9px 18px;
  border: 1px solid rgba(34, 34, 34, 0.08);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 158, 50, 0.23), transparent 58%),
    linear-gradient(180deg, #fffaf3, #f1f2f4);
  box-shadow:
    0 12px 24px rgba(31, 35, 40, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
  color: var(--brand-dark, #2c2c2c);
  font-size: 0.9rem;
  font-weight: 750;
  filter: none;
  transform: translateZ(0);
  transition:
    transform 0.34s cubic-bezier(0.2, 0.78, 0.2, 1),
    border-color 0.34s ease,
    box-shadow 0.38s ease,
    color 0.34s ease,
    background 0.34s ease;
}

.cart-page .cart-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(112deg, transparent 18%, rgba(255, 255, 255, 0.88) 42%, transparent 63%);
  opacity: 0;
  transform: translateX(-145%) skewX(-16deg);
  pointer-events: none;
}

.cart-page .cart-btn:hover,
.cart-page .cart-btn:focus-visible {
  border-color: rgba(243, 158, 50, 0.45);
  color: #b96200;
  outline: none;
  filter: none;
  transform: translateY(-2px) scale(1.01);
  box-shadow:
    0 20px 34px rgba(86, 53, 13, 0.16),
    0 0 0 4px rgba(243, 158, 50, 0.09),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.cart-page .cart-btn:hover::after,
.cart-page .cart-btn:focus-visible::after {
  opacity: 1;
  animation: cartMtsShine 0.85s ease both;
}

.cart-page .cart-btn:active {
  transform: translateY(0) scale(0.97);
  transition-duration: 0.08s;
  box-shadow:
    0 7px 14px rgba(86, 53, 13, 0.13),
    inset 0 2px 5px rgba(120, 68, 10, 0.1);
}

.cart-page .cart-btn--primary {
  border-color: rgba(211, 117, 11, 0.32);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.34), transparent 52%),
    linear-gradient(145deg, var(--cart-mts-light), var(--cart-mts-brand) 55%, var(--cart-mts-deep));
  color: #fff;
  text-shadow: 0 1px 7px rgba(117, 58, 0, 0.24);
}

.cart-page .cart-btn--primary:hover,
.cart-page .cart-btn--primary:focus-visible,
.cart-page #copyCartBtn.cart-btn--primary:hover,
.cart-page #copyCartBtn.cart-btn--primary:focus-visible {
  border-color: rgba(211, 117, 11, 0.45) !important;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.42), transparent 52%),
    linear-gradient(145deg, #ffcc8a, #f5a544 55%, #e8771b) !important;
  color: #fff !important;
  filter: none !important;
}

.cart-page .cart-btn--outline,
.cart-page .cart-btn--ghost {
  border-color: rgba(243, 158, 50, 0.24);
}

.cart-page .cart-btn--danger {
  border-color: rgba(220, 38, 38, 0.2);
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.14), transparent 58%),
    linear-gradient(180deg, #fff8f7, #f3f1f1);
  color: #b91c1c;
}

.cart-page .cart-btn--danger:hover,
.cart-page .cart-btn--danger:focus-visible {
  border-color: rgba(220, 38, 38, 0.34);
  color: #991b1b;
  box-shadow:
    0 20px 34px rgba(127, 29, 29, 0.12),
    0 0 0 4px rgba(220, 38, 38, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.98);
}

.cart-page .cart-btn:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  transform: none;
  box-shadow: none;
}

/* Кнопки количества и удаления сохраняют назначение, но получают ту же поверхность. */
.cart-page .qty {
  border-color: rgba(243, 158, 50, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0%, rgba(243, 158, 50, 0.13), transparent 62%),
    linear-gradient(180deg, #fffaf3, #f4f4f5);
  box-shadow:
    0 8px 18px rgba(31, 35, 40, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.94);
}

.cart-page .qty button[data-action="minus"],
.cart-page .qty button[data-action="plus"],
.cart-page .remove {
  border-color: rgba(243, 158, 50, 0.25);
  background: linear-gradient(180deg, #fffdf9, #f1f2f4);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94);
  transition:
    transform 0.22s cubic-bezier(0.2, 0.78, 0.2, 1),
    border-color 0.22s ease,
    background 0.22s ease,
    box-shadow 0.22s ease,
    color 0.22s ease;
}

.cart-page .qty button[data-action="minus"]:hover,
.cart-page .qty button[data-action="plus"]:hover {
  border-color: rgba(243, 158, 50, 0.52);
  background: linear-gradient(145deg, var(--brand-orange-2, #f39e32), var(--brand-orange, #e8771b));
  color: #fff;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 7px 14px rgba(211, 117, 11, 0.18);
}

.cart-page .remove:hover,
.cart-page .remove:focus-visible {
  border-color: rgba(220, 38, 38, 0.3);
  background: linear-gradient(180deg, #fff8f7, #f4eeee);
  outline: none;
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 10px 18px rgba(127, 29, 29, 0.12);
}

.cart-page .remove:active {
  transform: scale(0.96);
}

@keyframes cartMtsShine {
  from {
    transform: translateX(-145%) skewX(-16deg);
  }
  to {
    transform: translateX(145%) skewX(-16deg);
  }
}

@media (max-width: 520px) {
  #grid .product-cart-btn,
  .cart-page .cart-btn {
    min-height: 46px;
  }

  .cart-page .cart-btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #grid .product-cart-btn,
  #grid .product-cart-btn::before,
  #grid .product-cart-btn::after,
  #grid .product-cart-btn__icon,
  .cart-page .cart-btn,
  .cart-page .cart-btn::after,
  .cart-page .qty button,
  .cart-page .remove {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
