/* ============================================================
   Pflegebox Wizard – Styles
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=DM+Serif+Display&display=swap');

/* ---------- Root Variables ---------- */
.pbw-wizard {
    --pbw-primary:     #1a6b4a;
    --pbw-primary-dk:  #134e37;
    --pbw-primary-lt:  #e8f5ef;
    --pbw-accent:      #f5a623;
    --pbw-danger:      #e05252;
    --pbw-success:     #27ae60;
    --pbw-text:        #1e2a22;
    --pbw-muted:       #6b7c74;
    --pbw-border:      #d4e4db;
    --pbw-bg:          #ffffff;
    --pbw-card-bg:     #f9fbfa;
    --pbw-radius:      12px;
    --pbw-radius-sm:   6px;
    --pbw-shadow:      0 4px 24px rgba(26,107,74,0.10);
    --pbw-shadow-hover:0 8px 32px rgba(26,107,74,0.18);
    --pbw-font:        'DM Sans', sans-serif;
    --pbw-font-display:'DM Serif Display', serif;
    --pbw-transition:  0.22s ease;
    --pbw-max-width:   900px;

    font-family: var(--pbw-font);
    color: var(--pbw-text);
    max-width: var(--pbw-max-width);
    margin: 0 auto;
    padding: 0 16px 48px;
}

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

/* ---------- Progress Bar ---------- */
.pbw-progress {
    margin: 32px 0 36px;
}
.pbw-progress__steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}
.pbw-step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
    z-index: 1;
}
.pbw-step-indicator__number {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--pbw-border);
    background: #fff;
    color: var(--pbw-muted);
    font-weight: 700;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pbw-transition);
}
.pbw-step-indicator__label {
    font-size: 12px;
    color: var(--pbw-muted);
    font-weight: 500;
    white-space: nowrap;
    transition: color var(--pbw-transition);
}
.pbw-step-indicator.active .pbw-step-indicator__number {
    background: var(--pbw-primary);
    border-color: var(--pbw-primary);
    color: #fff;
    box-shadow: 0 0 0 4px rgba(26,107,74,0.15);
}
.pbw-step-indicator.active .pbw-step-indicator__label {
    color: var(--pbw-primary);
    font-weight: 700;
}
.pbw-step-indicator.completed .pbw-step-indicator__number {
    background: var(--pbw-primary-lt);
    border-color: var(--pbw-primary);
    color: var(--pbw-primary);
}
.pbw-step-indicator.completed .pbw-step-indicator__label {
    color: var(--pbw-primary);
}
.pbw-progress__line {
    flex: 1;
    height: 2px;
    background: var(--pbw-border);
    margin: 0 8px;
    margin-bottom: 26px;
    transition: background var(--pbw-transition);
    max-width: 120px;
}
.pbw-progress__line.done {
    background: var(--pbw-primary);
}

/* ---------- Panels ---------- */
.pbw-panel {
    display: none;
    background: var(--pbw-bg);
    border: 1px solid var(--pbw-border);
    border-radius: var(--pbw-radius);
    padding: 36px 40px 32px;
    box-shadow: var(--pbw-shadow);
    animation: pbwFadeIn 0.32s ease;
}
.pbw-panel--active { display: block; }

@keyframes pbwFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Panel Header ---------- */
.pbw-panel__header { margin-bottom: 28px; }
.pbw-panel__title {
    font-family: var(--pbw-font-display);
    font-size: 26px;
    font-weight: 400;
    color: var(--pbw-text);
    margin: 0 0 10px;
    line-height: 1.25;
}
.pbw-panel__desc {
    font-size: 14px;
    color: var(--pbw-muted);
    line-height: 1.65;
    margin: 0;
}

/* ---------- Budget Bar ---------- */
.pbw-budget-bar {
    margin-top: 20px;
    background: var(--pbw-card-bg);
    border: 1px solid var(--pbw-border);
    border-radius: var(--pbw-radius-sm);
    padding: 14px 18px;
}
.pbw-budget-bar__label {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--pbw-text);
}
.pbw-budget-bar__value { color: var(--pbw-primary); }
.pbw-budget-bar__track {
    height: 8px;
    background: var(--pbw-border);
    border-radius: 99px;
    overflow: hidden;
}
.pbw-budget-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--pbw-primary), #2ecc89);
    border-radius: 99px;
    transition: width 0.35s ease, background 0.35s ease;
}
.pbw-budget-bar__fill.over { background: var(--pbw-danger); }
.pbw-budget-bar__hint {
    font-size: 12px;
    color: var(--pbw-muted);
    margin: 6px 0 0;
}
.pbw-budget-bar__hint.warn { color: var(--pbw-danger); font-weight: 600; }

