/* --- NOVO PDV (Ponto de Venda) --- */
.pdv-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    height: calc(100vh - 150px);
}

.pdv-main {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

.pdv-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    /* PERMITIR QUEBRA DE LINHA */
    padding-bottom: 5px;
    /* overflow-x: auto;  REMOVIDO */
}

.pdv-filter-btn {
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-weight: 500;
    color: #555;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pdv-filter-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.pdv-filter-btn.active {
    background: var(--blue-dark);
    color: white;
    border-color: var(--blue-dark);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.pdv-search-bar {
    position: relative;
    width: 100%;
}

.pdv-search-bar input {
    width: 100%;
    padding: 15px 15px 15px 45px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 1.1em;
    outline: none;
    transition: border 0.3s;
}

.pdv-search-bar input:focus {
    border-color: var(--blue-highlight);
}

.pdv-search-bar i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    font-size: 1.2em;
}

.pdv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    overflow-y: auto;
    padding: 5px;
    align-content: start;
}

.pdv-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 160px;
}

.pdv-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: var(--blue-highlight);
}

.pdv-card:active {
    transform: scale(0.98);
}

.pdv-card-title {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
    line-height: 1.3;
    margin-bottom: 5px;
}

.pdv-card-tag {
    font-size: 0.75em;
    background: #f8f9fa;
    color: #666;
    padding: 3px 8px;
    border-radius: 4px;
    align-self: flex-start;
    margin-bottom: 10px;
}

.pdv-card-price {
    font-size: 1.2em;
    font-weight: 800;
    color: var(--green);
    margin-top: auto;
}

/* Sidebar Carrinho */
.pdv-sidebar {
    background: white;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pdv-cart-header {
    background: var(--blue-dark);
    color: white;
    padding: 15px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pdv-cart-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(10px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 0.9em;
    display: block;
}

.cart-item-price {
    color: #666;
    font-size: 0.85em;
}

.cart-item-remove {
    color: #ff6b6b;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
}

.pdv-cart-footer {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.btn-checkout {
    width: 100%;
    padding: 15px;
    background: #27ae60;
    /* var(--green) estava falhando */
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-checkout:hover {
    background: #219150;
    transform: translateY(-1px);
}

/* --- RESPONSIVIDADE (MOBILE FIX) --- */
@media (max-width: 900px) {
    .pdv-container {
        display: flex;
        flex-direction: column;
        height: auto !important;
        /* Remove altura fixa de tela cheia */
        padding-bottom: 80px;
        /* Espaço para scroll final */
    }

    .pdv-main {
        width: 100%;
        order: 1;
        overflow: visible;
    }

    .pdv-search-bar input {
        padding: 10px 10px 10px 40px;
        /* Menor padding */
    }

    .pdv-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        /* Cards menores */
        max-height: 50vh;
        /* Limita altura dos produtos para o carrinho ficar acessível */
        overflow-y: auto;
        border-bottom: 2px solid #eee;
        padding-bottom: 10px;
    }

    .pdv-sidebar {
        width: 100%;
        order: 2;
        margin-top: 10px;
        border-radius: 10px 10px 0 0;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
        /* Sombra para separar */
    }

    .pdv-cart-body {
        max-height: 300px;
    }
}