/* =========================================================
   LARGURA E SUBIDA DO LAYOUT (96% DA TELA + MAIS PRA CIMA)
   ========================================================= */
.cart-container {
    max-width: 96%;
    margin: 5px auto 20px auto;
    padding: 0 10px;
}

.cart-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #111;
    margin-bottom: 15px;
    text-align: center;
}

/* =========================================================
   ESTILOS DOS BOTÕES VOLTAR E AÇÕES
   ========================================================= */
.btn-voltar-arrow { 
    font-size: 0.8rem; 
    font-weight: 700; 
    color: #555; 
    background: #faf9f7; 
    padding: 6px 14px;
    border-radius: 20px; 
    border: 1px solid #ddd; 
    cursor: pointer; 
    transition: 0.2s; 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    font-family: 'Montserrat', sans-serif; 
    text-transform: uppercase; 
    margin-bottom: 10px;
}
.btn-voltar-arrow:hover { 
    background: #111; 
    color: #fff; 
    border-color: #111; 
}

.btn-outline-modern { 
    background: transparent; 
    color: #000; 
    border: 1.5px solid #000; 
    padding: 15px; 
    border-radius: 6px; 
    font-family: 'Montserrat', sans-serif; 
    font-weight: 600; 
    font-size: 0.85rem; 
    cursor: pointer; 
    transition: 0.2s; 
    text-transform: uppercase; 
    text-align: center;
    width: 100%;
}
.btn-outline-modern:hover { 
    background: #faf9f7; 
    color: #b78a6c; 
    border-color: #b78a6c; 
}

/* =========================================================
   BARRA DE CONTROLE DOS PEDIDOS E SELECTS
   ========================================================= */
.pedido-selector-bar {
    background-color: #fff;
    border: 1px solid #eec;
    padding: 10px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    flex-wrap: wrap;
    gap: 15px;
}

.pedido-selector-bar .selector-field {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pedido-selector-bar label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #b78a6c;
    text-transform: uppercase;
}

.modern-select-pedido {
    padding: 8px 12px;
    border: 2px solid #b78a6c;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    background-color: #fff;
    color: #111;
    outline: none;
    min-width: 250px;
    cursor: pointer;
}

.btn-danger-outline {
    background: transparent;
    color: #e53e3e;
    border: 1px solid #e53e3e;
    padding: 8px 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-danger-outline:hover {
    background-color: #e53e3e;
    color: #fff;
}

/* =========================================================
   LAYOUT DE TABELA E RESUMO
   ========================================================= */
.cart-layout {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.cart-items-section {
    flex: 1 1 65%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    overflow: hidden;
}

.cart-table-wrapper {
    overflow-x: auto;
}

.cart-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.cart-table th {
    background: #faf9f7;
    padding: 12px 15px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #666;
    border-bottom: 1px solid #eee;
}

.cart-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    color: #444;
    vertical-align: middle;
}

/* =========================================================
   FOTO DO PRODUTO NO PEDIDO E DETALHES
   ========================================================= */
.cart-product-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-product-img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    background-color: #faf9f7;
    flex-shrink: 0;
}

.cart-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-product-info strong {
    font-size: 0.95rem;
    color: #111;
    line-height: 1.2;
}

/* Botão Ver Detalhes no Histórico */
.btn-ver-detalhes {
    background: #f1f5f9;
    color: #334155;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
    margin-top: 8px;
    display: inline-block;
}
.btn-ver-detalhes:hover {
    background: #e2e8f0;
    color: #0f172a;
}
.detalhes-row {
    background-color: #fafaf9;
    border-bottom: 2px solid #e2d8ce;
}
.detalhes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
    padding: 15px;
}
.detalhe-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
}

/* =========================================================
   RESUMO LATERAL & SWITCH NOTA FISCAL
   ========================================================= */
.cart-summary-section {
    flex: 1 1 35%;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border: 1px solid #eee;
    padding: 25px;
}

.summary-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #111;
    border-bottom: 1px solid #eee;
    padding-bottom: 12px;
}

.summary-totals {
    margin-bottom: 25px;
}
.summary-line {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #555;
}
.summary-line.total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111;
    border-top: 1px solid #eee;
    padding-top: 15px;
    margin-top: 15px;
}

/* Switch Estilo */
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-switch .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .4s; border-radius: 22px; }
.toggle-switch .slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%; }
.toggle-switch input:checked + .slider { background-color: #b78a6c; }
.toggle-switch input:checked + .slider:before { transform: translateX(20px); }

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-black-solid {
    background: #000;
    color: #fff;
    border: none;
    padding: 16px;
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
    width: 100%;
}
.btn-black-solid:hover { background: #333; }

.cart-empty-message {
    padding: 50px 20px;
    text-align: center;
    color: #777;
    font-size: 0.95rem;
}

/* --- ABAS DOS PEDIDOS --- */
.tabs-pedidos {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.tab-btn-cart {
    padding: 10px 22px;
    background: transparent;
    border: 2px solid #ddd;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn-cart:hover {
    border-color: #b78a6c;
    color: #b78a6c;
    background-color: #fffaf6;
}

.tab-btn-cart.active {
    background: #b78a6c;
    color: #fff;
    border-color: #b78a6c;
    box-shadow: 0 4px 10px rgba(183, 138, 108, 0.3);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .cart-layout { flex-direction: column; }
    .cart-items-section, .cart-summary-section { flex: 1 1 100%; width: 100%; }
    .pedido-selector-bar { flex-direction: column; align-items: flex-start; }
    .pedido-selector-bar .selector-field { flex-direction: column; align-items: flex-start; width: 100%; }
    .modern-select-pedido { width: 100%; }
    .btn-danger-outline { width: 100%; text-align: center; }
}