/*
 * 3opka.it UI Kit — Phase 1 Poster pilot.
 * Opt-in only: every rule is scoped to .threeopka-ui and an explicit UI class.
 * Preview, SVG, canvas, images and module-owned rendering are intentionally absent.
 */

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] {
    --threeopka-ui-color-brand: var(--threeopka-brand, #21aee8);
    --threeopka-ui-color-brand-hover: #168fc2;
    --threeopka-ui-color-brand-soft: #eef9fd;
    --threeopka-ui-color-text: #172026;
    --threeopka-ui-color-text-muted: #5f6b76;
    --threeopka-ui-color-surface: #ffffff;
    --threeopka-ui-color-surface-muted: #f7fafb;
    --threeopka-ui-color-border: #dbe8ec;
    --threeopka-ui-color-border-strong: #bfd2d9;
    --threeopka-ui-color-success: #16794a;
    --threeopka-ui-color-success-soft: #edf9f2;
    --threeopka-ui-color-warning: #9a6700;
    --threeopka-ui-color-warning-soft: #fff8e6;
    --threeopka-ui-color-error: #b42318;
    --threeopka-ui-color-error-soft: #fff2f0;
    --threeopka-ui-color-disabled: #9ca3af;
    --threeopka-ui-radius-sm: 4px;
    --threeopka-ui-radius-md: 7px;
    --threeopka-ui-radius-lg: 10px;
    --threeopka-ui-space-1: 4px;
    --threeopka-ui-space-2: 8px;
    --threeopka-ui-space-3: 12px;
    --threeopka-ui-space-4: 16px;
    --threeopka-ui-space-5: 20px;
    --threeopka-ui-space-6: 24px;
    --threeopka-ui-space-8: 32px;
    --threeopka-ui-font-size-xs: 12px;
    --threeopka-ui-font-size-sm: 13px;
    --threeopka-ui-font-size-md: 15px;
    --threeopka-ui-font-size-lg: 18px;
    --threeopka-ui-font-size-xl: 22px;
    --threeopka-ui-line-height-tight: 1.25;
    --threeopka-ui-line-height-normal: 1.5;
    --threeopka-ui-control-height: 44px;
    --threeopka-ui-focus-ring: 0 0 0 3px rgb(33 174 232 / 22%);
    --threeopka-ui-transition: 160ms ease;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] {
    padding: 24px !important;
    border: 1px solid var(--threeopka-ui-color-border);
    border-radius: 8px !important;
    background: var(--threeopka-ui-color-surface);
    color: var(--threeopka-ui-color-text);
    font-size: 14px;
    line-height: var(--threeopka-ui-line-height-normal);
    box-shadow: none !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-heading {
    margin: 0 0 20px;
    color: var(--threeopka-ui-color-text);
    font-size: 24px !important;
    font-weight: 700;
    line-height: var(--threeopka-ui-line-height-tight);
    letter-spacing: 0;
    text-align: center !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-heading__description {
    max-width: 760px;
    margin: -12px auto 24px;
    color: var(--threeopka-ui-color-text-muted);
    font-size: 14px;
    text-align: center;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px) !important;
    gap: 16px !important;
    align-items: start;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-content {
    min-width: 0;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-section {
    margin: 0;
    padding: 24px 0;
    border: 0;
    border-top: 1px solid var(--threeopka-ui-color-border);
    background: transparent;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-content > .threeopka-ui-section:first-child {
    padding-top: 0;
    border-top: 0;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-section__title {
    margin: 0 0 12px;
    color: var(--threeopka-ui-color-text);
    font-size: 20px !important;
    font-weight: 600;
    line-height: var(--threeopka-ui-line-height-tight);
    text-align: center !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-section__description {
    margin: calc(-1 * var(--threeopka-ui-space-1)) 0 var(--threeopka-ui-space-4);
    color: var(--threeopka-ui-color-text-muted);
    font-size: var(--threeopka-ui-font-size-sm);
    text-align: center;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-field {
    display: grid;
    gap: var(--threeopka-ui-space-2);
    min-width: 0;
    color: var(--threeopka-ui-color-text);
    font-size: var(--threeopka-ui-font-size-sm);
    font-weight: 600;
    text-align: left;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-control {
    width: 100%;
    min-height: 45px !important;
    padding: 9px 11px !important;
    border: 1px solid #c7c7c7;
    border-radius: 4px !important;
    background: var(--threeopka-ui-color-surface);
    color: var(--threeopka-ui-color-text);
    font: inherit;
    font-size: 14px;
    font-weight: 400;
    transition: border-color var(--threeopka-ui-transition), box-shadow var(--threeopka-ui-transition);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-control:hover {
    border-color: var(--threeopka-ui-color-brand);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-control:focus-visible {
    border-color: var(--threeopka-ui-color-brand);
    outline: 0;
    box-shadow: var(--threeopka-ui-focus-ring);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-control:disabled {
    background: var(--threeopka-ui-color-surface-muted);
    color: var(--threeopka-ui-color-disabled);
    cursor: not-allowed;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card-grid {
    gap: 10px;
}

/* Bridge declarations override legacy !important card styling during the pilot. */
.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 100px !important;
    padding: 12px 10px !important;
    border: 1px solid #d6d6d6 !important;
    border-radius: 6px !important;
    background: var(--threeopka-ui-color-surface) !important;
    color: var(--threeopka-ui-color-text) !important;
    box-shadow: none !important;
    transform: none !important;
    transition: border-color var(--threeopka-ui-transition), background var(--threeopka-ui-transition) !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card:hover {
    border-color: var(--threeopka-ui-color-brand) !important;
    background: var(--threeopka-ui-color-surface) !important;
    box-shadow: none !important;
    transform: none !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card:has(input:checked) {
    border-color: var(--threeopka-ui-color-brand) !important;
    background: var(--threeopka-ui-color-surface) !important;
    color: var(--threeopka-ui-color-text) !important;
    outline: none !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card:has(input:focus-visible):not(:has(input:checked)) {
    outline: 3px solid rgb(33 174 232 / 28%) !important;
    outline-offset: 2px;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card:has(input:checked):has(input:focus-visible) > span {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card > span {
    display: grid;
    gap: 7px;
    justify-items: center;
    text-align: center;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card > span > strong {
    font-size: 13px;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
}

/* Only standard plugin icons are resized; customer-provided SVG/images remain untouched. */
.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card .threeopka-poster-icon:not(.threeopka-poster-icon-custom):not(.threeopka-poster-icon-custom-image) {
    max-width: 50px;
    max-height: 50px;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-poster-format-card .threeopka-poster-format-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card .threeopka-poster-delivery-text {
    font-weight: 600;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card .threeopka-poster-delivery-date {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.1;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card:has(input:checked) > span > strong {
    font-weight: 700;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-disclosure {
    border-radius: var(--threeopka-ui-radius-md);
    background: var(--threeopka-ui-color-surface-muted);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-table {
    color: var(--threeopka-ui-color-text);
    font-size: var(--threeopka-ui-font-size-sm);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-upload {
    min-height: 150px;
    border: 1px dashed var(--threeopka-ui-color-border-strong);
    border-radius: var(--threeopka-ui-radius-md);
    background: var(--threeopka-ui-color-surface-muted);
    box-shadow: none;
    transition: border-color var(--threeopka-ui-transition), background var(--threeopka-ui-transition);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-upload:hover,
.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-upload:focus-within {
    border-color: var(--threeopka-ui-color-brand);
    background: var(--threeopka-ui-color-brand-soft);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-alert {
    padding: var(--threeopka-ui-space-3) var(--threeopka-ui-space-4);
    border: 1px solid var(--threeopka-ui-color-border);
    border-radius: var(--threeopka-ui-radius-md);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-alert.is-error {
    border-color: #f1b7b2;
    background: var(--threeopka-ui-color-error-soft);
    color: var(--threeopka-ui-color-error);
}

/* The legacy summary has per-instance ID selectors, so the bridge is explicit. */
.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary {
    position: sticky;
    top: var(--threeopka-ui-space-4);
    display: grid;
    gap: 0;
    width: 100%;
    max-width: none;
    padding: var(--threeopka-ui-space-5);
    border: 1px solid var(--threeopka-ui-color-border);
    border-radius: var(--threeopka-ui-radius-lg);
    background: var(--threeopka-ui-color-surface);
    box-shadow: none;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__title {
    margin: 0 0 var(--threeopka-ui-space-3);
    color: var(--threeopka-ui-color-text);
    font-size: var(--threeopka-ui-font-size-lg);
    font-weight: 700;
    line-height: var(--threeopka-ui-line-height-tight);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--threeopka-ui-space-4);
    min-height: 0;
    padding: var(--threeopka-ui-space-3) 0;
    border: 0;
    border-bottom: 0;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__label {
    color: var(--threeopka-ui-color-text-muted);
    font-size: var(--threeopka-ui-font-size-sm);
    font-weight: 400;
    line-height: var(--threeopka-ui-line-height-normal);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__value {
    color: var(--threeopka-ui-color-text);
    font-size: var(--threeopka-ui-font-size-sm);
    font-weight: 600;
    line-height: var(--threeopka-ui-line-height-normal);
    text-align: right;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-net {
    margin-top: var(--threeopka-ui-space-2);
    padding-top: var(--threeopka-ui-space-4);
    border-top: 1px solid var(--threeopka-ui-color-border);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-net .threeopka-ui-summary__label,
.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-net .threeopka-ui-summary__value {
    color: var(--threeopka-ui-color-text);
    font-size: 15px;
    font-weight: 700;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-tax .threeopka-ui-summary__label,
.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-tax .threeopka-ui-summary__value {
    font-size: var(--threeopka-ui-font-size-sm);
    font-weight: 400;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--threeopka-ui-space-4);
    margin: var(--threeopka-ui-space-2) 0 0;
    padding: var(--threeopka-ui-space-4) 0;
    border: 0;
    border-top: 1px solid var(--threeopka-ui-color-border);
    color: var(--threeopka-ui-color-text);
    font-size: 16px;
    font-weight: 700;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__total strong {
    color: var(--threeopka-ui-color-text) !important;
    font-size: 18px;
    font-weight: 700;
    line-height: var(--threeopka-ui-line-height-tight);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 59px;
    padding: 14px 18px;
    border: 1px solid transparent;
    border-radius: 6px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-transform: none;
    letter-spacing: 0;
    cursor: pointer;
    transition: background var(--threeopka-ui-transition), border-color var(--threeopka-ui-transition), box-shadow var(--threeopka-ui-transition);
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button.is-primary {
    border-color: var(--threeopka-ui-color-brand) !important;
    background: var(--threeopka-ui-color-brand) !important;
    color: #fff !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button.is-primary:hover {
    border-color: var(--threeopka-ui-color-brand-hover) !important;
    background: var(--threeopka-ui-color-brand-hover) !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button:focus-visible {
    outline: 0;
    box-shadow: var(--threeopka-ui-focus-ring) !important;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button.is-full {
    width: 100%;
}

.threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-mobile-checkout {
    border-top: 1px solid #cddce2 !important;
    background: rgb(255 255 255 / 98%) !important;
    box-shadow: 0 -3px 10px rgb(15 23 42 / 10%) !important;
}

@media (max-width: 700px) {
    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] {
        padding: var(--threeopka-ui-space-4) !important;
        border-radius: 8px;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-heading {
        font-size: 24px !important;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 16px !important;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-section {
        padding: 20px 0;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card-grid {
        gap: 10px;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card {
        min-height: 100px !important;
        padding: 12px 10px !important;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-poster-format-card .threeopka-poster-format-icon {
        width: 42px;
        height: 42px;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card .threeopka-poster-icon:not(.threeopka-poster-icon-custom):not(.threeopka-poster-icon-custom-image) {
        max-width: 42px;
        max-height: 42px;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary {
        position: static !important;
        padding: var(--threeopka-ui-space-4) !important;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary > .threeopka-ui-button {
        display: inline-flex !important;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-mobile-checkout {
        padding: 7px 8px !important;
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-mobile-checkout .threeopka-ui-button {
        min-height: 34px !important;
        height: auto !important;
        padding: 5px 7px;
        border-radius: 7px !important;
        font-size: 13px;
    }
}

@media (max-width: 420px) {
    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row {
        gap: var(--threeopka-ui-space-3) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card,
    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-control,
    .threeopka-ui.threeopka-poster-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button {
        transition: none !important;
    }
}
