.sale-panel {
    border-color: var(--mud-palette-lines-default);
    border-radius: 14px;
    background-color: var(--mud-palette-surface);
}

.sale-panel-title {
    font-weight: 600;
    letter-spacing: 0.1px;
}

.sale-summary-card {
    border-color: var(--mud-palette-lines-default);
    border-radius: 14px;
    background-color: var(--mud-palette-surface);
    height: 100%;
}

.sale-summary-card__icon {
    width: 2.4rem;
    height: 2.4rem;
    padding: 0.5rem;
    border-radius: 999px;
    background-color: var(--mud-palette-background-gray);
}

.sale-summary-card__value {
    font-weight: 700;
    line-height: 1.2;
}

.sale-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.6rem;
    max-height: 46vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.sale-product-card {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 12px;
    background-color: var(--mud-palette-surface);
    color: var(--mud-palette-text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sale-product-card:hover:not(:disabled),
.sale-product-card:focus-visible {
    border-color: var(--mud-palette-primary);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.sale-product-card:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sale-product-card--selected {
    border-color: var(--mud-palette-primary);
    background-color: var(--mud-palette-primary-hover);
}

.sale-product-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
}

.sale-product-card__code {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--mud-palette-text-secondary);
    text-transform: uppercase;
}

.sale-product-card__badge {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.35rem;
    text-align: center;
}

.sale-product-card__name {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.88rem;
    font-weight: 500;
    line-height: 1.25;
    min-height: 2.2rem;
}

.sale-product-card__bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sale-product-card__price {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.sale-product-card__stock,
.sale-stock-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background-color: var(--mud-palette-background-gray);
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.sale-product-card__stock--low,
.sale-stock-badge--low {
    background-color: var(--mud-palette-warning-hover);
    color: var(--mud-palette-warning-darken);
}

.sale-product-card__stock--empty,
.sale-stock-badge--empty {
    background-color: var(--mud-palette-error-hover);
    color: var(--mud-palette-error-darken);
}

.sale-cart-empty {
    padding: 1.5rem 0.5rem;
}

.sale-cart-items {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    max-height: 34vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.sale-cart-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 10px;
    background-color: var(--mud-palette-background-gray);
}

.sale-cart-item__info {
    min-width: 8rem;
    flex: 1 1 8rem;
}

.sale-cart-item__name {
    font-weight: 500;
}

.sale-cart-item__actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.sale-cart-item__quantity {
    min-width: 1.75rem;
    font-weight: 700;
    text-align: center;
}

.sale-cart-item__total {
    min-width: 5.5rem;
    font-weight: 600;
    text-align: right;
}

.sale-stock-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 26rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.sale-stock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    border: 1px solid var(--mud-palette-lines-default);
}

.sale-stock-item__info {
    min-width: 0;
}

.sale-stock-item__name {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sale-stock-item__values {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}

.sale-stock-item__price {
    font-weight: 600;
}

.sale-dialog-total {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-right: auto;
}

.sale-dialog-total__value {
    font-weight: 700;
    color: var(--mud-palette-primary);
}

.sale-dialog-actions {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media (max-width: 599.98px) {
    .sale-product-grid {
        grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
        max-height: 40vh;
    }

    .sale-cart-item__total {
        min-width: 4.5rem;
    }

    .sale-dialog-actions {
        justify-content: stretch;
    }

    .sale-dialog-total {
        width: 100%;
        justify-content: space-between;
        margin-right: 0;
    }

    .sale-dialog-actions .mud-button-root {
        flex: 1 1 auto;
    }
}
