/* Logodrucken Configurator — Mobile First */

.ld-configurator {
  --ld-primary: #111;
  --ld-primary-hover: #333;
  --ld-accent: #2563eb;
  --ld-bg: #fff;
  --ld-muted: #6b7280;
  --ld-border: #e5e7eb;
  --ld-radius: 12px;
  --ld-touch: 44px;
  --ld-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ld-primary);
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  box-sizing: border-box;
}

.ld-configurator *,
.ld-configurator *::before,
.ld-configurator *::after {
  box-sizing: border-box;
}

/* Upload Screen */
.ld-configurator__title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin: 0 0 24px;
  line-height: 1.2;
}

.ld-upload-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border: 2px dashed var(--ld-border);
  border-radius: var(--ld-radius);
  background: #fafafa;
  cursor: pointer;
  padding: 24px;
  margin-bottom: 16px;
  transition: border-color 0.15s, background 0.15s;
}

.ld-upload-zone:focus-within,
.ld-upload-zone--drag {
  border-color: var(--ld-accent);
  background: #eff6ff;
}

.ld-upload-zone__icon {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--ld-muted);
}

.ld-upload-zone__text {
  color: var(--ld-muted);
  text-align: center;
}

.ld-upload-zone__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.ld-configurator__hint {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--ld-muted);
  margin: 12px 0 0;
}

/* Buttons */
.ld-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--ld-touch);
  padding: 0 20px;
  border: none;
  border-radius: var(--ld-radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}

.ld-btn--block {
  width: 100%;
}

.ld-btn--primary {
  background: var(--ld-primary);
  color: #fff;
}

.ld-btn--primary:hover:not(:disabled) {
  background: var(--ld-primary-hover);
}

.ld-btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ld-btn--ghost {
  background: transparent;
  color: var(--ld-accent);
  border: 1px solid var(--ld-border);
}

.ld-btn--sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.875rem;
}

.ld-btn--select {
  min-height: var(--ld-touch);
  width: 100%;
  margin-top: 8px;
  background: #fff;
  border: 1px solid var(--ld-primary);
  color: var(--ld-primary);
}

/* Toast */
.ld-configurator__toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  background: #dc2626;
  color: #fff;
  border-radius: var(--ld-radius);
  font-size: 0.875rem;
  z-index: 10000;
  box-shadow: var(--ld-shadow);
}

.ld-configurator__toast--success {
  background: #16a34a;
}

/* Products header */
.ld-products-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ld-products-header__title {
  font-size: 1.25rem;
  margin: 0;
}

/* Product grid — 2 columns mobile */
.ld-product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ld-product-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--ld-border);
  border-radius: var(--ld-radius);
  overflow: hidden;
  background: var(--ld-bg);
}

.ld-product-card__mockup {
  aspect-ratio: 4 / 5;
  position: relative;
  background: #f3f4f6;
  overflow: hidden;
}

.ld-product-card__mockup .ld-mockup--card {
  width: 100%;
  height: 100%;
  aspect-ratio: unset;
  border-radius: 0;
}

.ld-product-card__name {
  font-size: 0.75rem;
  font-weight: 600;
  margin: 8px 8px 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ld-product-card__price {
  font-size: 0.8125rem;
  color: var(--ld-muted);
  margin: 0 8px 8px;
}

.ld-product-card .ld-btn--select {
  margin: 0 8px 8px;
  width: calc(100% - 16px);
}

/* Mockup overlay */
.ld-mockup {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background-color: #f3f4f6;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  border-radius: var(--ld-radius);
  overflow: hidden;
}

.ld-mockup--large {
  margin-bottom: 16px;
}

.ld-mockup__logo {
  position: absolute;
  transform: translate(-50%, -50%);
  object-fit: contain;
  pointer-events: none;
  max-height: 40%;
}

/* Bottom Sheet */
.ld-sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.ld-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.ld-sheet__panel {
  position: relative;
  background: var(--ld-bg);
  border-radius: 16px 16px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--ld-shadow);
  animation: ld-slide-up 0.25s ease;
}

@keyframes ld-slide-up {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.ld-sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--ld-border);
  border-radius: 2px;
  margin: 10px auto 0;
}

.ld-sheet__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: var(--ld-touch);
  height: var(--ld-touch);
  border: none;
  background: transparent;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ld-muted);
  z-index: 2;
}

.ld-sheet__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px 120px;
  -webkit-overflow-scrolling: touch;
}

.ld-sheet__title {
  font-size: 1rem;
  margin: 0 40px 12px 0;
  line-height: 1.3;
}

.ld-sheet__section {
  margin-bottom: 20px;
}

.ld-sheet__label {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ld-muted);
}

.ld-sheet__footer {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  background: var(--ld-bg);
  border-top: 1px solid var(--ld-border);
  z-index: 3;
}

/* Position chips */
.ld-position-list,
.ld-color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ld-chip {
  min-height: var(--ld-touch);
  padding: 8px 14px;
  border: 1px solid var(--ld-border);
  border-radius: 999px;
  background: #fff;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: center;
}

.ld-chip--active {
  border-color: var(--ld-primary);
  background: var(--ld-primary);
  color: #fff;
}

/* Size rows */
.ld-size-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ld-size-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--ld-touch);
  padding: 4px 0;
  border-bottom: 1px solid var(--ld-border);
}

.ld-size-row__label {
  font-weight: 600;
  min-width: 48px;
}

.ld-qty-control {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ld-qty-btn {
  width: var(--ld-touch);
  height: var(--ld-touch);
  border: 1px solid var(--ld-border);
  border-radius: 8px;
  background: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.ld-qty-value {
  min-width: 32px;
  text-align: center;
  font-weight: 600;
  font-size: 1rem;
}

/* Price bar */
.ld-price-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ld-price-bar__label {
  display: block;
  font-size: 0.75rem;
  color: var(--ld-muted);
}

.ld-price-bar__qty {
  font-size: 0.8125rem;
}

.ld-price-bar__price {
  font-size: 1.25rem;
}

.ld-configurator-notice {
  padding: 16px;
  background: #fef2f2;
  border-radius: var(--ld-radius);
}

/* Tablet+ */
@media (min-width: 480px) {
  .ld-configurator {
    max-width: 560px;
    padding: 24px;
  }

  .ld-configurator__title {
    font-size: 1.75rem;
  }

  .ld-product-grid {
    gap: 16px;
  }
}
