/* ===============================================================
   meio-venda.css — Styles for the "Meios de venda" dialog
   Faixas de Preço child-row grid
   =============================================================== */

/* Container for the faixas grid inside the DataTable child row */
.faixas-container {
    margin-top: -10px;
    padding: 0 10px 8px 25px;
}

/* Title tab — green rectangle, like the child subtable tabs in stock */
.faixas-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.faixas-header .faixas-titulo {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    background: #158D88;
    padding: 5px 14px;
    border-radius: 6px 6px 0 0;
    display: inline-block;
}

/* "Adicionar Faixa" button — replicates b_new look without triggering framework */
.btn-add-faixa-preco {
    font-size: 11px;
    font-weight: bold;
    background: #FFDF4C;
    border-radius: 20px;
    border: 2px solid #158D88;
    color: #158D88;
    padding: 2px 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.btn-add-faixa-preco:hover {
    background: #158D88;
    color: #fff;
}

/* The faixas DataTable-like grid */
.faixas-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    border: 1px solid #ccc;
}

/* Header — solid green background with white text */
.faixas-grid thead th {
    font-weight: bold;
    font-size: 11px;
    color: #fff;
    background: #158D88;
    padding: 5px 8px;
    text-align: right;
    border: none;
}

.faixas-grid td {
    padding: 4px 8px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    text-align: right;
}

/* Icon cells keep default alignment */
.faixas-grid td.col-icon {
    text-align: center;
}

/* Alternating row colors — white and light yellow */
.faixas-grid tbody tr:nth-child(odd) {
    background-color: #fff;
}

.faixas-grid tbody tr:nth-child(even) {
    background-color: #fdf8e8;
}

.faixas-grid tbody tr:last-child td {
    border-bottom: none;
}

/* Icon cells — fixed width */
.faixas-grid .col-icon {
    width: 22px;
    padding: 4px 2px;
}

/* Input styling inside faixas */
.faixas-grid input.faixa-input {
    width: 75px;
    padding: 3px 6px;
    border: 1px solid #bbb;
    border-radius: 4px;
    font-size: 12px;
    text-align: right;
    box-sizing: border-box;
}

.faixas-grid input.faixa-input:focus {
    border-color: #158D88;
    outline: none;
    box-shadow: 0 0 0 2px rgba(21, 141, 136, 0.15);
}

/* Empty state */
.faixas-grid .faixas-empty {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 10px;
}

/* Save/Cancel icon cells in edit/add mode — size for the grid */
.faixas-grid .regra_b_edit,
.faixas-grid .regra_b_delete {
    height: 18px;
    width: 18px;
    display: inline-block;
}

/* Cancel icon for editing state — regra_b_delete was missing from precificador.css editing selectors */
div.regra_b_delete.editing {
    background-image: url("../images/cancel.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

div.regra_b_delete.editing:hover {
    background-image: url("../images/cancel-hover.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

/* ===============================================================
   Marketplace Template — Button & Wizard Dialog
   =============================================================== */

/* Flex layout for 3-button footer */
.meio-venda-buttons {
    display: flex !important;
    justify-content: center;
    align-items: stretch;
    gap: 8px;
    flex-wrap: nowrap;
}

.meio-venda-buttons .b_new,
.meio-venda-buttons .b_cancel,
.meio-venda-buttons .btn-add-marketplace {
    float: none !important;
    flex-shrink: 0;
    margin: 1.5vh 1vw;
}

/* "✨ Adicionar Marketplace" button — matches b_new sizing */
.btn-add-marketplace {
    font-size: 1vw;
    font-weight: normal;
    background: linear-gradient(135deg, #158D88, #1aaba5);
    border-radius: 5vh;
    border: 0.3vh solid #198b86;
    color: #fff;
    padding: 0.5vh 0.8vw;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s, transform 0.15s;
    box-sizing: border-box;
}

.btn-add-marketplace:hover {
    background: linear-gradient(135deg, #0e6b67, #158D88);
    transform: scale(1.03);
}

/* Wizard dialog — marketplace list */
.marketplace-list {
    list-style: none;
    padding: 0;
    margin: 6px 0;
}

.marketplace-list li {
    padding: 10px 14px;
    margin: 5px 0;
    border-radius: 8px;
    border: 1px solid #ddd;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
    font-size: 16px;
}

.marketplace-list li:hover {
    background: #e8f5f4;
    border-color: #158D88;
    box-shadow: 0 2px 8px rgba(21, 141, 136, 0.15);
}

.marketplace-list li.selected {
    background: #158D88;
    color: #fff;
    border-color: #158D88;
}

.marketplace-list li .mp-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 6px;
    flex-shrink: 0;
}

.marketplace-list li .mp-info {
    flex: 1;
    min-width: 0;
}

.marketplace-list li .mp-name {
    font-weight: bold;
    font-size: 18px;
    display: block;
}

.marketplace-list li .mp-desc {
    font-size: 11px;
    color: #888;
    display: block;
    margin-top: 1px;
}

.marketplace-list li:hover .mp-desc {
    color: #666;
}

/* "Em breve" corner tag */
.marketplace-list li.mp-soon {
    position: relative;
    overflow: hidden;
}

.mp-ribbon {
    position: absolute;
    top: 0;
    right: 0;
    background: #FFDF4C;
    color: #333;
    font-size: 9px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 3px 8px;
    border-radius: 0 7px 0 6px;
    box-shadow: -1px 1px 3px rgba(0,0,0,0.1);
    pointer-events: none;
    line-height: 1;
}

.mp-ribbon span {
    display: block;
}

/* Config section within wizard */
.marketplace-config {
    margin-top: 12px;
    box-sizing: border-box;
    width: 100%;
}

/* Override jQuery UI overflow to prevent dropdown clipping */
.mp-wizard-overflow {
    overflow: visible !important;
}

.marketplace-config label {
    display: block;
    font-weight: bold;
    font-size: 12px;
    color: #555;
    margin-bottom: 4px;
    margin-top: 10px;
}

.marketplace-config select,
.marketplace-config input[type="checkbox"] {
    font-size: 12px;
}

.marketplace-config select {
    width: 100%;
    max-width: 100%;
    padding: 6px 8px;
    border: 1px solid #bbb;
    border-radius: 4px;
    box-sizing: border-box;
    height: auto;
    line-height: 1.4;
}

/* Preview table (reuses faixas-grid look) */
.marketplace-preview-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
    margin-top: 8px;
    border: 1px solid #ccc;
}

.marketplace-preview-table thead th {
    background: #158D88;
    color: #fff;
    padding: 4px 8px;
    font-size: 10px;
    text-align: right;
}

.marketplace-preview-table tbody td {
    padding: 3px 8px;
    border-bottom: 1px solid #eee;
    text-align: right;
}

.marketplace-preview-table tbody tr:nth-child(even) {
    background: #fdf8e8;
}

