/* WPO Frontend Styles */
.wpo-product-options {
    margin: 20px 0;
}

.wpo-set {
    margin-bottom: 28px;
}

.wpo-set-title {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 4px;
    color: #333;
}

.wpo-set-description {
    color: #666;
    font-size: 13px;
    margin: 0 0 14px;
}

/* Individual field */
.wpo-field {
    margin-bottom: 18px;
}

.wpo-field[style*="display:none"],
.wpo-field.wpo-hidden {
    display: none !important;
}

.wpo-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #333;
    font-size: 14px;
}

.wpo-required {
    color: #d63638;
}

.wpo-field-price {
    color: #444;
    font-weight: 400;
    font-size: 13px;
    margin-left: 6px;
}

.wpo-field-desc {
    display: block;
    color: #777;
    font-size: 14px;
    margin-bottom: 6px;
}

.wpo-field-desc-after {
    margin-top: 6px;
    margin-bottom: 0;
}

/* Inputs */
.wpo-input,
.wpo-textarea,
.wpo-select {
    width: 100%;
    max-width: 420px;
    padding: 9px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color .2s, box-shadow .2s;
    background: #fff;
    color: #333;
}

.wpo-input:focus,
.wpo-textarea:focus,
.wpo-select:focus {
    border-color: #9a3571;
    box-shadow: 0 0 0 2px rgba(0,115,170,.15);
    outline: none;
}

.wpo-textarea {
    resize: vertical;
    min-height: 90px;
}

/* Radio / Checkbox group */
.wpo-radio-group,
.wpo-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wpo-radio-label,
.wpo-checkbox-label {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 16px;
    padding: 10px 16px;
    border: 1px solid #b3b3b3;
    border-radius: 20px;
    max-width: 420px;
    transition: background .15s, border-color .15s;
}

.wpo-radio-label:hover,
.wpo-checkbox-label:hover {
    background: #faf6f8;
    border-color: #9a3571;
}

.wpo-radio-label input[type=radio],
.wpo-checkbox-label input[type=checkbox] {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: #9a3571;
}

.wpo-radio-label input[type=radio]:checked ~ .wpo-radio-text,
.wpo-checkbox-label input[type=checkbox]:checked ~ .wpo-checkbox-text {
    color: #9a3571;
    font-weight: 600;
}

.wpo-radio-label:has(input:checked),
.wpo-checkbox-label:has(input:checked) {
    border-color: #9a3571;
    background: #fbf2f7;
}

.wpo-choice-price {
    color: #555;
    font-weight: 400;
    font-size: 12px;
    margin-left: 4px;
}

/* Info text */
.wpo-info-text {
    padding: 12px 16px;
    background: #f8f9fa;
    border-left: 4px solid #9a3571;
    border-radius: 3px;
    color: #444;
    font-size: 14px;
    line-height: 1.5;
}

/* Price summary */
#wpo-price-summary {
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #fbf2f7;              /* bardzo jasny odcień akcentu */
    border: 1px solid #e6c3d8;        /* jaśniejszy odcień akcentu */
    border-left: 4px solid #9a3571;   /* pełny akcent */
    border-radius: 4px;
    font-size: 14px;
}

#wpo-price-summary .wpo-price-total {
    font-size: 18px;
    font-weight: 700;
    color: #9a3571;
}

#wpo-price-summary .wpo-price-breakdown {
    margin-top: 6px;
    color: #7a5468;                   /* przygaszony odcień akcentu */
    font-size: 13px;
}

#wpo-price-summary .wpo-price-breakdown li {
    list-style: none;
    display: flex;
    justify-content: space-between;
    padding: 2px 0;
}

/* Cart item options display */
.wpo-cart-options {
    margin: 4px 0 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: #555;
}

.wpo-cart-options li {
    padding: 1px 0;
}

.wpo-cart-options li strong {
    color: #333;
}

