/* iMatrix basket UI — floating icon + right-side drawer.
   Uses site.css custom properties (--primary, --accent, --bg, etc.). */

[x-cloak] { display: none !important; }

/* ============ Floating cart icon ============ */
.imx-cart-fab {
  position: fixed;
  top: 14px;
  right: 18px;
  z-index: 1050;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--primary, #005C8C);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 92, 140, 0.25);
  transition: transform .15s, background .15s, box-shadow .15s;
  padding: 0;
}
.imx-cart-fab:hover {
  background: var(--accent, #0085B4);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 92, 140, 0.32);
}
.imx-cart-fab:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}
.imx-cart-fab svg { width: 22px; height: 22px; }
.imx-cart-fab .imx-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #e65100;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  font-family: 'Roboto', -apple-system, sans-serif;
  line-height: 1;
}

@media (max-width: 768px) {
  .imx-cart-fab { top: 12px; right: 12px; width: 42px; height: 42px; }
  .imx-cart-fab svg { width: 20px; height: 20px; }
}

/* ============ Backdrop + drawer ============ */
.imx-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.45);
  z-index: 1090;
  backdrop-filter: blur(2px);
}

.imx-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1100;
  width: min(420px, 100%);
  background: #fff;
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.18);
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  color: var(--text-primary, #121212);
}

/* Transition helpers (used by Alpine x-transition) */
.imx-drawer-enter         { transform: translateX(100%); }
.imx-drawer-enter-active  { transition: transform .25s ease-out; }
.imx-drawer-enter-to      { transform: translateX(0); }
.imx-drawer-leave         { transform: translateX(0); }
.imx-drawer-leave-active  { transition: transform .2s ease-in; }
.imx-drawer-leave-to      { transform: translateX(100%); }
.imx-backdrop-enter, .imx-backdrop-leave-to { opacity: 0; }
.imx-backdrop-enter-active, .imx-backdrop-leave-active { transition: opacity .2s; }
.imx-backdrop-enter-to { opacity: 1; }

