/* Estilos para sistema de pedidos diretos */

/* Destaque SUPER FORTE para o botão '+ Pedir Express' - Otimizado para idosos */
.btn-pedir-express {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff6b35 100%);
    border: 4px solid #ffffff;
    color: white;
    font-weight: 800;
    font-size: 1.2rem;
    padding: 20px 40px;
    border-radius: 15px;
    box-shadow:
        0 8px 25px rgba(255, 107, 53, 0.5),
        0 0 0 3px #ff6b35,
        0 0 0 6px #ffffff,
        0 0 0 9px #ff6b35;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: superPulse 2s infinite;
    z-index: 1000;
}

.btn-pedir-express:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #e8841a 50%, #e55a2b 100%);
    color: white;
    transform: translateY(-3px) scale(1.05);
    box-shadow:
        0 12px 35px rgba(255, 107, 53, 0.7),
        0 0 0 3px #e55a2b,
        0 0 0 6px #ffffff,
        0 0 0 9px #e55a2b;
}

.btn-pedir-express:active {
    transform: translateY(0) scale(1.02);
    box-shadow:
        0 4px 15px rgba(255, 107, 53, 0.6),
        0 0 0 3px #e55a2b,
        0 0 0 6px #ffffff,
        0 0 0 9px #e55a2b;
}

.btn-pedir-express::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.8s;
}

.btn-pedir-express:hover::before {
    left: 100%;
}

.btn-pedir-express i {
    margin-right: 12px;
    font-size: 1.4rem;
    animation: superPulse 1.5s infinite;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes superPulse {
    0% {
        transform: scale(1);
        box-shadow:
            0 8px 25px rgba(255, 107, 53, 0.5),
            0 0 0 3px #ff6b35,
            0 0 0 6px #ffffff,
            0 0 0 9px #ff6b35;
    }

    50% {
        transform: scale(1.02);
        box-shadow:
            0 12px 35px rgba(255, 107, 53, 0.7),
            0 0 0 3px #ff6b35,
            0 0 0 6px #ffffff,
            0 0 0 9px #ff6b35;
    }

    100% {
        transform: scale(1);
        box-shadow:
            0 8px 25px rgba(255, 107, 53, 0.5),
            0 0 0 3px #ff6b35,
            0 0 0 6px #ffffff,
            0 0 0 9px #ff6b35;
    }
}

/* Efeito de destaque adicional */
.btn-pedir-express::after {
    content: '🌟 PEDIDO EXPRESS 🌟';
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-pedir-express:hover::after {
    opacity: 1;
}

/* Container de destaque para o botão */
.btn-pedir-express {
    position: relative;
}

.btn-pedir-express::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    right: -20px;
    bottom: -20px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.1) 0%, transparent 70%);
    border-radius: 25px;
    z-index: -1;
    animation: glowPulse 3s infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

/* Cards de produtos */
.produto-card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #dee2e6;
}

.produto-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.produto-card .card-img-top {
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #dee2e6;
}

/* Controles de quantidade */
.quantidade-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.quantidade-controls button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #dee2e6;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.quantidade-controls button:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.quantidade-controls button:active {
    transform: scale(0.95);
}