/* Validation error */
.wpo-field.wpo-has-error .wpo-input,
.wpo-field.wpo-has-error .wpo-textarea,
.wpo-field.wpo-has-error .wpo-select {
    border-color: #d63638;
}

.wpo-field-error {
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

/* Opis (za) w trybie "po wybraniu" – ukryty do czasu zaznaczenia */
.wpo-hidden-desc { display: none !important; }

/* ── Pole plikowe: własny przycisk zamiast natywnego inputu ───────────────── */
/* Natywny input ukryty, ale fokusowalny (komunikaty walidacji dla pól wymaganych) */
.wpo-file-field .wpo-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.wpo-file-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: #fff;
    border: 1px solid #1a1a1a;
    border-radius: 20px;
    cursor: pointer;
    box-sizing: border-box;
    transition: border-color .12s ease, background .12s ease, color .12s ease;
}

.wpo-file-button:hover {
    border-color: #9a3571;
    color: #9a3571;
}

.wpo-file-button.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.wpo-file-button-text {
    flex: 1 1 auto;
    font-size: 15px;
    line-height: 1.3;
}

.wpo-file-button-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
}

/* Nazwy wybranych plików */
.wpo-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.wpo-file-chip {
    display: inline-block;
    padding: 4px 10px;
    background: #fbf2f7;
    border: 1px solid #e6c3d8;
    border-radius: 14px;
    font-size: 13px;
    color: #9a3571;
    overflow-wrap: anywhere;
}
/* Pliki zachowane z edytowanej pozycji koszyka */
.wpo-file-kept-note {
    flex-basis: 100%;
    width: 100%;
    font-size: 12px;
    color: #777;
}

/* ── Tryb edycji pozycji z koszyka ────────────────────────────────────────── */
.wpo-edit-banner {
    margin: 20px 0 20px;
    padding: 12px 16px;
    background: #fbf2f7;
    border: 1px solid #e6c3d8;
    border-left: 4px solid #9a3571;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
}
.wpo-edit-banner-cancel {
    display: inline-block;
    margin-top: 4px;
    color: #9a3571;
    font-weight: 600;
    text-decoration: underline;
}

.wpo-file-email-label {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Kolor poglądowy wyboru – kółko przed etykietą */
.wpo-color-swatch {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.15);
    margin-right: 8px;
    vertical-align: middle;
    flex-shrink: 0;
}

/* Lista rozwijana z próbnikiem koloru obok (własny dropdown) */
.wpo-select-with-color,
.wpo-select-wrap {
    position: relative;
}

/* Natywny select zostaje w formularzu (wartość + walidacja), ale jest niewidoczny.
   Nie używamy display:none, żeby pozostał fokusowalny dla komunikatów walidacji. */