/* ============ Header ============ */
.imx-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-blue, #A8D2E3);
  background: var(--bg, #F5F9FC);
}
.imx-drawer-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary, #121212);
}
.imx-close-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary, #555);
  padding: 0;
}
.imx-close-btn:hover { background: rgba(0, 0, 0, 0.06); color: var(--text-primary, #121212); }
.imx-close-btn:focus-visible { outline: 2px solid var(--primary, #005C8C); }

/* ============ Body / items list ============ */
.imx-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 4px 22px 22px;
}
.imx-empty {
  padding: 56px 16px;
  text-align: center;
  color: var(--text-muted, #888);
}
.imx-empty svg { opacity: .4; margin-bottom: 12px; }
.imx-empty p { font-size: 15px; margin-bottom: 18px; }

.imx-item {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid #eef3f7;
  position: relative;
  transition: background .35s;
}
.imx-item:last-child { border-bottom: none; }
.imx-item.imx-item-flash { background: rgba(0, 133, 180, 0.07); border-radius: 6px; }
.imx-item .imx-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: var(--bg, #F5F9FC);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border-blue, #A8D2E3);
}
.imx-item .imx-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.imx-item .imx-info { display: flex; flex-direction: column; min-width: 0; }
.imx-item .imx-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #121212);
  margin-bottom: 4px;
  line-height: 1.3;
}
.imx-item .imx-meta {
  font-size: 12px;
  color: var(--text-muted, #888);
  margin-bottom: 8px;
}
.imx-item .imx-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.imx-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-blue, #A8D2E3);
  border-radius: 6px;
  overflow: hidden;
}
.imx-qty button {
  width: 28px;
  height: 28px;
  background: #fff;
  border: none;
  font-size: 16px;
  font-weight: 600;
  color: var(--primary, #005C8C);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.imx-qty button:hover { background: var(--bg, #F5F9FC); }
.imx-qty input {
  width: 38px;
  border: none;
  border-left: 1px solid var(--border-blue, #A8D2E3);
  border-right: 1px solid var(--border-blue, #A8D2E3);
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  background: #fff;
  font-family: inherit;
  -moz-appearance: textfield;
}
.imx-qty input::-webkit-outer-spin-button,
.imx-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.imx-qty input:focus-visible { outline: 2px solid var(--primary, #005C8C); outline-offset: -2px; }

.imx-line-prices { text-align: right; line-height: 1.3; }
.imx-line-prices .hw { font-size: 14px; font-weight: 700; color: var(--text-primary, #121212); }
.imx-line-prices .saas { font-size: 12px; color: var(--primary, #005C8C); margin-top: 2px; }

.imx-remove {
  align-self: flex-start;
  background: none;
  border: none;
  color: var(--text-muted, #888);
  font-size: 12px;
  cursor: pointer;
  margin-top: 8px;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.imx-remove:hover { color: var(--danger, #c62828); }

.imx-tier-msg {
  margin-top: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--success-bg, #e8f5e9);
  color: var(--success, #2e7d32);
  font-size: 11px;
  font-weight: 600;
}
.imx-tier-msg.imx-contact {
  background: rgba(230, 81, 0, 0.12);
  color: var(--warning, #e65100);
}

/* ============ Footer / totals + checkout ============ */
.imx-drawer-foot {
  border-top: 1px solid var(--border-blue, #A8D2E3);
  padding: 18px 22px 22px;
  background: var(--bg, #F5F9FC);
}
.imx-totals { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.imx-totals .tot-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-secondary, #555);
}
.imx-totals .tot-row .v { font-weight: 700; color: var(--text-primary, #121212); }
.imx-totals .tot-row.saas .v { color: var(--primary, #005C8C); }
.imx-totals .tot-note { font-size: 11px; color: var(--text-muted, #888); margin-top: 4px; font-style: italic; }

.imx-checkout-btn {
  width: 100%;
  padding: 13px 22px;
  background: var(--primary, #005C8C);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.imx-checkout-btn:hover:not(:disabled) { background: var(--accent, #0085B4); }
.imx-checkout-btn:disabled { background: #b9c8d2; cursor: not-allowed; }
.imx-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 13px 22px;
  background: var(--warning, #e65100);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
}
.imx-contact-btn:hover { background: #c54600; color: #fff; }

.imx-continue {
  display: block;
  width: 100%;
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--primary, #005C8C);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.imx-continue:hover { text-decoration: underline; }

/* ============ Toast ============ */
.imx-toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1200;
  padding: 12px 22px;
  background: #1a2744;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  max-width: calc(100vw - 32px);
}
.imx-toast-enter, .imx-toast-leave-to { opacity: 0; transform: translateX(-50%) translateY(10px); }
.imx-toast-enter-active, .imx-toast-leave-active { transition: opacity .2s, transform .2s; }
.imx-toast-enter-to { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ Add-to-basket button (when placed inline on pages) ============ */
.imx-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--primary, #005C8C);
  color: #fff;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
  text-decoration: none;
}
.imx-add-btn:hover:not(:disabled) { background: var(--accent, #0085B4); color: #fff; }
.imx-add-btn:disabled { background: #b9c8d2; cursor: not-allowed; }
.imx-add-btn svg { flex-shrink: 0; }

/* Compact add button — used inside narrow cells like the env pricing table */
.imx-add-btn-sm {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 12px;
  background: var(--primary, #005C8C);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.imx-add-btn-sm:hover:not(:disabled) { background: var(--accent, #0085B4); }
.imx-add-btn-sm:disabled { background: #b9c8d2; cursor: not-allowed; }

@media (max-width: 480px) {
  .imx-drawer-header { padding: 14px 16px; }
  .imx-drawer-body { padding: 4px 16px 16px; }
  .imx-drawer-foot { padding: 14px 16px 18px; }
}