.quantidade-display {
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

/* Carrinho */
.carrinho-card {
    position: sticky;
    top: 1rem;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
}

.carrinho-item {
    border-bottom: 1px solid #f1f3f4;
    padding: 0.5rem 0;
}

.carrinho-item:last-child {
    border-bottom: none;
}

.carrinho-total {
    font-size: 1.1rem;
    font-weight: bold;
    color: #28a745;
}

/* Status badges */
.status-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* Tabelas responsivas */
.table-responsive {
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Botões de ação */
.btn-action {
    margin: 0 0.125rem;
}

/* Modal de detalhes */
.modal-detalhes .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* Formulário de pedido */
.formulario-pedido {
    background: #f8f9fa;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
}

/* Responsividade */
@media (max-width: 768px) {
    .produto-card .card-img-top {
        height: 150px;
    }

    .carrinho-card {
        position: static;
        margin-top: 1rem;
    }

    /* Controles de quantidade touch-friendly em mobile */
    .quantidade-controls {
        flex-direction: row;
        gap: 0.5rem;
        background-color: #f8f9fa;
        padding: 0.5rem;
        border-radius: 0.375rem;
        margin-top: 0.5rem;
    }

    .quantidade-controls button {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
        min-width: 40px;
        flex-shrink: 0;
    }

    .quantidade-controls input {
        width: 60px;
        height: 40px;
        font-size: 1rem;
        text-align: center;
        flex-shrink: 0;
        margin: 0 0.5rem;
    }

    /* Tabela mobile-friendly */
    .table-responsive {
        font-size: 0.9rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border: 0;
    }

    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
        vertical-align: middle;
        white-space: nowrap;
        min-width: 60px;
    }

    /* Botões de ação compactos */
    .btn-sm {
        padding: 0.25rem 0.5rem;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Modal otimizado para mobile */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }

    .modal-body {
        padding: 1rem;
    }

    /* Abas responsivas */
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Container com padding reduzido */
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Melhorias para tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    .produto-card .card-img-top {
        height: 180px;
    }

    .quantidade-controls button {
        min-width: 35px;
        height: 35px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.produto-card {
    animation: fadeIn 0.3s ease-out;
}

/* Estados de loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Melhorias para acessibilidade */
.btn:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Temas escuro/claro */
[data-theme="dark"] .produto-card {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .produto-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .carrinho-card {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .formulario-pedido {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

[data-theme="dark"] .quantidade-controls button {
    background: #23272b;
    border: 1px solid #68d391;
    color: #e2e8f0;
    transition: background 0.2s, color 0.2s;
}

[data-theme="dark"] .quantidade-controls button:hover {
    background: #68d391;
    color: #23272b;
    border-color: #68d391;
}

[data-theme="dark"] .carrinho-item {
    border-bottom-color: #4a5568;
}

[data-theme="dark"] .carrinho-total {
    color: #68d391;
}

[data-theme="dark"] .status-badge {
    color: #fff;
}

[data-theme="dark"] .quantidade-controls {
    background: transparent;
    border-radius: 0.375rem;
    margin-top: 0.5rem;
    padding: 0.25rem 0;
    box-shadow: none;
}

[data-theme="dark"] .quantidade-controls input {
    background: #181a1b;
    border: 1px solid #68d391;
    color: #e2e8f0;
    text-align: center;
}

[data-theme="dark"] .quantidade-controls input:focus {
    border-color: #4dabf7;
    background: #23272b;
    color: #fff;
}

/* Melhorias específicas para cards de produtos */
.produto-card .card-body {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1rem 0.5rem;
}

.produto-card .categoria-produto {
    text-align: center !important;
    display: flex;
    width: 100%;
    color: #6c757d;
    margin-bottom: 0.5rem;
    display: block;
}

.produto-card .card-title {
    text-align: center !important;
    width: 100%;
    display: block;
}

.produto-card .preco-produto {
    text-align: center !important;
    width: 100%;
    margin-bottom: 0.5rem;
    display: block;
}

.produto-card .quantidade-controls {
    justify-content: center !important;
    width: 100%;
}

/* Garantir que a tabela tenha borda e fundo em qualquer tela */
.table {
    border: 1px solid #dee2e6;
    background: #fff;
}

/* Mensagem centralizada para nenhum pedido */
#meusPedidosTable td[colspan] {
    text-align: center;
    color: #888;
    font-size: 1.1rem;
    padding: 2rem 0;
}

/* Melhorias na tabela */
.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Ajustes para botões de ação nos cards */
.d-flex.gap-2.mt-2 .btn {
    min-width: 90px;
}

/* Garantir que a tabela seja scrollável em mobile */
@media (max-width: 576px) {
    .table-responsive {
        border: 0;
    }

    .badge {
        font-size: 0.7rem;
        padding: 0.25em 0.5em;
    }
}

/* --- AJUSTES PARA TEMA DARK: ABAS E TABELAS --- */
[data-theme="dark"] .nav-tabs {
    border-bottom: 1px solid #444;
}

[data-theme="dark"] .nav-tabs .nav-link {
    color: #e2e8f0;
    background: transparent;
    border: 1px solid transparent;
}

[data-theme="dark"] .nav-tabs .nav-link.active {
    color: #fff;
    background: #23272b;
    border-color: #444 #444 #23272b;
    border-bottom: 2px solid #68d391;
}

[data-theme="dark"] .nav-tabs .nav-link:not(.active):hover {
    background: #2d3748;
    color: #fff;
}

[data-theme="dark"] .table {
    background-color: #23272b;
    color: #e2e8f0;
    border-color: #444;
}

[data-theme="dark"] .table th {
    background-color: #181a1b;
    color: #e2e8f0;
    border-color: #444;
}

[data-theme="dark"] .table td {
    border-color: #444;
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd) {
    background-color: #2d2d2d;
}

[data-theme="dark"] .table-striped>tbody>tr:nth-of-type(even) {
    background-color: #23272b;
}

[data-theme="dark"] .table-hover tbody tr:hover {
    background-color: #333b44;
}

/* Responsividade para o botão destacado - Mantendo destaque forte para idosos */
@media (max-width: 768px) {
    .btn-pedir-express {
        padding: 18px 30px;
        font-size: 1.1rem;
        width: 100%;
        max-width: 350px;
        margin: 0 auto;
        display: block;
        border-width: 3px;
        box-shadow:
            0 6px 20px rgba(255, 107, 53, 0.6),
            0 0 0 2px #ff6b35,
            0 0 0 4px #ffffff,
            0 0 0 6px #ff6b35;
    }

    .btn-pedir-express i {
        margin-right: 10px;
        font-size: 1.2rem;
    }

    .btn-pedir-express::after {
        font-size: 0.8rem;
        padding: 6px 12px;
        top: -35px;
    }
}

@media (max-width: 480px) {
    .btn-pedir-express {
        padding: 16px 24px;
        font-size: 1rem;
        max-width: 320px;
    }

    .btn-pedir-express i {
        font-size: 1.1rem;
        margin-right: 8px;
    }
}

/* Tema escuro para o botão destacado - Mantendo destaque forte */
[data-theme="dark"] .btn-pedir-express {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ff6b35 100%);
    border: 4px solid #ffffff;
    box-shadow:
        0 8px 25px rgba(255, 107, 53, 0.6),
        0 0 0 3px #ff6b35,
        0 0 0 6px #ffffff,
        0 0 0 9px #ff6b35;
}

[data-theme="dark"] .btn-pedir-express:hover {
    background: linear-gradient(135deg, #e55a2b 0%, #e8841a 50%, #e55a2b 100%);
    box-shadow:
        0 12px 35px rgba(255, 107, 53, 0.8),
        0 0 0 3px #e55a2b,
        0 0 0 6px #ffffff,
        0 0 0 9px #e55a2b;
}

[data-theme="dark"] .btn-pedir-express::after {
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.6);
}