/* ============================================
   PAINEL DO CLIENTE - ESTILOS UNIFICADOS
   Compartilhado entre: meus-pedidos.php, minha-conta.php
   ============================================ */

/* --- Estilos Comuns --- */

body {
    background-color: #f5f5f5;
    color: #333;
}

.page-header {
    background: linear-gradient(135deg, #34495e, #3498db);
    color: #f5f5f5;
    padding: 5px;
    text-align: center;
    margin: 5px 0 20px 0;
}

.page-header h1 {
    font-size: 28px;
    margin-bottom: 5px;
    word-break: break-word;
}

.page-header p {
    font-size: 14px;
    opacity: 0.9;
    word-break: break-word;
}

.content-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
}

/* --- Estilos de MEUS PEDIDOS --- */

.pedidos-list {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.pedido-item {
    padding: 20px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pedido-item:hover {
    background-color: #f9f9f9;
}

.pedido-header {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 15px;
}

.pedido-info {
    display: flex;
    flex-direction: column;
}

.pedido-info-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.pedido-info-value {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.pedido-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.pedido-total {
    font-size: 18px;
    font-weight: bold;
    color: #27ae60;
}

.btn-detalhe {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.btn-detalhe:hover {
    background-color: #2980b9;
}

/* --- Página de Detalhes do Pedido (pedido-detalhe.php) ---
   Reaproveita os mesmos componentes visuais do antigo #modal-content
   (.detalhe-section, .detalhe-grid, .tabela-itens etc. continuam iguais),
   só que como card normal na página, no lugar do overlay de modal. */
.pedido-detalhe-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.ativo {
    display: flex;
}

.modal-content {
    background: white;
    padding: 15px;
    border-radius: 8px;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
}

.modal-close {
    background: none;
    border: none;
    color: #2c3e50 !important;
    font-size: 28px;
    cursor: pointer;
}

.modal-body {
    padding: 20px;
}

.detalhe-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.detalhe-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.detalhe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.detalhe-item {
    display: flex;
    flex-direction: column;
}

.detalhe-label {
    font-size: 12px;
    color: #999;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.detalhe-value {
    font-size: 16px;
    font-weight: bold;
    color: #2c3e50;
}

.tabela-itens {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.tabela-itens th {
    background-color: #34495e;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

.tabela-itens td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.tabela-itens tr:hover {
    background-color: #f9f9f9;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    background-color: var(--badge-color, #95a5a6);
}

.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.empty {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

/* --- Estilos de MINHA CONTA --- */

.form-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 0px;
    font-weight: 600;
    font-size: 14px;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group input:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.form-group-full {
    grid-column: 1 / -1;
}

.alert {
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    display: none;
}

.alert.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.alert.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.alert.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
    justify-content: flex-end;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-primary:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
    margin-top: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3498db;
}

.section-title:first-of-type {
    margin-top: 0;
}

.loading-spinner {
    display: none;
    text-align: center;
    padding: 20px;
}

.loading-spinner.show {
    display: block;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.back-link {
    display: inline-block;
    margin-bottom: 20px;
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.back-link:hover {
    color: #2980b9;
}

.help-text {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablet (até 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }

    .header h1 {
        font-size: 24px;
    }

    .header p {
        font-size: 12px;
    }

    .pedido-header {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .pedido-footer {
        flex-direction: column;
        gap: 15px;
    }

    .pedido-item {
        padding: 15px;
    }

    .tabela-itens {
        font-size: 12px;
    }

    .tabela-itens th,
    .tabela-itens td {
        padding: 8px 5px;
    }

    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .pedido-detalhe-card {
        padding: 15px;
    }

    .detalhe-grid {
        grid-template-columns: 1fr;
    }

    .form-container {
        padding: 20px;
    }

    .form-row,
    .form-row-3 {
        grid-template-columns: 1fr;
    }

    .btn-group {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile (até 480px) */
@media (max-width: 480px) {
    .header {
        padding: 15px 10px;
    }

    .header h1 {
        font-size: 20px;
    }

    .container {
        padding: 0 15px 30px;
    }

    .form-container {
        padding: 15px;
        border-radius: 4px;
    }

    .form-group {
        margin-bottom: 15px;
    }

    .form-group label {
        font-size: 13px;
    }

    .form-group input,
    .form-group select {
        padding: 10px;
        font-size: 13px;
    }
}