/* ---------- Form ---------- */
.pbw-form { margin-bottom: 24px; }
.pbw-form__row { display: grid; gap: 16px; }
.pbw-form__row--2col { grid-template-columns: 1fr 1fr; }
.pbw-form__row + .pbw-form__row { margin-top: 16px; }
.pbw-form__group { display: flex; flex-direction: column; gap: 6px; }
.pbw-form__note { font-size: 12px; color: var(--pbw-muted); margin: 14px 0 0; }
.pbw-required { color: var(--pbw-danger); }

.pbw-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--pbw-text);
}
.pbw-input {
    border: 1.5px solid var(--pbw-border);
    border-radius: var(--pbw-radius-sm);
    padding: 11px 14px;
    font-family: var(--pbw-font);
    font-size: 14px;
    color: var(--pbw-text);
    background: var(--pbw-bg);
    transition: border-color var(--pbw-transition), box-shadow var(--pbw-transition);
    outline: none;
}
.pbw-input:focus {
    border-color: var(--pbw-primary);
    box-shadow: 0 0 0 3px rgba(26,107,74,0.12);
}
.pbw-input.pbw-input--error {
    border-color: var(--pbw-danger);
    box-shadow: 0 0 0 3px rgba(224,82,82,0.10);
}

/* ---------- Product Grid ---------- */
.pbw-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}
.pbw-product-card {
    background: var(--pbw-card-bg);
    border: 2px solid var(--pbw-border);
    border-radius: var(--pbw-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color var(--pbw-transition), box-shadow var(--pbw-transition), transform var(--pbw-transition);
    cursor: pointer;
    position: relative;
}
.pbw-product-card:hover {
    border-color: var(--pbw-primary);
    box-shadow: var(--pbw-shadow-hover);
    transform: translateY(-2px);
}
.pbw-product-card.selected {
    border-color: var(--pbw-primary);
    background: var(--pbw-primary-lt);
}
.pbw-product-card__img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: var(--pbw-radius-sm);
    background: #fff;
    padding: 8px;
}
.pbw-product-card__img-placeholder {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--pbw-radius-sm);
    background: linear-gradient(135deg, #e8f5ef 0%, #d0ead9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
}
.pbw-product-card__body { flex: 1; }
.pbw-product-card__name {
    font-weight: 700;
    font-size: 14px;
    color: var(--pbw-text);
    margin: 0 0 2px;
}
.pbw-product-card__unit {
    font-size: 12px;
    color: var(--pbw-muted);
}

/* Options (size, material) */
.pbw-product-options { display: flex; flex-direction: column; gap: 8px; }
.pbw-option-group { display: flex; flex-direction: column; gap: 4px; }
.pbw-option-label { font-size: 11px; font-weight: 600; color: var(--pbw-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.pbw-option-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.pbw-chip {
    padding: 3px 10px;
    border: 1.5px solid var(--pbw-border);
    border-radius: 99px;
    font-size: 11px;
    font-weight: 600;
    color: var(--pbw-muted);
    cursor: pointer;
    background: #fff;
    transition: all var(--pbw-transition);
}
.pbw-chip:hover { border-color: var(--pbw-primary); color: var(--pbw-primary); }
.pbw-chip.active {
    background: var(--pbw-primary);
    border-color: var(--pbw-primary);
    color: #fff;
}

/* Qty control */
.pbw-product-card__qty {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}
.pbw-qty-btn {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--pbw-border);
    border-radius: 50%;
    background: #fff;
    color: var(--pbw-text);
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--pbw-transition);
    padding: 0;
    font-family: var(--pbw-font);
}
.pbw-qty-btn:hover {
    background: var(--pbw-primary);
    border-color: var(--pbw-primary);
    color: #fff;
}
.pbw-qty-display {
    font-size: 14px;
    font-weight: 700;
    min-width: 20px;
    text-align: center;
    color: var(--pbw-text);
}

/* Selected badge */
.pbw-product-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--pbw-primary);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 12px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}
.pbw-product-card.selected .pbw-product-card__badge { display: flex; }

