.wdpc-calculator {
    box-sizing: border-box;
    direction: rtl;
    max-width: 100%;
    margin: 0 0 1.5rem;
    padding: 1.25rem 1.15rem 1.4rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.wdpc-calculator *,
.wdpc-calculator *::before,
.wdpc-calculator *::after {
    box-sizing: border-box;
}

.wdpc-calculator > h3 {
    margin: 0 0 1.1rem;
    padding: 0 0 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 1.15rem;
    font-weight: 700;
}

.wdpc-dimensions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 0 0 1.15rem;
}

.wdpc-dimensions p {
    margin: 0;
}

.wdpc-dimensions label {
    display: block;
    margin: 0 0 0.4rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
}

.wdpc-dimensions input[type="number"] {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 1rem;
}

.wdpc-dimensions input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wdpc-field {
    margin: 0 0 1.2rem;
}

.wdpc-field > strong {
    display: block;
    margin: 0 0 0.7rem;
    color: #0f172a;
    font-size: 0.98rem;
}

.wdpc-print {
    margin: 0 0 1.2rem;
}

.wdpc-print > strong {
    display: block;
    margin: 0 0 0.55rem;
    color: #0f172a;
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.5;
}

.wdpc-print-limits {
    margin: 0 0 0.85rem;
    padding: 0;
    list-style: none;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.7;
}

.wdpc-print-limits li {
    margin: 0;
}

.wdpc-print-input {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0;
    color: #0f172a;
    font-size: 0.95rem;
}

.wdpc-print-files {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 0.85rem 0 0;
    max-width: 100%;
}

.wdpc-print-files:empty {
    display: none;
    margin: 0;
}

.wdpc-print-file {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    width: 100%;
    max-width: 100%;
    padding: 0.9rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
}

.wdpc-print-file__head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    min-width: 0;
}

.wdpc-print-file__thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.wdpc-print-file__thumb img {
    display: block;
    width: 72px;
    height: 72px;
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
    border-radius: 8px;
}

