/* ============================================================
   DOGSLAND KONFIGURATOR – STYLES
   ============================================================ */

/* Fonts: Dancing Script (Schnürlischrift) + Nunito (Blockschrift fallback) */
@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@700&family=Nunito:wght@700&family=Comfortaa:wght@700&display=swap');

/* ---- OUTER CONTAINER (max-width + centering) ------------- */
.dlk-outer {
  max-width: 1180px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ---- HERO SECTION ----------------------------------------- */
.dlk-hero {
  text-align: center;
  padding: 60px 20px 48px;
  color: #fff;
}
.dlk-hero-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fa3c7f;
  margin: 0 0 18px;
}
.dlk-hero-title {
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 20px;
  color: #fff;
}
.dlk-hero-title em {
  font-style: italic;
  color: #fa3c7f;
}
.dlk-hero-sub {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255,255,255,.65);
  max-width: 520px;
  margin: 0 auto;
}

.dlk-wrapper {
  --dlk-bg:        #0f0d0c;
  --dlk-surface:   #1a1715;
  --dlk-border:    rgba(255,255,255,.10);
  --dlk-text:      #ffffff;
  --dlk-muted:     rgba(255,255,255,.55);
  --dlk-accent:    #fa3c7f;
  --dlk-accent-hi: #ff5e96;
  --dlk-radius:    10px;

  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  background: var(--dlk-bg);
  color: var(--dlk-text);
  padding: 40px;
  border-radius: var(--dlk-radius);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
  overflow: visible; /* required for sticky preview to work */
}
.dlk-wrapper *, .dlk-wrapper *::before, .dlk-wrapper *::after { box-sizing: border-box; }

/* ---- TYP-AUSWAHL ------------------------------------------ */
.dlk-type-select {
}
.dlk-type-select-title {
  margin: 0 0 24px;
  font-size: 22px;
  font-weight: 700;
  color: var(--dlk-text);
}
.dlk-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.dlk-type-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  background: var(--dlk-surface);
  border: 1px solid var(--dlk-border);
  border-radius: var(--dlk-radius);
  overflow: hidden;
  color: var(--dlk-text);
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  transition: border-color .15s ease, transform .12s ease, background .15s ease;
}
.dlk-type-card:hover:not(.is-disabled) {
  border-color: var(--dlk-accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}
.dlk-type-card:focus-visible {
  outline: 2px solid var(--dlk-accent-hi);
  outline-offset: 2px;
}
.dlk-type-card.is-disabled {
  cursor: not-allowed;
  opacity: .5;
}

/* Product image at top of tile */
.dlk-type-card-img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--dlk-bg);
  flex-shrink: 0;
}
.dlk-type-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .3s ease;
}
.dlk-type-card:hover:not(.is-disabled) .dlk-type-card-img img {
  transform: scale(1.04);
}

/* Text body below image */
.dlk-type-card-body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 20px 20px;
}
.dlk-type-card-name {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}
.dlk-type-card-desc {
  font-size: 13px;
  color: var(--dlk-muted);
  line-height: 1.45;
}
.dlk-type-card-badge {
  margin-top: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--dlk-accent-hi);
  background: rgba(250,60,127,.14);
  padding: 4px 8px;
  border-radius: 4px;
}

/* ---- KONFIGURATOR-BEREICH (nach Typ-Auswahl) --------------- */
.dlk-configurator {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dlk-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--dlk-muted);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 0;
  width: fit-content;
  transition: color .15s ease;
}
.dlk-back-link:hover { color: var(--dlk-text); }
.dlk-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}

/* ---- LIVE-VORSCHAU --------------------------------------- */
.dlk-preview {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Form column: scrolls internally so preview stays put */
.dlk-form-col {
  max-height: 85vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.15) transparent;
}
.dlk-form-col::-webkit-scrollbar { width: 4px; }
.dlk-form-col::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.15);
  border-radius: 2px;
}
.dlk-preview-stage {
  border: 1px solid var(--dlk-border);
  border-radius: var(--dlk-radius);
  overflow: hidden;
  padding: 0;
  min-height: 280px;
  display: flex;
  align-items: stretch;
}

