/* Utility — used by calculator-full.js on product pages */
.hidden { display: none !important; }

/* ===========================================
   SITE-WIDE CART
   Cart button → Drawer → Checkout modal
   =========================================== */

/* ── Cart button in header ──────────────────── */
.site-cart-btn {
  position: relative;
  background: transparent;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius, 12px);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--dark);
  transition: border-color 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}

.site-cart-btn:hover {
  border-color: var(--coral);
  color: var(--coral);
  background: rgba(232, 85, 61, 0.04);
}

.site-cart-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--coral);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Manrope', sans-serif;
  min-width: 18px;
  height: 18px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
  border: 2px solid #fff;
}

/* Respect HTML hidden attribute even when display is set by CSS */
.site-cart-badge[hidden] { display: none !important; }

/* ── Overlay ────────────────────────────────── */
.sc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.sc-overlay--visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer ─────────────────────────────────── */
.site-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 100vw;
  height: 100dvh;
  background: var(--white, #fff);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -12px 0 48px rgba(0, 0, 0, 0.14);
}

.sc-open {
  transform: translateX(0);
}

/* ── Drawer header ──────────────────────────── */
.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.sc-header h3 {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin: 0;
}

.sc-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sc-clear-btn {
  font-size: 12px;
  color: var(--gray-500);
  cursor: pointer;
  background: none;
  border: 1px solid var(--gray-200);
  padding: 5px 10px;
  border-radius: 8px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}

.sc-clear-btn:hover {
  color: var(--coral);
  border-color: var(--coral);
}

.sc-close-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100, #f5f5f5);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--gray-600);
  transition: background 0.15s;
}

.sc-close-btn:hover { background: var(--gray-200); }

/* ── List area ──────────────────────────────── */
#site-cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px 0;
  overscroll-behavior: contain;
}

/* ── Empty state ────────────────────────────── */
.sc-empty {
  text-align: center;
  padding: 56px 16px 32px;
  color: var(--gray-500);
}

.sc-empty svg {
  stroke: var(--gray-300);
  margin-bottom: 20px;
}

.sc-empty p {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-600);
  margin: 0 0 8px;
}

.sc-empty small {
  font-size: 13px;
  line-height: 1.7;
  color: var(--gray-400);
}

/* ── Cart item ──────────────────────────────── */
.sc-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-100, #f1f2f5);
}

.sc-item:last-child { border-bottom: none; }

.sc-item__head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.sc-item__num {
  width: 22px;
  height: 22px;
  min-width: 22px;
  background: var(--coral);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Manrope', sans-serif;
  margin-top: 1px;
}

.sc-item__name {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.45;
}

.sc-item__del {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  padding: 3px;
  flex-shrink: 0;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  display: flex;
  align-items: center;
  margin-top: 1px;
}

.sc-item__del:hover {
  color: var(--coral);
  background: rgba(232, 85, 61, 0.07);
}

