/* =========================================================================
   PREISKALKULATOR — BEERENGARTEN FELDKIRCHEN
   ========================================================================= */

/* ── Section wrapper ───────────────────────────────────────── */
#preiskalkulator {
  padding: 6rem 5% 5rem;
  background-color: var(--color-bg);
}

/* ── Grid container ────────────────────────────────────────── */
#kalkulator-grid {
  max-width: 820px;
  margin: 3rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Single product row ────────────────────────────────────── */
.kalk-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  align-items: center;
  gap: 1.5rem;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.kalk-row:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* ── Label (icon + name + unit price) ─────────────────────── */
.kalk-label {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.kalk-icon {
  font-size: 2rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12));
}

.kalk-name-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.kalk-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kalk-unit-price {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--color-text-muted);
}

/* ── Slider wrapper ────────────────────────────────────────── */
.kalk-slider-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 36px;
}

/* Custom track via a pseudo-fill div sitting behind the input */
.kalk-slider-track-fill {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 6px;
  width: 0%;
  border-radius: 100px;
  background: var(--gradient-primary);
  pointer-events: none;
  transition: width 0.15s var(--ease-soft);
  z-index: 0;
}

/* ── Range input — reset + restyle ────────────────────────── */
.kalk-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: #e4e4e6;
  border-radius: 100px;
  outline: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
  /* transparent so the fill-div shows through */
  background: transparent;
}

/* Track — WebKit */
.kalk-slider::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 100px;
  background: #e4e4e6;
}

/* Track — Firefox */
.kalk-slider::-moz-range-track {
  height: 6px;
  border-radius: 100px;
  background: #e4e4e6;
}

/* Thumb — WebKit */
.kalk-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--color-accent-red);
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.35);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
  margin-top: -8px; /* vertically center on track */
  position: relative;
  z-index: 2;
}

.kalk-slider::-webkit-slider-thumb:hover,
.kalk-slider:focus::-webkit-slider-thumb {
  border-color: var(--color-accent-orange);
  box-shadow: 0 4px 14px rgba(255, 149, 0, 0.45);
  transform: scale(1.18);
}

/* Thumb — Firefox */
.kalk-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--color-accent-red);
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.35);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.kalk-slider::-moz-range-thumb:hover {
  border-color: var(--color-accent-orange);
  box-shadow: 0 4px 14px rgba(255, 149, 0, 0.45);
  transform: scale(1.18);
}

/* Focus ring for accessibility */
.kalk-slider:focus-visible {
  outline: 3px solid var(--color-accent-blue);
  outline-offset: 4px;
  border-radius: 100px;
}

/* ── Right side: qty + subtotal ────────────────────────────── */
.kalk-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  min-width: 90px;
}

.kalk-qty {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.kalk-subtotal {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--color-text-main);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* ── Total block ───────────────────────────────────────────── */
.kalk-total-block {
  margin-top: 0.5rem;
  background: var(--gradient-primary);
  border-radius: var(--radius-md);
  padding: 1.5rem 2rem;
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.28);
}

.kalk-total-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.kalk-total-label {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: 0.01em;
}

.kalk-total-value {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* ── Hint text ─────────────────────────────────────────────── */
.kalk-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 1rem;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* ── CTA button alignment ──────────────────────────────────── */
#preiskalkulator .kalk-cta-wrap {
  display: flex;
  justify-content: center;
  margin-top: 2.5rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 700px) {
  .kalk-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0.75rem 1rem;
    padding: 1rem 1.25rem;
  }

  .kalk-label {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
  }

  .kalk-right {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    align-items: flex-end;
  }

  .kalk-slider-wrap {
    grid-column: 1 / -1;
    grid-row: 2 / 3;
  }

  .kalk-icon {
    font-size: 1.6rem;
  }

  .kalk-total-value {
    font-size: 1.6rem;
  }

  .kalk-total-block {
    padding: 1.25rem 1.5rem;
  }
}

@media (max-width: 420px) {
  #preiskalkulator {
    padding: 4rem 4% 3.5rem;
  }

  .kalk-total-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }
}
