/* Faktoria3D — koszyk w nagłówku i wysuwany podgląd (jasny i ciemny wariant). */

.f3d-hcart,
.f3d-hcart-overlay {
  --hc-bg: #ffffff;
  --hc-bg-2: #f7f4ef;
  --hc-line: #e5dfd5;
  --hc-line-2: #d6cec2;
  --hc-ink: #151413;
  --hc-ink-2: #3f3b36;
  --hc-muted: #6b655e;
  --hc-accent: #e07820;
  --hc-accent-ink: #a9520a;
  --hc-err: #b82c28;
  --hc-shadow: 0 2px 4px rgba(21, 20, 19, .04), 0 24px 60px -24px rgba(21, 20, 19, .28);
  font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

.f3d-hcart--dark,
.f3d-hcart-overlay.f3d-hcart--dark {
  --hc-bg: #15181b;
  --hc-bg-2: #0f1113;
  --hc-line: #30353a;
  --hc-line-2: #464d54;
  --hc-ink: #f6f7f8;
  --hc-ink-2: #ded8ce;
  --hc-muted: #b6b0a8;
  --hc-accent: #f58220;
  --hc-accent-ink: #f5a13a;
  --hc-err: #f07474;
  --hc-shadow: 0 24px 60px -24px rgba(0, 0, 0, .7);
}

.f3d-hcart {
  position: relative;
  display: inline-flex;
  flex: none;
}

.f3d-hcart .f3d-hcart__button {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  color: var(--hc-ink);
  background: var(--hc-bg);
  border: 1px solid var(--hc-line-2);
  border-radius: 12px;
  box-shadow: none;
  cursor: pointer;
  transition: border-color .2s, transform .2s;
}

.f3d-hcart .f3d-hcart__button:hover,
.f3d-hcart .f3d-hcart__button:focus-visible {
  color: var(--hc-ink);
  background: var(--hc-bg);
  border-color: var(--hc-ink);
}

.f3d-hcart .f3d-hcart__button:focus-visible {
  outline: 2px solid var(--hc-accent);
  outline-offset: 2px;
}

.f3d-hcart .f3d-hcart__button svg,
.f3d-hcart-overlay svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.f3d-hcart .f3d-hcart__badge {
  position: absolute;
  top: -7px;
  right: -7px;
  display: inline-grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  color: #151413;
  background: var(--hc-accent);
  border: 2px solid var(--hc-bg);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.f3d-hcart [hidden],
.f3d-hcart-overlay[hidden],
.f3d-hcart-overlay [hidden] {
  display: none !important;
}

/* ---------- Panel ---------- */
.f3d-hcart-overlay {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: flex;
  justify-content: flex-end;
  background: rgba(21, 20, 19, .42);
  animation: f3d-hcart-fade .2s ease;
}

.f3d-hcart-overlay.f3d-hcart--dark {
  background: rgba(0, 0, 0, .6);
}

html.f3d-hcart-open {
  overflow: hidden;
}

.f3d-hcart-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  height: 100%;
  overflow: hidden;
  color: var(--hc-ink-2);
  background: var(--hc-bg);
  border-left: 1px solid var(--hc-line);
  box-shadow: var(--hc-shadow);
  animation: f3d-hcart-slide .25s ease;
  outline: none;
}

.f3d-hcart-panel.is-loading .f3d-hcart-panel__items {
  opacity: .55;
}

.f3d-hcart-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 6px;
}

.f3d-hcart-panel .f3d-hcart-panel__title {
  margin: 0;
  color: var(--hc-ink);
  font-family: inherit;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.f3d-hcart-panel .f3d-hcart-panel__close {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  color: var(--hc-ink);
  background: var(--hc-bg-2);
  border: 1px solid var(--hc-line);
  border-radius: 50%;
  cursor: pointer;
}

.f3d-hcart-panel .f3d-hcart-panel__close:hover {
  border-color: var(--hc-ink);
}

.f3d-hcart-panel__summary,
.f3d-hcart-panel__status {
  margin: 0;
  padding: 0 24px;
  color: var(--hc-muted);
  font-size: 14px;
}

.f3d-hcart-panel__status:empty {
  display: none;
}

.f3d-hcart-panel__items {
  flex: 1 1 auto;
  display: grid;
  align-content: start;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0 24px 16px;
  overflow-y: auto;
  list-style: none;
  transition: opacity .2s;
}

.f3d-hcart-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 12px;
  background: var(--hc-bg-2);
  border: 1px solid var(--hc-line);
  border-radius: 14px;
}

.f3d-hcart-item__thumb {
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  background: var(--hc-bg);
  border: 1px solid var(--hc-line);
  border-radius: 10px;
}

