/*
 * 3opka.it UI Kit — Phase 2 Adesivi
 * Visual bridge only. Product preview and calculation logic stay plugin-owned.
 */

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] {
    --threeopka-ui-brand: var(--threeopka-brand, #21aee8);
    --threeopka-ui-brand-hover: #168fbd;
    --threeopka-ui-text: #172026;
    --threeopka-ui-muted: #5f6b76;
    --threeopka-ui-border: #dbe8ec;
    --threeopka-ui-surface: #ffffff;
    box-sizing: border-box;
    width: 100%;
    padding: 24px;
    border: 1px solid var(--threeopka-ui-border);
    border-radius: 8px;
    background: var(--threeopka-ui-surface);
    color: var(--threeopka-ui-text);
    box-shadow: none;
    font-size: 14px;
    line-height: 1.5;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] *,
.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] *::before,
.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] *::after {
    box-sizing: border-box;
}

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

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

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-form {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-section {
    min-width: 0;
    padding-top: 18px;
    border-top: 1px solid #edf2f4;
}

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

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-section-description {
    margin: -4px auto 14px;
    color: var(--threeopka-ui-muted);
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-field > span {
    display: block;
    margin-bottom: 6px;
    color: var(--threeopka-ui-text);
    font-size: 13px;
    font-weight: 700;
}

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-control:hover,
.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] select:hover {
    border-color: #9aa9af !important;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-control:focus-visible,
.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] select:focus-visible {
    border-color: var(--threeopka-ui-brand) !important;
    outline: 3px solid rgb(33 174 232 / 22%);
    outline-offset: 1px;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px !important;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-section-design .threeopka-ui-card-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.threeopka-ui.threeopka-adesivi-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: #fff !important;
    color: var(--threeopka-ui-text) !important;
    box-shadow: none !important;
    transform: none !important;
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease !important;
}

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

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

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card > span > strong {
    color: var(--threeopka-ui-text);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.25;
}

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card .threeopka-adesivi-icon:not(.threeopka-adesivi-icon-custom):not(.threeopka-adesivi-icon-custom-image) {
    display: block;
    width: 50px;
    height: 50px;
    max-width: 50px;
    max-height: 50px;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-delivery-text {
    color: var(--threeopka-ui-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-delivery-date {
    color: var(--threeopka-ui-text) !important;
    font-size: 22px !important;
    font-weight: 800 !important;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary {
    position: sticky;
    top: 16px;
    display: grid;
    gap: 0;
    width: 100%;
    max-width: none;
    padding: 20px;
    border: 1px solid var(--threeopka-ui-border);
    border-radius: 10px;
    background: #fff;
    box-shadow: none;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__title {
    margin: 0 0 12px;
    color: var(--threeopka-ui-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    text-align: left;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    min-height: 0;
    padding: 12px 0;
    border: 0;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__label {
    color: var(--threeopka-ui-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__value {
    color: var(--threeopka-ui-text);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-align: right;
    white-space: nowrap;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-net {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--threeopka-ui-border);
}

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-tax .threeopka-ui-summary__label,
.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__row.is-tax .threeopka-ui-summary__value {
    font-size: 13px;
    font-weight: 400;
}

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary__total strong {
    color: var(--threeopka-ui-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 59px !important;
    padding: 14px 18px !important;
    border: 1px solid transparent;
    border-radius: 6px !important;
    font: inherit;
    font-size: 15px !important;
    font-weight: 600 !important;
    line-height: 1.2;
    text-transform: none;
    cursor: pointer;
}

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

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

.threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-button:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgb(33 174 232 / 28%) !important;
}

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

.threeopka-ui.threeopka-adesivi-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-adesivi-calculator[data-threeopka-ui-version="1"] {
        padding: 16px;
    }

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

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

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-measures-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-section-design .threeopka-ui-card-grid,
    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-summary {
        position: static;
        width: 100%;
        padding: 16px;
    }

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

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-mobile-checkout {
        grid-template-columns: minmax(0, .86fr) minmax(0, .94fr) minmax(88px, .98fr);
        gap: 6px;
        padding: 7px 8px !important;
    }

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-mobile-checkout-unit {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 5px;
        min-width: 0;
        padding-bottom: 4px;
        border-bottom: 1px solid rgb(205 220 226 / 72%);
        color: #3f4d55;
        font-size: 12px;
        line-height: 1.1;
        white-space: nowrap;
    }

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-mobile-checkout-unit small {
        color: var(--threeopka-ui-muted);
        font-size: 12px;
        font-weight: 600;
    }

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-adesivi-mobile-checkout-unit strong {
        color: var(--threeopka-ui-text);
        font-size: 12px;
        font-weight: 700;
    }

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

    .threeopka-ui.threeopka-adesivi-calculator[data-threeopka-ui-version="1"] .threeopka-ui-mobile-checkout .threeopka-ui-button::after {
        content: "Aggiungi";
        font-size: 14px;
    }
}

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