.wpo-select-with-color .wpo-select,
.wpo-select-wrap .wpo-select {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.wpo-cd-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    text-align: left;
    padding: 13px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 20px;
    font: inherit;
    color: inherit;
    cursor: pointer;
    min-height: 42px;
}
.wpo-cd-button:hover { border-color: #999; }
.wpo-cd-button:focus-visible {
    outline: none;
    border-color: #9a3571;
    box-shadow: 0 0 0 2px rgba(154, 53, 113, .18);
}
/* Nic jeszcze nie wybrano – podpowiedź wyszarzona jak placeholder */
.wpo-cd-button.is-placeholder .wpo-cd-label { color: #8a8a8a; }
/* Pole bez kolorów: etykieta zaczyna się od lewej krawędzi */
.wpo-cd-nocolors .wpo-cd-button { gap: 6px; }
/* Chevron listy – cienka „ptaszka” z zaokrąglonymi końcami */
.wpo-cd-arrow {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    color: #9a9a9a;
    margin-right: 4px;
}
.wpo-cd-arrow svg { display: block; }

/* Kropka koloru wewnątrz pola – zmienia się przy najechaniu na pozycje listy */
.wpo-cd-btn-swatch {
    margin-right: 0;
    flex: 0 0 auto;
    transition: background .12s ease;
}
.wpo-cd-label { flex: 1 1 auto; }

.wpo-cd-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 50;
    margin: 4px 0 0;
    padding: 4px;
    list-style: none;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 6px 20px rgba(0,0,0,.14);
    max-height: 280px;
    overflow-y: auto;
}
.wpo-cd-list.is-open { display: block; }

.wpo-cd-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin: 0;
    border-radius: 3px;
    cursor: pointer;
}
.wpo-cd-item:hover,
.wpo-cd-item.is-active { background: #f2f4f7; }
.wpo-cd-item.is-selected { background: #fbf2f7; font-weight: 600; }
/* Komfort dotyku na mobilkach */
@media (max-width: 782px) {
    .wpo-cd-item { padding: 12px 12px; }
    .wpo-cd-list { max-height: 60vh; }
}
.wpo-cd-item-text { flex: 1 1 auto; }
.wpo-cd-nocolor {
    background: transparent !important;
    border-style: dashed;
    opacity: .45;
}

/* ── Opis konkretnego wyboru (radio/checkbox) ─────────────────────────────── */
/* Renderowany bezpośrednio pod swoim inputem, ze strzałką wcięcia */
.wpo-radio-group .wpo-choice-desc-text,
.wpo-checkbox-group .wpo-choice-desc-text {
    position: relative;
    margin: 6px 0 14px;
    padding-left: 30px;
    color: #000;
    font-size: 16px;
    line-height: 1.55;
}

/* Dodatkowe wcięcie opisu wyboru */
.wpo-field-desc.wpo-choice-desc-text {
    margin-left: 20px;
}

.wpo-radio-group .wpo-choice-desc-text::before,
.wpo-checkbox-group .wpo-choice-desc-text::before {
    content: "↳";
    position: absolute;
    left: 6px;
    top: 0;
    color: #000;
    font-size: 16px;
    line-height: 1.4;
}

/* Pierwszy akapit/pogrubienie w opisie pełni rolę tytułu */
.wpo-choice-desc-text strong,
.wpo-choice-desc-text b {
    display: block;
    color: #000;
    margin-bottom: 4px;
}

/* Nie podkreślamy treści opisu – tylko realne linki */
.wpo-choice-desc-text a { text-decoration: underline; }
.wpo-choice-desc-text { text-decoration: none; }

/* Odstęp między pozycjami radio gdy mają opisy */
.wpo-radio-group .wpo-radio-label,
.wpo-checkbox-group .wpo-checkbox-label {
    margin-bottom: 4px;
}

/* ── Progi nakładu: komunikaty przy polu ilości ───────────────────────────── */
.wpo-qty-notice {
    display: block;
    /* Gdy rodzic jest flexem, wymuś pełną szerokość (bez order – przesuwałby
       komunikat na koniec kontenera, czyli pod przycisk dodania do koszyka). */
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
    clear: both;
    /* Komunikat siedzi nad polem ilości */
    margin: 0 0 14px 0;
    padding: 10px 14px;
    background: #fbf2f7;
    border: 1px solid #e6c3d8;
    border-left: 3px solid #9a3571;
    border-radius: 4px;
    color: #6d2551;
    font-size: 14px;
    line-height: 1.45;
}

/* Wariant informacyjny – uprzedzenie, nie błąd */
.wpo-qty-notice.is-info {
    background: #f7f7f8;
    border-color: #ddd;
    border-left-color: #999;
    color: #555;
}

/* Podświetlenie pola progu po nieudanym dodaniu do koszyka */
.wpo-field-qty-control.wpo-qty-highlight {
    outline: 2px solid #9a3571;
    outline-offset: 6px;
    border-radius: 4px;
    transition: outline-color .2s ease;
}

/* Tytuł opisu wyboru jest blokowy – <br> zaraz po nim dawałby pustą linię */
.wpo-choice-desc-text strong + br,
.wpo-choice-desc-text b + br {
    display: none;
}