/* ---- COVER IMAGE PREVIEW --------------------------------- */
.dlk-cover-wrap {
  position: relative;
  width: 100%;
  background: linear-gradient(180deg, #15110f 0%, #0a0807 100%);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* Container for all stacked attribute layers */
.dlk-cover-layers {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
/* Each attribute gets one layer, stacked via z-index order (first = bottom) */
.dlk-cover-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  opacity: 0;
  transition: opacity .35s ease;
}
.dlk-cover-placeholder {
  position: relative;
  z-index: 1;
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--dlk-muted);
  font-size: 14px;
  text-align: center;
  padding: 24px;
}
.dlk-cover-placeholder:not([hidden]) {
  display: flex;
}
/* Stickerei name — always on top of all image layers */
.dlk-collar-name {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  font-size: 50px;
  font-weight: 700;
  letter-spacing: .04em;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
  pointer-events: none;
  transition: color .25s ease, font-family .25s ease;
}
.dlk-collar-motif-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.5));
  flex-shrink: 0;
  opacity: 0.95;
}
.dlk-preview-summary {
  background: var(--dlk-surface);
  border: 1px solid var(--dlk-border);
  border-radius: var(--dlk-radius);
  padding: 16px 20px;
  font-size: 14px;
  color: var(--dlk-muted);
  min-height: 64px;
}
.dlk-preview-summary strong { color: var(--dlk-text); font-weight: 600; }

/* ---- FORMULAR ------------------------------------------- */
.dlk-form { display: flex; flex-direction: column; gap: 28px; }
.dlk-step {
  border: none;
  margin: 0;
  padding: 0;
}
.dlk-step legend {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  color: var(--dlk-text);
}
.dlk-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--dlk-accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

/* ---- OPTIONEN ------------------------------------------- */
.dlk-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.dlk-option {
  position: relative;
  cursor: pointer;
}
.dlk-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
  margin: 0;
}
.dlk-option-label {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 16px;
  background: var(--dlk-surface);
  border: 1px solid var(--dlk-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--dlk-text);
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.dlk-option-label strong { font-weight: 600; }
.dlk-option-label em {
  font-style: normal;
  font-size: 12px;
  color: var(--dlk-muted);
}
.dlk-option:hover .dlk-option-label {
  border-color: rgba(255,255,255,.25);
}
.dlk-option input:checked + .dlk-option-label {
  border-color: var(--dlk-accent);
  background: rgba(250,60,127,.12);
}
.dlk-option input:focus-visible + .dlk-option-label {
  outline: 2px solid var(--dlk-accent-hi);
  outline-offset: 2px;
}

/* Farben (Swatches) */
.dlk-swatch {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: border-color .15s ease;
}
.dlk-swatch:hover { border-color: rgba(255,255,255,.20); }
.dlk-swatch input:checked ~ .dlk-swatch-dot {
  box-shadow: 0 0 0 3px var(--dlk-bg), 0 0 0 5px var(--dlk-accent);
}
.dlk-swatch-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.20);
  transition: box-shadow .15s ease;
}
.dlk-swatch-name {
  font-size: 11px;
  color: var(--dlk-muted);
}

