.egzba-block {
    --egzba-accent: var(--wp--preset--color--primary, var(--ast-global-color-0, var(--e-global-color-accent, #2563eb)));
    --egzba-border: rgba(15, 23, 42, 0.12);
    --egzba-surface: #ffffff;
    --egzba-muted: rgba(15, 23, 42, 0.62);
    margin-top: 12px;
    padding: 12px;
    border: 1px solid var(--egzba-border);
    border-radius: 12px;
    background: var(--egzba-surface);
    box-shadow: 0 6px 18px rgba(2, 6, 23, 0.06);
    color: inherit;
    font-size: 14px;
    box-sizing: border-box;
}

.egzba-title {
    margin: 0 0 10px;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: inherit;
}

.egzba-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    overflow-x: hidden;
}

.egzba-item {
    display: grid;
    grid-template-columns: 44px 1fr auto;
    grid-template-areas:
        "thumb name unit"
        "thumb controls controls";
    column-gap: 8px;
    row-gap: 6px;
    align-items: center;
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: rgba(248, 250, 252, 0.65);
    min-width: 0;
}

.egzba-thumb {
    grid-area: thumb;
    display: block;
    width: 44px;
    height: 44px;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    background: #ffffff;
}

.egzba-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.egzba-link {
    grid-area: name;
    color: inherit;
    text-decoration: none;
    line-height: 1.35;
    font-size: 13px;
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.egzba-link:hover,
.egzba-link:focus {
    color: var(--egzba-accent);
    text-decoration: underline;
}

.egzba-unit-price {
    grid-area: unit;
    justify-self: end;
    font-size: 12px;
    font-weight: 600;
    color: var(--egzba-muted);
    white-space: nowrap;
}

.egzba-controls {
    grid-area: controls;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
}

.egzba-qty-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 12px;
    line-height: 1.25;
    color: var(--egzba-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.egzba-qty-label {
    font-weight: 600;
    display: inline-block;
    min-width: 30px;
}

.egzba-stepper {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.egzba-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 7px;
    background: #ffffff;
    color: inherit;
    font-size: 16px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.egzba-qty-btn:hover,
.egzba-qty-btn:focus {
    border-color: var(--egzba-accent);
    color: var(--egzba-accent);
}

.egzba-qty-input {
    width: 52px;
    min-height: 28px;
    padding: 2px 6px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 8px;
    background: #ffffff;
    text-align: center;
}

.egzba-line-price {
    font-weight: 700;
    color: inherit;
    white-space: nowrap;
    font-size: 13px;
    margin-left: auto;
    text-align: right;
}

.egzba-totals {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed rgba(15, 23, 42, 0.2);
}

.egzba-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 4px;
    font-size: 13px;
    line-height: 1.3;
}

.egzba-total-row.is-discount {
    color: var(--egzba-accent);
}

.egzba-total-row.is-final {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 700;
}

.egzba-add-all-button.button.alt {
    width: 100%;
    margin-top: 8px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid var(--egzba-accent);
    border-radius: 9px;
    background: var(--egzba-accent);
    color: #ffffff;
    font-weight: 600;
    font-size: 13px;
    line-height: 1.25;
    white-space: normal;
}

.egzba-add-all-button.button.alt:hover,
.egzba-add-all-button.button.alt:focus {
    filter: brightness(0.95);
    color: #ffffff;
}

.egzba-add-all-button.is-loading {
    opacity: 0.8;
    cursor: progress;
}

.egzba-feedback {
    display: none;
    margin: 8px 0 0;
    font-size: 12px;
}

.egzba-feedback.is-visible {
    display: block;
}

.egzba-feedback.is-error {
    color: #b42318;
}

.egzba-feedback.is-success {
    color: #0f766e;
}

.egzba-block.egzba-in-sidebar {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
}

.egzba-block.egzba-in-sidebar * {
    box-sizing: border-box;
    min-width: 0;
}

.egzba-block.egzba-in-sidebar .egzba-title {
    font-size: 13px;
    margin-bottom: 8px;
}

.egzba-block.egzba-in-sidebar .egzba-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: none;
    overflow: visible;
}

.egzba-block.egzba-in-sidebar .egzba-item {
    grid-template-columns: 34px 1fr;
    grid-template-areas:
        "thumb name"
        "thumb controls";
    padding: 6px;
    border-radius: 8px;
    row-gap: 4px;
}

.egzba-block.egzba-in-sidebar .egzba-thumb {
    width: 34px;
    height: 34px;
    border-radius: 6px;
}

.egzba-block.egzba-in-sidebar .egzba-link {
    font-size: 12px;
    line-height: 1.3;
}

.egzba-block.egzba-in-sidebar .egzba-unit-price {
    display: none;
}

.egzba-block.egzba-in-sidebar .egzba-controls {
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
}

.egzba-block.egzba-in-sidebar .egzba-qty-wrap {
    width: auto;
    gap: 4px;
}

.egzba-block.egzba-in-sidebar .egzba-qty-label {
    min-width: 26px;
    font-size: 11px;
}

.egzba-block.egzba-in-sidebar .egzba-stepper {
    gap: 2px;
}

.egzba-block.egzba-in-sidebar .egzba-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 14px;
}

.egzba-block.egzba-in-sidebar .egzba-qty-input {
    width: 40px;
    min-height: 24px;
    border-radius: 6px;
    padding: 1px 4px;
    font-size: 12px;
}

.egzba-block.egzba-in-sidebar .egzba-line-price {
    font-size: 12px;
}

.egzba-block.egzba-in-sidebar .egzba-totals {
    margin-top: 8px;
    padding-top: 6px;
}

.egzba-block.egzba-in-sidebar .egzba-total-row {
    font-size: 12px;
}

.egzba-block.egzba-in-sidebar .egzba-add-all-button.button.alt {
    min-height: 34px;
    font-size: 12px;
    padding: 7px 8px;
}

@media (max-width: 640px) {
    .egzba-item {
        grid-template-columns: 38px 1fr;
        grid-template-areas:
            "thumb name"
            "thumb unit"
            "controls controls";
    }

    .egzba-unit-price {
        justify-self: start;
    }

    .egzba-controls {
        flex-wrap: wrap;
    }
}
