/* Reset e Estilos Globais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f9f9f9;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Header */
header {
    background-color: #2c3e50;
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.8rem;
}

.carrinho-icon a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
}

.carrinho-icon i {
    margin-right: 8px;
}

.carrinho-icon span {
    background-color: #e74c3c;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb span {
    color: #7f8c8d;
}

/* Catálogos Grid */
.catalogos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.catalogo-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.catalogo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.catalogo-card h3 {
    margin-bottom: 15px;
    color: #2c3e50;
}

.catalogo-icon {
    font-size: 2.5rem;
    color: #3498db;
}

/* Barra de Pesquisa */
.search-box {
    display: flex;
    margin-bottom: 20px;
}

.search-box input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
}

.search-box button {
    padding: 0 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
}

.search-box button:hover {
    background-color: #2980b9;
}

/* Lista de Produtos */
.produtos-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.produto-card {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.produto-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: #2c3e50;
}

.produto-info .codigo {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin-bottom: 5px;
}

.produto-info .valor {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
}

.produto-info .desconto {
    background-color: #e74c3c;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-left: 8px;
}

.produto-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 10px;
    gap: 10px;
}

.produto-actions .quantidade {
    width: 60px;
    padding: 8px;
    margin-right: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.produto-actions .add-to-cart {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.produto-actions .add-to-cart i {
    margin-right: 5px;
}

.produto-actions .add-to-cart:hover {
    background-color: #2980b9;
}

/* Carrinho */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
    font-weight: bold;
}

tfoot td {
    font-weight: bold;
    background-color: #f2f2f2;
}

.quantidade-input {
    width: 60px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.btn-remove {
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-remove:hover {
    background-color: #c0392b;
}

.carrinho-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Botões */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #ecf0f1;
    color: #2c3e50;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    background-color: #bdc3c7;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

/* Finalizar Pedido */
.pedido-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.cliente-info {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* Resumo do Pedido */
.pedido-resumo {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.pedido-numero {
    font-size: 1.2rem;
    color: #27ae60;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.resumo-box {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
}

.resumo-cliente p {
    margin-bottom: 10px;
}

.resumo-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

@media (max-width: 480px) {
    .resumo-actions {
        display: flex;
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap; /* permite quebra de linha */
    }
}

/* Feedback ao adicionar no carrinho */
.feedback-carrinho {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #27ae60;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    animation: slideIn 0.5s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsividade */
@media (max-width: 768px) {
    .pedido-layout {
        grid-template-columns: 1fr;
    }
    
    .resumo-box {
        grid-template-columns: 1fr;
    }
    
    .catalogos-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    /* Melhorias para tabelas em tablets */
    table {
        font-size: 0.9rem;
    }
    
    th, td {
        padding: 10px 8px;
    }
    
    .carrinho-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .carrinho-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Ajustes para formulários */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Evita zoom em iOS */
    }
}

@media (max-width: 480px) {
    .catalogos-grid {
        grid-template-columns: 1fr;
    }
    
    .produto-card {
        flex-direction: column;
        text-align: center;
    }
    
    .produto-actions {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
    
    /* Tabelas responsivas para celulares */
    table {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }
    
    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr {
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    
    td {
        position: relative;
        padding-left: 50%;
        text-align: right;
        border-bottom: 1px solid #eee;
    }
    
    td:before {
        position: absolute;
        top: 12px;
        left: 12px;
        width: 45%;
        padding-right: 10px;
        white-space: nowrap;
        text-align: left;
        font-weight: bold;
        content: attr(data-label);
    }
    
    /* Ajustes para o carrinho */
    .quantidade-input {
        width: 100%;
        max-width: 80px;
        margin-left: auto;
    }
    
    .btn-remove {
        margin-left: auto;
        display: block;
    }
    
    /* Ajustes para botões */
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    /* Ajustes para cabeçalho */
    header h1 {
        font-size: 1.4rem;
    }
    
    /* Ajustes para formulários */
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 12px 10px;
    }
    
    /* Ajustes para o total do carrinho */
     tfoot tr {
        display: flex;
        flex-direction: column;
        border-top: 2px solid #eee;
        margin-top: 10px;
    }
    
    tfoot td.mobile-optimize {
        display: flex !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding: 10px 15px !important;
        box-sizing: border-box !important;
        border-bottom: 1px solid #f0f0f0;
    }
    
    tfoot td.mobile-optimize::before {
        content: attr(data-mobile-label) ":" !important;
        font-weight: normal !important;
        color: #555;
    }
    
    tfoot td:first-child {
        display: none !important; /* Oculta o "TOTAL" original */
    }
    
    /* Ajuste para garantir que a tabela não quebre */
    table {
        width: 100% !important;
        display: table !important;
    }
    
    /* Melhora a legibilidade dos valores */
    tfoot td.mobile-optimize strong {
        font-weight: bold;
        color: #2c3e50;
    }

}

/* Resumo Financeiro */
.resumo-financeiro {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.resumo-financeiro h3 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.resumo-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.resumo-item.destaque {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.2rem;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Ajustes para mobile */
@media (max-width: 768px) {
    .resumo-financeiro {
        padding: 15px;
    }
    
    .resumo-item {
        font-size: 1rem;
    }
    
    .resumo-item.destaque {
        font-size: 1.1rem;
    }
}
/* Estilos para os novos elementos */
.valor-original {
    text-decoration: line-through;
    color: #999;
    margin-right: 5px;
}

.valor-desconto {
    color: #e74c3c;
    font-weight: bold;
}

.kit-tag {
    background-color: #f39c12;
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    display: inline-block;
    margin-top: 5px;
}

.produto-card {
    position: relative;
}

/* Se for um KIT, adicionamos uma borda especial */
.produto-card[data-kit="sim"] {
    border: 2px solid #f39c12;
}

/* Estilos adicionais para informações de kit */
.kit-info {
    font-size: 0.8em;
    color: #666;
    margin: 2px 0;
}

.valor-desconto {
    color: #e74c3c;
    font-weight: bold;
}

.valor-original {
    text-decoration: line-through;
    color: #999;
    margin-right: 5px;
}

.kit-tag {
    background-color: #f39c12;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8em;
    display: inline-block;
    margin-top: 3px;
}

.produto-card[data-kit="sim"] {
    border-left: 3px solid #f39c12;
}

/* Estilos para paginação */
.paginacao {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.paginacao-controles {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-pagina {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-pagina:hover {
    background-color: #2980b9;
}

.pagina-info {
    padding: 8px 15px;
    background-color: #f2f2f2;
    border-radius: 4px;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .paginacao-controles {
        gap: 5px;
    }
    
    .btn-pagina {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .pagina-info {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

.mobile-br {
  display: none;
}

@media (max-width: 480px) {
  .mobile-br {
    display: inline;
  }
}

/* Rodapé */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    width: 100%;
}

footer a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: #2980b9;
    text-decoration: underline;
}

/* Layout que fixa o rodapé na base */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

@media (max-width: 768px) {
    footer {
        padding: 15px 10px;
        font-size: 0.8rem;
    }
}

/* Estilos para o tooltip */
.catalogo-card {
    position: relative;
}

.catalogo-card[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #3498DB;
    color: white;
    padding: 10px;
    border-radius: 5px;
    white-space: pre;
    text-align: center;
    font-size: 0.9rem;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
    pointer-events: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.catalogo-card[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    margin-bottom: 10px;
}

/* Ajuste para o ícone de catálogo externo */
.catalogo-externo {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: #f39c12;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.catalogo-card {
    position: relative;
}


.produto-imagem {
    width: 100%;
    height: 180px;
    margin-bottom: 10px;
    background-color: #fff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.produto-imagem img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.produto-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Ajuste para telas menores */
@media (max-width: 768px) {
    .produto-card {
        flex-direction: column;
        text-align: center;
    }
    
    .produto-imagem {
        width: 120px;
        height: 120px;
        margin-right: 0;
        margin-bottom: 15px;
    }
}

.produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 30px;
}