/**
 * ERP Public CSS
 *
 * @package ERP_Plugin
 */

:root {
    --erp-primary: #2563eb;
    --erp-primary-dark: #1d4ed8;
    --erp-secondary: #10b981;
    --erp-bg: #f8fafc;
    --erp-card-bg: #ffffff;
    --erp-text: #1e293b;
    --erp-text-light: #64748b;
    --erp-border: #e2e8f0;
}

/* ========================================
   Catalog Grid
   ======================================== */

.erp-catalogo {
    padding: 20px 0;
}

.erp-catalogo-grid {
    display: grid;
    grid-template-columns: repeat(var(--colunas, 3), 1fr);
    gap: 24px;
}

.erp-catalogo-item {
    background: var(--erp-card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.erp-catalogo-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.erp-catalogo-imagem {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--erp-bg);
}

.erp-catalogo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.erp-catalogo-item:hover .erp-catalogo-img {
    transform: scale(1.05);
}

.erp-catalogo-sem-imagem {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--erp-text-light);
}

.erp-catalogo-sem-imagem .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

.erp-catalogo-conteudo {
    padding: 20px;
}

.erp-catalogo-categoria {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--erp-primary);
    background: rgba(37, 99, 235, 0.1);
    padding: 4px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.erp-catalogo-titulo {
    font-size: 18px;
    font-weight: 600;
    color: var(--erp-text);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.erp-catalogo-descricao {
    font-size: 14px;
    color: var(--erp-text-light);
    line-height: 1.5;
    margin: 0 0 16px 0;
}

.erp-catalogo-botao {
    display: inline-block;
    width: 100%;
    padding: 12px 20px;
    background: var(--erp-primary);
    color: #fff;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.erp-catalogo-botao:hover {
    background: var(--erp-primary-dark);
    color: #fff;
}

/* ========================================
   Empty State
   ======================================== */

.erp-catalogo-vazio {
    text-align: center;
    padding: 40px;
    color: var(--erp-text-light);
    font-size: 16px;
}

/* ========================================
   Modal
   ======================================== */

.erp-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.erp-modal-content {
    background: var(--erp-card-bg);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    animation: erp-modal-in 0.3s ease;
}

@keyframes erp-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.erp-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    font-weight: bold;
    color: var(--erp-text-light);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.erp-modal-close:hover {
    background: var(--erp-bg);
    color: var(--erp-text);
}

.erp-modal-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--erp-text);
    margin: 0 0 24px 0;
}

/* ========================================
   Form Styles
   ======================================== */

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

.erp-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--erp-text);
    margin-bottom: 8px;
}

.erp-form-group input,
.erp-form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--erp-border);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.erp-form-group input:focus,
.erp-form-group textarea:focus {
    outline: none;
    border-color: var(--erp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.erp-form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* ========================================
   Buttons
   ======================================== */

.erp-btn {
    display: inline-block;
    padding: 14px 28px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.erp-btn-primary {
    background: var(--erp-primary);
    color: #fff;
    width: 100%;
}

.erp-btn-primary:hover {
    background: var(--erp-primary-dark);
    color: #fff;
}

.erp-btn-primary:disabled {
    background: var(--erp-text-light);
    cursor: not-allowed;
}

/* ========================================
   Message Return
   ======================================== */

#erp-modal-mensagem-retorno {
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    display: none;
}

#erp-modal-mensagem-retorno.sucesso {
    background: rgba(16, 185, 129, 0.1);
    color: var(--erp-secondary);
    display: block;
}

#erp-modal-mensagem-retorno.erro {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    display: block;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .erp-catalogo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .erp-catalogo-imagem {
        height: 160px;
    }

    .erp-catalogo-conteudo {
        padding: 16px;
    }

    .erp-catalogo-titulo {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .erp-catalogo-grid {
        grid-template-columns: 1fr;
    }

    .erp-catalogo-imagem {
        height: 200px;
    }

    .erp-modal-content {
        padding: 24px;
    }
}