.f3d-hcart-item__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.f3d-hcart-item__body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.f3d-hcart-item__name {
  overflow: hidden;
  color: var(--hc-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.f3d-hcart-item__meta,
.f3d-hcart-item__qty {
  color: var(--hc-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.f3d-hcart-item__side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.f3d-hcart-item__price {
  color: var(--hc-ink);
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.f3d-hcart-panel .f3d-hcart-item__remove {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  color: var(--hc-muted);
  background: transparent;
  border: 1px solid var(--hc-line);
  border-radius: 10px;
  cursor: pointer;
}

.f3d-hcart-panel .f3d-hcart-item__remove svg {
  width: 17px;
  height: 17px;
}

.f3d-hcart-panel .f3d-hcart-item__remove:hover {
  color: var(--hc-err);
  border-color: var(--hc-err);
}

.f3d-hcart-panel .f3d-hcart-item__remove:disabled {
  opacity: .5;
  cursor: wait;
}

.f3d-hcart-panel__empty {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 24px;
}

.f3d-hcart-panel__empty p {
  margin: 0;
  color: var(--hc-muted);
}

.f3d-hcart-panel__foot {
  display: grid;
  gap: 8px;
  padding: 18px 24px 24px;
  background: var(--hc-bg);
  border-top: 1px solid var(--hc-line);
}

.f3d-hcart-panel__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
  color: var(--hc-ink-2);
  font-size: 14px;
}

.f3d-hcart-panel__row--total {
  color: var(--hc-ink);
  font-size: 17px;
  font-weight: 600;
}

.f3d-hcart-panel__row--total b {
  font-size: 20px;
}

.f3d-hcart-panel__note {
  margin: 0;
  color: var(--hc-muted);
  font-size: 12.5px;
}

.f3d-hcart-panel__actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.f3d-hcart-overlay .f3d-hcart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition: background-color .2s, border-color .2s, transform .2s;
}

.f3d-hcart-overlay .f3d-hcart-btn--primary {
  color: #151413;
  background: var(--hc-accent);
  box-shadow: 0 8px 24px -10px rgba(224, 120, 32, .7);
}

.f3d-hcart-overlay .f3d-hcart-btn--primary:hover {
  color: #151413;
  transform: translateY(-1px);
}

.f3d-hcart-overlay .f3d-hcart-btn--ghost {
  color: var(--hc-ink);
  background: var(--hc-bg);
  border-color: var(--hc-line-2);
}

.f3d-hcart-overlay .f3d-hcart-btn--ghost:hover {
  color: var(--hc-ink);
  border-color: var(--hc-ink);
}

@keyframes f3d-hcart-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes f3d-hcart-slide {
  from { transform: translateX(24px); opacity: .6; }
  to { transform: none; opacity: 1; }
}

@media (max-width: 640px) {
  .f3d-hcart .f3d-hcart__button {
    width: 42px;
    height: 42px;
  }

  .f3d-hcart-panel__head,
  .f3d-hcart-panel__items,
  .f3d-hcart-panel__foot {
    padding-left: 18px;
    padding-right: 18px;
  }

  .f3d-hcart-panel__summary,
  .f3d-hcart-panel__status {
    padding: 0 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .f3d-hcart-overlay,
  .f3d-hcart-panel {
    animation: none;
  }
}

/* druk3dkrakow.pl (Elementor „Koszyk menu”): nasz koszyk zastępuje widżet. */
.f3d-hcart-host .elementor-menu-cart__wrapper,
.f3d-hcart-host .elementor-menu-cart__container { display: none !important; }

.f3d-hcart--amount .f3d-hcart__button {
  display: inline-flex;
  gap: 10px;
  width: auto;
  height: auto;
  min-height: 48px;
  padding: 10px 18px;
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  color: #dad4cb;
  background: transparent;
  border: 1px solid #de6e0f;
  border-radius: 10px;
}
.f3d-hcart--amount .f3d-hcart__button:hover,
.f3d-hcart--amount .f3d-hcart__button:focus-visible {
  color: #ffffff;
  background: rgba(222, 110, 15, .14);
  border-color: #de6e0f;
}
.f3d-hcart--amount .f3d-hcart__amount { white-space: nowrap; }
.f3d-hcart--amount .f3d-hcart__badge { background: #de6e0f; }
/* Akcent strony druk3dkrakow.pl w panelu */
.f3d-hcart-overlay.f3d-hcart--dark { --hc-accent: #de6e0f; --hc-bg: #161719; }
@media (max-width: 640px) {
  .f3d-hcart--amount .f3d-hcart__button { min-height: 42px; padding: 8px 12px; font-size: 15px; }
}
