/* =========================================================
   Primader Kalkulator Desek (uproszczony) – style frontowe
   ========================================================= */

.pbc-wrapper {
    max-width: 960px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e1e1e;
    line-height: 1.5;
}

.pbc-wrapper * { box-sizing: border-box; }

/* ---- Pasek postępu ---- */
.pbc-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
    position: relative;
}
.pbc-progress::before {
    content: "";
    position: absolute;
    top: 18px;
    left: 8%;
    right: 8%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}
.pbc-progress-step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
}
.pbc-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    color: #999;
    font-weight: 700;
    transition: all .2s;
}
.pbc-progress-step.active .pbc-step-num {
    background: #2e7d32;
    border-color: #2e7d32;
    color: #fff;
}
.pbc-progress-step.completed .pbc-step-num {
    background: #a5d6a7;
    border-color: #a5d6a7;
    color: #fff;
}
.pbc-step-label {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #666;
}
.pbc-progress-step.active .pbc-step-label { color: #2e7d32; font-weight: 600; }

/* ---- Kroki ---- */
.pbc-step { display: none; }
.pbc-step.active { display: block; animation: pbcFade .25s ease; }
@keyframes pbcFade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.pbc-step h2 { margin: 0 0 8px; font-size: 24px; }
.pbc-step-desc { color: #666; margin: 0 0 20px; }

/* ---- Metoda wprowadzania ---- */
.pbc-method-selector {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pbc-method-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    flex: 1;
    min-width: 200px;
}
.pbc-method-option input { accent-color: #2e7d32; }

/* ---- Formularze ---- */
.pbc-form-group { margin-bottom: 16px; }
.pbc-form-group label { display: block; font-weight: 600; margin-bottom: 6px; }
.pbc-form-group input,
.pbc-dim-field input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
}
.pbc-form-group input:focus,
.pbc-dim-field input:focus { border-color: #2e7d32; outline: none; }

.pbc-input-manual, .pbc-input-shape { display: none; }
.pbc-input-manual.active, .pbc-input-shape.active { display: block; }

/* ---- Wybór kształtu ---- */
.pbc-shape-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}
.pbc-shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    font-size: 13px;
    text-align: center;
}
.pbc-shape-option:hover { border-color: #a5d6a7; }
.pbc-shape-option.selected { border-color: #2e7d32; background: #f1f8e9; }

.pbc-shape-config { background: #fafafa; border: 1px solid #eee; border-radius: 10px; padding: 20px; }
.pbc-dims-desc { margin: 0 0 16px; color: #666; }
.pbc-dims-group { display: none; }
.pbc-dims-group.active { display: block; }
.pbc-dims-row { display: flex; gap: 16px; margin-bottom: 12px; }
.pbc-dim-field { flex: 1; display: flex; align-items: center; gap: 8px; }
.pbc-dim-field label { font-weight: 700; width: 20px; }
.pbc-unit { color: #999; font-size: 14px; }

.pbc-computed-area {
    margin-top: 12px;
    padding: 12px 16px;
    background: #f1f8e9;
    border-radius: 8px;
    font-size: 15px;
}

/* ---- Karty desek ---- */
.pbc-boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.pbc-board-card {
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all .15s;
    display: flex;
    flex-direction: column;
}
.pbc-board-card:hover { border-color: #a5d6a7; box-shadow: 0 4px 14px rgba(0,0,0,.08); }
.pbc-board-card.selected { border-color: #2e7d32; box-shadow: 0 4px 14px rgba(46,125,50,.2); }
.pbc-board-img {
    height: 150px;
    background-size: cover;
    background-position: center;
    background-color: #f0f0f0;
}
.pbc-board-img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 13px;
}
.pbc-board-body { padding: 14px; display: flex; flex-direction: column; flex: 1; }
.pbc-board-name { margin: 0 0 2px; font-size: 17px; }
.pbc-board-series { color: #2e7d32; font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.pbc-board-specs { font-size: 13px; color: #555; line-height: 1.7; }
.pbc-board-desc { font-size: 13px; color: #777; margin: 8px 0 0; }
.pbc-board-price { margin: 10px 0; font-size: 18px; font-weight: 700; color: #1e1e1e; }
.pbc-board-price span { font-size: 13px; font-weight: 400; color: #999; }
.pbc-board-body .pbc-btn-select { margin-top: auto; }

/* ---- Dodatkowe deski ---- */
.pbc-extra-boards {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: #fafafa;
}
.pbc-extra-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pbc-extra-label small { display: block; color: #888; }

/* ---- Steppery ---- */
.pbc-stepper { display: inline-flex; align-items: center; gap: 10px; }
.pbc-stepper-btn {
    width: 34px; height: 34px;
    border: 2px solid #e0e0e0;
    background: #fff;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
}
.pbc-stepper-btn:hover { border-color: #2e7d32; }
.pbc-extra-count { min-width: 24px; text-align: center; font-weight: 700; font-size: 18px; }
.pbc-stepper-unit { color: #999; }

/* ---- Zapas materiału ---- */
.pbc-reserve-selector {
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
}
.pbc-reserve-label { margin-bottom: 10px; }
.pbc-reserve-controls { display: flex; align-items: center; gap: 12px; }
.pbc-reserve-controls input[type="range"] { flex: 1; accent-color: #2e7d32; }

/* ---- Wynik ---- */
.pbc-result-card {
    border: 2px solid #2e7d32;
    border-radius: 12px;
    padding: 24px;
    background: #fff;
}
.pbc-result-board { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid #eee; }
.pbc-result-thumb { width: 64px; height: 64px; border-radius: 8px; background-size: cover; background-position: center; flex-shrink: 0; }
.pbc-result-board-name { font-size: 18px; font-weight: 700; }
.pbc-result-board-specs { color: #666; font-size: 14px; }

.pbc-result-rows { margin-bottom: 16px; }
.pbc-result-row { display: flex; justify-content: space-between; padding: 8px 0; }
.pbc-result-label { color: #555; }
.pbc-result-value.pbc-big { font-size: 18px; }
.pbc-result-total { border-top: 2px solid #eee; margin-top: 6px; padding-top: 12px; font-size: 18px; }
.pbc-result-price-block { border-top: 1px dashed #ddd; padding-top: 12px; }
.pbc-result-grand { font-size: 20px; color: #2e7d32; }
.pbc-result-note {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f1f8e9;
    border-radius: 8px;
    font-size: 13px;
    color: #555;
}

/* ---- Przyciski ---- */
.pbc-step-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.pbc-btn {
    padding: 13px 24px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
}
.pbc-btn:disabled { opacity: .5; cursor: not-allowed; }
.pbc-btn-primary { background: #FBB900 !important; color: #1e1e1e !important; border: none !important; }
.pbc-btn-primary:hover:not(:disabled) { background: #e0a600 !important; }
.pbc-btn-secondary { background: #f0f0f0 !important; color: #333 !important; border: none !important; }
.pbc-btn-secondary:hover { background: #e4e4e4 !important; }
.pbc-btn-outline { background: #fff !important; border: 2px solid #FBB900 !important; color: #1e1e1e !important; }
.pbc-btn-outline:hover { background: #fff8e6 !important; }
.pbc-btn-select { background: #FBB900 !important; color: #1e1e1e !important; border: none !important; width: 100%; }
.pbc-btn-select:hover { background: #e0a600 !important; }

/* ---- Komunikaty ---- */
.pbc-msg { padding: 12px 16px; border-radius: 8px; margin-top: 16px; }
.pbc-msg-error { background: #fdecea; color: #b71c1c; }
.pbc-msg-success { background: #edf7ed; color: #1e4620; }

.pbc-boards-empty { padding: 24px; text-align: center; color: #888; background: #fafafa; border-radius: 10px; }

.pbc-disclaimer { margin-top: 20px; font-size: 11px; color: #999; text-align: center; }

/* ---- Responsywność ---- */
@media (max-width: 600px) {
    .pbc-shape-selector { grid-template-columns: repeat(2, 1fr); }
    .pbc-step-label { font-size: 11px; }
    .pbc-step h2 { font-size: 20px; }
}

/* ---- Druk ---- */
@media print {
    .pbc-progress, .pbc-step-actions, .pbc-method-selector,
    .pbc-input-shape, .pbc-input-manual, .pbc-reserve-selector,
    .pbc-messages, #pbc-step-1, #pbc-step-2 { display: none !important; }
    .pbc-step { display: block !important; }
}