/* ---------- Buttons ---------- */
.pbw-panel__actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}
.pbw-panel__actions--between { justify-content: space-between; }

.pbw-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: var(--pbw-radius-sm);
    font-family: var(--pbw-font);
    font-size: 15px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--pbw-transition);
    text-decoration: none;
}
.pbw-btn--primary {
    background: var(--pbw-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,107,74,0.25);
}
.pbw-btn--primary:hover {
    background: var(--pbw-primary-dk);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26,107,74,0.30);
}
.pbw-btn--ghost {
    background: transparent;
    color: var(--pbw-muted);
    border: 1.5px solid var(--pbw-border);
}
.pbw-btn--ghost:hover {
    border-color: var(--pbw-primary);
    color: var(--pbw-primary);
}
.pbw-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
.pbw-btn__arrow { font-size: 18px; line-height: 1; }

/* ---------- SSL Badge ---------- */
.pbw-ssl {
    text-align: center;
    font-size: 12px;
    color: var(--pbw-muted);
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}
.pbw-ssl__icon { font-size: 14px; }

/* ---------- Summary (Step 3) ---------- */
.pbw-summary { display: grid; gap: 24px; margin-bottom: 24px; }
.pbw-summary__section {
    background: var(--pbw-card-bg);
    border: 1px solid var(--pbw-border);
    border-radius: var(--pbw-radius);
    padding: 20px 24px;
}
.pbw-summary__heading {
    font-family: var(--pbw-font-display);
    font-size: 18px;
    font-weight: 400;
    color: var(--pbw-text);
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--pbw-border);
}
.pbw-summary__dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 16px;
    margin: 0;
    font-size: 14px;
}
.pbw-summary__dl dt { color: var(--pbw-muted); font-weight: 500; white-space: nowrap; }
.pbw-summary__dl dd { margin: 0; font-weight: 600; color: var(--pbw-text); }

.pbw-summary__products { display: flex; flex-direction: column; gap: 8px; }
.pbw-summary__product {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid var(--pbw-border);
    font-size: 14px;
}
.pbw-summary__product:last-child { border-bottom: none; }
.pbw-summary__product-icon { font-size: 22px; width: 32px; text-align: center; }
.pbw-summary__product-info { flex: 1; }
.pbw-summary__product-name { font-weight: 600; color: var(--pbw-text); }
.pbw-summary__product-detail { font-size: 12px; color: var(--pbw-muted); }
.pbw-summary__product-qty {
    background: var(--pbw-primary-lt);
    color: var(--pbw-primary);
    font-weight: 700;
    border-radius: 99px;
    padding: 2px 10px;
    font-size: 13px;
}

/* ---------- Notice ---------- */
.pbw-notice {
    border-radius: var(--pbw-radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 16px;
}
.pbw-notice--error { background: #fdf0f0; border: 1px solid #f5c6c6; color: var(--pbw-danger); }
.pbw-notice--success { background: #eef8f2; border: 1px solid #b3dfca; color: var(--pbw-success); }

/* ---------- Success State ---------- */
.pbw-success {
    text-align: center;
    padding: 40px 20px;
    animation: pbwFadeIn 0.4s ease;
}
.pbw-success__icon {
    width: 64px;
    height: 64px;
    background: var(--pbw-success);
    color: #fff;
    border-radius: 50%;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    animation: pbwPop 0.4s 0.1s both;
}
@keyframes pbwPop {
    from { transform: scale(0); }
    60%  { transform: scale(1.15); }
    to   { transform: scale(1); }
}
.pbw-success__title {
    font-family: var(--pbw-font-display);
    font-size: 28px;
    font-weight: 400;
    color: var(--pbw-text);
    margin: 0 0 10px;
}
.pbw-success__msg { color: var(--pbw-muted); font-size: 15px; max-width: 400px; margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .pbw-panel { padding: 24px 18px 20px; }
    .pbw-form__row--2col { grid-template-columns: 1fr; }
    .pbw-products { grid-template-columns: 1fr 1fr; }
    .pbw-panel__title { font-size: 22px; }
    .pbw-progress__line { max-width: 40px; }
    .pbw-step-indicator__label { font-size: 10px; }
}
@media (max-width: 400px) {
    .pbw-products { grid-template-columns: 1fr; }
    .pbw-step-indicator__label { display: none; }
}
