/*!
 * sc-cart-close.css — HOTFIX-02 (2026-10-31)
 *
 * ROOT CAUSE (verified in assets/index-Dac3ekk5.js):
 *   The cart dialog uses the generic shadcn DialogContent (_h), which DOES
 *   render the built-in Radix close button (classes "absolute right-4 top-4
 *   ... opacity-70"). But the cart's own header row ("Корзина (N)") is
 *   "sticky top-0 z-10 bg-background" — an OPAQUE sticky bar with z-index:10
 *   that paints OVER the z-auto close button. The X was in the DOM, just
 *   fully covered. Additionally the DialogContent is overflow-y-auto, so an
 *   absolutely-positioned button scrolls away with the content.
 *
 * FIX:
 *   - z-index raised above the sticky header (30 > 10, same stacking context).
 *   - position switched to FIXED: the DialogContent carries the transform
 *     translate-x/y-[-50%], so it is the containing block for fixed
 *     descendants — the button is pinned to the dialog's top-right corner and
 *     no longer scrolls away with the content.
 *   - Aligned with the "Корзина (N)" title row, ≥44×44 hit area, olive
 *     #444c00 on cream, hover/focus states, safe-area aware.
 *
 * All rules isolated under .sc-cart-close-* prefixes; no global selectors.
 * Transitions disabled under prefers-reduced-motion.
 */

/* ------------------------------------------------------------------ */
/* Built-in shadcn close button (rendered by DialogContent _h)         */
/* !important only where Tailwind utilities of the bundle must be      */
/* overridden (absolute / right-4 / top-4 / opacity-70).               */
/* ------------------------------------------------------------------ */
.sc-cart-close-enhanced {
  position: fixed !important;
  top: calc(env(safe-area-inset-top, 0px) + 8px) !important;
  right: calc(env(safe-area-inset-right, 0px) + 10px) !important;
  bottom: auto !important;
  left: auto !important;
  z-index: 30 !important;
  /* above the cart's sticky header (z-10) */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  opacity: 1 !important;
  /* bundle default is opacity-70 */
  color: #444c00;
  background: transparent;
  border: 0;
  border-radius: 50%;
  overflow: visible;
  cursor: pointer;
  transition: background-color 150ms ease-out, opacity 150ms ease-out;
}

.sc-cart-close-enhanced:hover,
.sc-cart-close-enhanced:focus-visible {
  opacity: 1 !important;
  background-color: rgba(68, 76, 0, 0.12);
}

.sc-cart-close-enhanced:focus-visible {
  outline: 2px solid #444c00;
  outline-offset: 2px;
}

/* Icon stays modest (bundle svg is h-4 w-4); slightly larger for clarity. */
.sc-cart-close-enhanced svg {
  width: 20px;
  height: 20px;
}

/* sm+: cart header uses p-6 — align button with the title row there. */
@media (min-width: 640px) {
  .sc-cart-close-enhanced {
    top: calc(env(safe-area-inset-top, 0px) + 14px) !important;
    right: calc(env(safe-area-inset-right, 0px) + 14px) !important;
  }
}

/* ------------------------------------------------------------------ */
/* Fallback injected button (only if the built-in one is missing)      */
/* Same fixed-to-dialog behaviour as the enhanced built-in button.     */
/* ------------------------------------------------------------------ */
.sc-cart-close-btn {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 8px);
  right: calc(env(safe-area-inset-right, 0px) + 10px);
  z-index: 30;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: rgba(250, 247, 239, 0.9);
  border: 1px solid rgba(68, 76, 0, 0.25);
  border-radius: 50%;
  color: #444c00;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(38, 42, 16, 0.12);
  transition: background-color 150ms ease-out, transform 150ms ease-out;
}

.sc-cart-close-btn:hover,
.sc-cart-close-btn:focus-visible {
  background: #faf7ef;
}

.sc-cart-close-btn:focus-visible {
  outline: 2px solid #444c00;
  outline-offset: 2px;
}

.sc-cart-close-btn:active {
  transform: scale(0.96);
}

/* ------------------------------------------------------------------ */
/* Reduced motion                                                     */
/* ------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {

  .sc-cart-close-enhanced,
  .sc-cart-close-btn {
    transition: none;
  }

  .sc-cart-close-btn:active {
    transform: none;
  }
}