/* Módulo de comandas e integração de pizzas no PDV */
.comanda-summary-grid,
.comanda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.comanda-summary-grid {
    margin-bottom: 22px;
}

.comanda-section {
    margin-bottom: 26px;
}

.comanda-card {
    padding: 18px;
    border: 1px solid #dfe4ea;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(24, 35, 52, 0.06);
}

.comanda-card.selected {
    border-color: #e4572e;
    box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.12);
}

.comanda-card header,
.comanda-card header > div,
.comanda-values,
.comanda-actions,
.selected-comanda-banner,
.comanda-header-panel,
.pos-add-bar {
    display: flex;
    align-items: center;
}

.comanda-card header,
.comanda-values,
.comanda-actions,
.selected-comanda-banner,
.comanda-header-panel {
    justify-content: space-between;
}

.comanda-card header > div {
    gap: 12px;
}

.comanda-card h3,
.comanda-card p,
.comanda-card small,
.comanda-card b {
    margin: 0;
}

.comanda-card h3 {
    font-size: 1rem;
}

.comanda-card small {
    color: #687382;
}

.comanda-number {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 15px;
    color: #fff;
    background: #1d3557;
    font-size: 1.15rem;
    font-weight: 900;
}

.comanda-customer {
    margin: 17px 0;
    display: grid;
    gap: 3px;
}

.comanda-customer > span,
.comanda-values span,
.comanda-total-large small,
.selected-comanda-banner span {
    color: #6d7784;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.comanda-values {
    gap: 12px;
    padding: 13px;
    border-radius: 12px;
    background: #f5f7fa;
}

.comanda-values > div {
    display: grid;
    gap: 3px;
}

.comanda-values > div:last-child {
    text-align: right;
}

.comanda-note {
    margin-top: 13px !important;
    color: #5d6875;
    font-size: 0.8rem;
}

.comanda-actions {
    margin-top: 16px;
    gap: 8px;
}

.comanda-actions form {
    margin: 0;
}

.comanda-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    align-items: start;
    gap: 22px;
}

.comanda-header-panel {
    gap: 20px;
}

.comanda-header-panel h2 {
    margin: 10px 0 4px;
}

.comanda-total-large {
    display: grid;
    gap: 4px;
    text-align: right;
}

.comanda-total-large strong {
    font-size: 1.65rem;
}

.comanda-order {
    padding: 16px 18px;
    border-top: 1px solid #e7ebef;
}

.comanda-order:first-of-type {
    border-top: 0;
}

.comanda-order.canceled {
    opacity: 0.58;
}

.comanda-order header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
}

.comanda-order header div,
.comanda-order li {
    display: grid;
    gap: 3px;
}

.comanda-order ul {
    margin: 12px 0 0;
    padding-left: 19px;
}

.comanda-order li {
    margin: 8px 0;
}

.comanda-order small,
.comanda-order em {
    color: #6d7784;
    font-size: 0.75rem;
}

.danger-panel {
    border-color: #f1c2c6 !important;
}

.selected-comanda-banner {
    margin-bottom: 20px;
    padding: 15px 18px;
    gap: 18px;
    border: 1px solid rgba(228, 87, 46, 0.32);
    border-radius: 15px;
    background: rgba(228, 87, 46, 0.07);
}

.selected-comanda-banner.neutral {
    border-color: #d9e0e7;
    background: #f5f7fa;
}

.selected-comanda-banner.compact {
    padding: 11px 15px;
}

.selected-comanda-banner > div:first-child {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.selected-comanda-banner strong {
    font-size: 1.05rem;
}

.selected-comanda-banner small {
    color: #66717f;
}

.selected-comanda-banner form {
    margin: 0;
}

.pos-checkout-line > span {
    display: grid;
    gap: 3px;
}

.pos-checkout-line small,
.pos-lines small,
.pos-lines em,
.pizza-order-summary {
    color: #697482;
    font-size: 0.74rem;
}

/* Montador de pizza dentro do PDV */
.admin-product-config {
    margin-top: 22px;
}

.pizza-builder {
    margin-bottom: 20px;
    padding: 18px;
    border: 1px solid #e0e5ea;
    border-radius: 16px;
    background: #f8fafc;
}

.pizza-builder-heading {
    margin: 5px 0 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pizza-builder-heading > div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.pizza-builder-heading h2 {
    margin: 0;
    font-size: 1rem;
}

.pizza-builder-heading small {
    color: #697482;
}

.pizza-step {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #e4572e;
    font-weight: 900;
}

.pizza-size-grid,
.pizza-flavor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
    gap: 10px;
}

.pizza-size-choice,
.pizza-flavor-choice {
    min-height: 72px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dce2e8;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
}

.pizza-size-choice:has(input:checked),
.pizza-flavor-choice:has(input:checked) {
    border-color: #e4572e;
    box-shadow: 0 0 0 3px rgba(228, 87, 46, 0.1);
}

.pizza-size-choice input,
.pizza-flavor-choice input {
    width: 18px;
    height: 18px;
    accent-color: #e4572e;
}

.pizza-size-choice span,
.pizza-flavor-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.pizza-size-choice small,
.pizza-flavor-copy small {
    color: #6a7582;
    font-size: 0.72rem;
}

.pizza-flavor-choice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.pizza-flavor-choice > b {
    color: #55606d;
    font-size: 0.72rem;
    text-align: right;
}

.pizza-flavor-choice.is-unavailable {
    opacity: 0.48;
    cursor: not-allowed;
}

.pizza-flavor-feedback {
    min-height: 20px;
    margin-bottom: 8px;
    color: #257045;
    font-size: 0.76rem;
}

.pizza-flavor-feedback.error {
    color: #aa2531;
}

.pizza-price-preview {
    margin-top: 14px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 12px;
    color: #fff;
    background: #1d3557;
}

.pizza-price-preview span {
    display: grid;
    gap: 2px;
}

.pizza-price-preview small,
.pizza-price-preview em {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.7rem;
}

.pizza-price-preview strong {
    font-size: 1.25rem;
}

.pos-add-bar {
    margin-top: 18px;
    justify-content: flex-end;
    gap: 12px;
}

.pos-add-bar .field-row {
    width: 110px;
}

.pos-add-bar input {
    width: 100%;
}

.kitchen-comanda-link {
    width: fit-content;
    margin: 8px 0;
    padding: 5px 8px;
    border-radius: 8px;
    color: #1d3557;
    background: #edf2f8;
    font-size: 0.76rem;
    font-weight: 800;
}

button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 980px) {
    .comanda-detail-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .selected-comanda-banner,
    .comanda-header-panel,
    .comanda-actions,
    .pos-add-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .selected-comanda-banner .inline-actions,
    .comanda-actions > *,
    .comanda-actions form,
    .comanda-actions button,
    .comanda-actions a {
        width: 100%;
    }

    .comanda-total-large {
        text-align: left;
    }

    .pizza-builder {
        padding: 13px;
    }

    .pizza-builder-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .pizza-size-grid,
    .pizza-flavor-grid {
        grid-template-columns: 1fr;
    }

    .pos-add-bar .field-row {
        width: 100%;
    }
}