/* ---- BILD-SWATCHES (swatch_image) ----------------------- */
.dlk-options-image {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.dlk-swatch-img {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .15s ease, transform .1s ease;
}
.dlk-swatch-img:hover {
  border-color: rgba(255,255,255,.25);
  transform: translateY(-2px);
}
.dlk-swatch-img input:checked ~ .dlk-swatch-img-wrap {
  box-shadow: 0 0 0 3px var(--dlk-bg), 0 0 0 5px var(--dlk-accent);
  border-radius: 8px;
}
.dlk-swatch-img input:checked ~ .dlk-swatch-img-name {
  color: var(--dlk-accent-hi);
}
.dlk-swatch-img-wrap {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: var(--dlk-surface);
  transition: box-shadow .15s ease;
}
.dlk-swatch-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.dlk-swatch-img-placeholder {
  background: repeating-linear-gradient(
    45deg,
    rgba(255,255,255,.05) 0px,
    rgba(255,255,255,.05) 6px,
    transparent 6px,
    transparent 12px
  );
}
.dlk-swatch-img-name {
  font-size: 11px;
  color: var(--dlk-muted);
  text-align: center;
  max-width: 80px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s ease;
}

/* ---- SELECT DROPDOWN (Breite Halsband) ------------------- */
.dlk-select-wrap {
  position: relative;
}
.dlk-select {
  width: 100%;
  background: var(--dlk-surface);
  border: 1px solid var(--dlk-border);
  border-radius: 8px;
  padding: 12px 40px 12px 14px;
  color: var(--dlk-text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23ffffff' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  transition: border-color .15s ease;
}
.dlk-select:focus {
  outline: none;
  border-color: var(--dlk-accent);
}
.dlk-select option {
  background: #1a1715;
  color: #fff;
}

/* ---- GENERIC TEXT INPUT (Halsumfang) --------------------- */
.dlk-text-input {
  width: 100%;
  background: var(--dlk-surface);
  border: 1px solid var(--dlk-border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--dlk-text);
  font-size: 15px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s ease;
}
.dlk-text-input:focus {
  outline: none;
  border-color: var(--dlk-accent);
}
.dlk-text-input::placeholder { color: rgba(255,255,255,.30); }

/* ---- NAME-FELD ----------------------------------------- */
.dlk-name-with-motif {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.dlk-name-with-motif .dlk-name-row {
  flex: 1;
}
.dlk-motif-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.dlk-motif-preview img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid var(--dlk-accent);
  background: var(--dlk-surface);
}
.dlk-motif-preview span {
  font-size: 11px;
  color: var(--dlk-muted);
  text-align: center;
  max-width: 64px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dlk-name-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dlk-name-row input[type="text"] {
  flex: 1;
  background: var(--dlk-surface);
  border: 1px solid var(--dlk-border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--dlk-text);
  font-size: 16px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.dlk-name-row input[type="text"]:focus {
  outline: none;
  border-color: var(--dlk-accent);
}
.dlk-name-row input[type="text"]::placeholder { color: rgba(255,255,255,.30); }
.dlk-name-counter {
  font-size: 13px;
  color: var(--dlk-muted);
  white-space: nowrap;
}
.dlk-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--dlk-muted);
}

/* ---- PREIS / CTA --------------------------------------- */
.dlk-cta {
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid var(--dlk-border);
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dlk-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.dlk-price-label {
  font-size: 14px;
  color: var(--dlk-muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.dlk-price-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--dlk-text);
}
.dlk-add-to-cart {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: var(--dlk-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s ease, transform .05s ease, opacity .15s ease;
  font-family: inherit;
}
.dlk-add-to-cart:hover:not(:disabled) { background: var(--dlk-accent-hi); }
.dlk-add-to-cart:active:not(:disabled) { transform: scale(.99); }
.dlk-add-to-cart:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.dlk-add-to-cart.is-loading { opacity: .7; cursor: progress; }

.dlk-message {
  margin: 0;
  font-size: 14px;
  min-height: 20px;
}
.dlk-message.is-error   { color: #ff7676; }
.dlk-message.is-success { color: #6ee08a; }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .dlk-wrapper { padding: 32px; gap: 32px; }
  .dlk-type-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .dlk-wrapper {
    padding: 24px;
    gap: 28px;
  }
  .dlk-main {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .dlk-form-col {
    max-height: none;
    overflow-y: visible;
    overflow-x: visible;
    padding-right: 0;
  }
  .dlk-type-grid {
    grid-template-columns: 1fr;
  }
  .dlk-preview {
    position: static;
  }
  .dlk-preview-stage {
    min-height: 320px;
  }
  .dlk-cover-wrap {
    aspect-ratio: 16 / 9;
    min-height: 320px;
  }
  .dlk-collar-name { font-size: 28px; }
}

@media (max-width: 480px) {
  .dlk-wrapper { padding: 16px; gap: 20px; border-radius: 0; }
  .dlk-step legend { font-size: 15px; }
  .dlk-option-label { padding: 9px 13px; font-size: 13px; }
  .dlk-swatch-dot { width: 32px; height: 32px; }
  .dlk-price-value { font-size: 24px; }
  .dlk-add-to-cart { padding: 14px 20px; font-size: 15px; }
  .dlk-options-image { gap: 10px; }
  .dlk-swatch-img-wrap { width: 72px; height: 72px; }
  .dlk-swatch-img-name { max-width: 72px; }
  .dlk-preview-stage {
    min-height: 260px;
  }
  .dlk-cover-wrap {
    aspect-ratio: 4 / 3;
    min-height: 260px;
  }
  .dlk-collar-name { font-size: 24px; }
}