.wdpc-print-file__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.wdpc-print-file__name {
    margin: 0;
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wdpc-print-file__size {
    margin: 0.2rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.wdpc-print-file__fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    min-width: 0;
}

.wdpc-print-file__field {
    margin: 0;
    min-width: 0;
}

.wdpc-print-file__field label {
    display: block;
    margin: 0 0 0.4rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.5;
}

.wdpc-print-file__field input[type="number"] {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 1rem;
}

.wdpc-print-file__field input[type="number"]:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.wdpc-print-file__actions {
    display: flex;
    justify-content: flex-end;
}

.wdpc-print-file__remove {
    min-height: 40px;
    padding: 0.45rem 0.85rem;
    border: 1px solid #fecaca;
    border-radius: 10px;
    background: #fff;
    color: #b91c1c;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}

.wdpc-print-file__remove:hover,
.wdpc-print-file__remove:focus {
    background: #fef2f2;
}

.wdpc-print-status {
    margin: 0.65rem 0 0;
    padding: 0;
    color: #334155;
    font-size: 0.85rem;
    line-height: 1.55;
}

.wdpc-print-status[hidden] {
    display: none;
}

.wdpc-print-status.is-ok {
    color: #166534;
}

.wdpc-print-status.is-error {
    color: #b91c1c;
}

.wdpc-print-status.is-pending {
    color: #334155;
}

.wdpc-print-hint {
    margin: 0.55rem 0 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.55;
}

.wdpc-print-size {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin: 0.85rem 0 0;
}

.wdpc-print-size p {
    margin: 0;
}

.wdpc-print-size label {
    display: block;
    margin: 0 0 0.4rem;
    color: #334155;
    font-size: 0.9rem;
    font-weight: 600;
}

.wdpc-print-size input[type="number"] {
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 1rem;
}

.wdpc-option-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.7rem;
}

.wdpc-option-card {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
    cursor: pointer;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.wdpc-option-card:hover {
    border-color: var(--wdpc-accent, #2563eb);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
}

.wdpc-option-card input.wdpc-option {
    position: absolute;
    inset-inline-start: 0.85rem;
    top: 50%;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.wdpc-option-card__body {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 54px;
    padding: 0.85rem 1rem;
}

.wdpc-option-card__swatch {
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--wdpc-accent, #2563eb);
}

.wdpc-option-card__text {
    flex: 1 1 auto;
    color: #0f172a;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.55;
}

.wdpc-option-card input.wdpc-option:focus-visible + .wdpc-option-card__body {
    box-shadow: inset 0 0 0 2px var(--wdpc-accent, #2563eb);
}

.wdpc-option-card input.wdpc-option:checked + .wdpc-option-card__body,
.wdpc-option-card:has(input.wdpc-option:checked) {
    background: color-mix(in srgb, var(--wdpc-accent, #2563eb) 8%, #fff);
}

.wdpc-option-card:has(input.wdpc-option:checked),
.wdpc-option-card.is-selected {
    border-color: var(--wdpc-accent, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wdpc-accent, #2563eb) 22%, transparent);
}

.wdpc-select-wrap {
    margin: 0;
}

.wdpc-select-wrap select.wdpc-option {
    width: 100%;
    min-height: 46px;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 1rem;
}

.wdpc-price-box {
    margin: 0.35rem 0 0;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: #0f172a;
    color: #fff;
}

.wdpc-price-box strong {
    color: #cbd5e1;
    font-size: 0.82rem;
    font-weight: 500;
}

.wdpc-price-result {
    display: block;
    margin-top: 0.2rem;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

.wdpc-hidden-inputs {
    display: none;
}

@media (min-width: 640px) {
    .wdpc-calculator {
        padding: 1.4rem 1.35rem 1.5rem;
    }

    .wdpc-dimensions {
        grid-template-columns: 1fr 1fr;
    }

    .wdpc-option-list {
        grid-template-columns: 1fr 1fr;
    }

    .wdpc-print-file__fields {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 639px) {
    .wdpc-calculator {
        padding: 1rem 0.9rem 1.15rem;
        border-radius: 14px;
    }

    .wdpc-option-card__body {
        min-height: 50px;
        padding: 0.75rem 0.85rem;
    }

    .wdpc-print-cart-file {
        flex-direction: column;
    }
}

.wdpc-print-cart-file {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    margin: 0.15rem 0;
    overflow: hidden;
}

.wdpc-print-cart-file__thumb {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}

.wdpc-print-cart-file__thumb img {
    display: block;
    width: 64px;
    height: 64px;
    max-width: 64px;
    max-height: 64px;
    object-fit: contain;
}

.wdpc-print-cart-file__meta {
    flex: 1 1 auto;
    min-width: 0;
}

.wdpc-print-cart-file__name,
.wdpc-print-cart-file__dim {
    margin: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wdpc-print-cart-file__name {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
}

.wdpc-print-cart-file__dim {
    margin-top: 0.15rem;
    color: #64748b;
    font-size: 0.82rem;
}

.wdpc-print-order-files {
    margin: 0.85rem 0 0;
    max-width: 100%;
}

.wdpc-print-order-files__title {
    display: block;
    margin: 0 0 0.65rem;
    color: #0f172a;
    font-size: 0.92rem;
}

.wdpc-print-order-file {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.85rem;
    padding: 0.85rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
}

.wdpc-print-order-file__preview {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100px;
    height: 100px;
    max-width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.wdpc-print-order-file__preview img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(100px, 100%);
    max-height: min(100px, 100%);
    object-fit: contain;
}

.wdpc-print-order-file__meta {
    min-width: 0;
}

.wdpc-print-order-file__name,
.wdpc-print-order-file__dim,
.wdpc-print-order-file__missing,
.wdpc-print-order-file__download {
    margin: 0 0 0.35rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.wdpc-print-order-file__missing {
    color: #b91c1c;
}

.wdpc-print-order-file__download .button {
    display: inline-block;
    margin-top: 0.25rem;
}