.sc-item__tz {
  font-family: 'Manrope', -apple-system, sans-serif;
  font-size: 12px;
  color: var(--gray-500);
  background: var(--gray-50, #fafafa);
  border-radius: 10px;
  padding: 10px 14px;
  margin: 0 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
  border: 1px solid var(--gray-200);
}

.sc-item__price {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  text-align: right;
}

/* ── Footer ─────────────────────────────────── */
.sc-footer {
  padding: 16px 24px 28px;
  border-top: 1px solid var(--gray-200);
  flex-shrink: 0;
  background: var(--white, #fff);
}

.sc-footer-total {
  font-family: 'Space Grotesk', 'Manrope', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 14px;
}

.sc-footer .btn {
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  text-align: center;
}

.sc-footer .btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Invoice section (Контур.Эльба) ─────────── */
.sc-invoice {
  margin-top: 10px;
}

.btn-invoice {
  width: 100%;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: transparent;
  border: 1.5px solid var(--gray-300, #d1d5db);
  border-radius: var(--radius, 10px);
  color: var(--gray-600, #4b5563);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  font-family: inherit;
}

.btn-invoice:hover:not(:disabled) {
  border-color: var(--coral);
  color: var(--coral);
  background: rgba(232, 85, 61, 0.04);
}

.btn-invoice:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.sc-invoice-form {
  margin-top: 12px;
}

.sc-invoice-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sc-inn-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--gray-200, #e5e7eb);
  border-radius: var(--radius, 10px);
  font-size: 14px;
  font-family: inherit;
  background: var(--white, #fff);
  color: var(--dark);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}

.sc-inn-input:focus {
  border-color: var(--coral);
}

.sc-inn-input::placeholder {
  color: var(--gray-400, #9ca3af);
}

.sc-invoice-row .btn-coral.sc-invoice-submit {
  width: 100%;
  padding: 11px 18px;
  font-size: 14px;
}

.sc-invoice-msg {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.4;
  min-height: 18px;
}

.sc-invoice-msg--success { color: #2a9d5c; }
.sc-invoice-msg--error   { color: var(--coral); }

/* ── "Add to cart" button states ────────────── */
#cf-add-cart-btn {
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

#cf-add-cart-btn.cf-add-btn--added {
  background: #2aad6c !important;
  border-color: #2aad6c !important;
  color: #fff !important;
  cursor: default;
}

/* ── Body scroll lock ───────────────────────── */
.sc-body-lock {
  overflow: hidden;
}

/* ── Checkout modal adjustments ─────────────── */
#modal-cart-checkout .modal {
  max-height: 90vh;
  overflow-y: auto;
}

/* ── Floating cart button (FAB) ─────────────── */
.cart-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 0 16px;
  height: 52px;
  background: var(--coral);
  color: #fff;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(232, 85, 61, 0.45);
  font-family: 'Manrope', sans-serif;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;

  /* entrance animation */
  transform: translateY(0) scale(1);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.2s,
              opacity 0.25s;
  opacity: 1;
}

.cart-fab[hidden] {
  display: none !important;
}

.cart-fab:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 28px rgba(232, 85, 61, 0.5);
}

.cart-fab:active {
  transform: scale(0.97);
}

.cart-fab__label {
  line-height: 1;
}

.cart-fab__badge {
  min-width: 22px;
  height: 22px;
  background: #fff;
  color: var(--coral);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  line-height: 1;
}

/* Pop-in animation when cart gets first item */
@keyframes cart-fab-pop {
  0%   { transform: scale(0.5); opacity: 0; }
  70%  { transform: scale(1.08); }
  100% { transform: scale(1);   opacity: 1; }
}

.cart-fab--pop {
  animation: cart-fab-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@media (max-width: 640px) {
  .cart-fab {
    bottom: 20px;
    right: 16px;
    padding: 0 16px 0 14px;
    height: 48px;
    font-size: 13px;
  }
}

/* ── Messenger widget (YouGood) — prevent overlap with cart FAB ── */
[id*="yourgood"],
[class*="yourgood"],
[id*="pf-widget"],
[class*="pf-widget"],
[id*="widgetsite"],
[class*="widgetsite"],
iframe[src*="yourgood"],
iframe[src*="widgetsite"] {
  bottom: 96px !important;
}

/* ── File upload zone in checkout form ──────── */
.cart-upload-zone {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius, 12px);
  background: var(--gray-50, #fafafa);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  min-height: 52px;
}

.cart-upload-zone:hover,
.cart-upload-zone.dragover {
  border-color: var(--coral);
  background: rgba(232, 85, 61, 0.04);
}

.cart-upload-zone.has-file {
  border-color: #2aad6c;
  background: rgba(42, 173, 108, 0.04);
}

.cart-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.cart-upload-zone svg {
  flex-shrink: 0;
  color: var(--gray-400);
  transition: color 0.2s;
}

.cart-upload-zone:hover svg,
.cart-upload-zone.dragover svg {
  color: var(--coral);
}

.cart-upload-zone.has-file svg {
  color: #2aad6c;
}

.cart-upload-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cart-upload-zone.has-file .cart-upload-label {
  color: var(--dark);
}

.cart-upload-hint {
  font-size: 11px;
  color: var(--gray-400);
  white-space: nowrap;
}

.cart-upload-zone.has-file .cart-upload-hint {
  display: none;
}

/* ── Responsive ─────────────────────────────── */
@media (max-width: 480px) {
  .site-cart-drawer {
    width: 100vw;
    border-radius: 0;
  }

  .sc-header { padding: 16px 20px 14px; }
  #site-cart-list { padding: 8px 20px 0; }
  .sc-footer { padding: 14px 20px 24px; }
}
