/* ESTILO BASE PARA TÍTULO DAS PÁGINAS DE SEGMENTO */
.page-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary); /* Azul principal do tema */
    text-align: center;
    margin: 2.5rem 0 2.5rem;
    position: relative;
    text-shadow: 0 2px 10px rgba(35, 59, 92, 0.1);
    padding: 0 1rem;
    line-height: 1.2;
}

.page-title::after {
    content: '';
    display: block;
    width: 120px;
    height: 6px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    margin: 1.5rem auto 0;
    border-radius: 3px;
    position: relative;
}

/* CONTAINER PRINCIPAL MODERNIZADO */
.custom-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    padding: 3rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* EFEITO DE FUNDO SUTIL */
.custom-grid-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(28, 50, 71, 0.03) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(28, 50, 71, 0.02) 0%, transparent 50%);
    pointer-events: none;
    border-radius: 24px;
}

/* CARDS MODERNIZADOS */
.custom-card {
    background: #ffffff;
    border: 1px solid rgba(28, 50, 71, 0.1);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    cursor: pointer; /* Indica que é clicável */
}

/* BORDA SUPERIOR GRADIENT */
.custom-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

/* HOVER EFFECTS */
.custom-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.custom-card:hover .custom-card-title {
    transform: translateY(-2px);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.custom-card:hover::before {
    opacity: 1;
}

/* IMAGEM DO CARD */
.custom-card-image-container {
    position: relative;
}

.ihm-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
    z-index: 10;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.custom-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.custom-card:hover .custom-card-image {
    transform: scale(1.05);
}

/* BADGE IHM */
.ihm-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #ff6600; /* Laranja */
    color: white;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
    z-index: 10;
}

/* CONTEÚDO DO CARD */
.custom-card-content {
    padding: 2rem 1.5rem 1rem 1.5rem; /* Reduz padding bottom para dar mais espaço aos botões */
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

/* TÍTULO DO CARD */
.custom-card-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 1.2rem 0;
    line-height: 1.15;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* DESCRIÇÃO (se houver) */
.custom-card-description {
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.25rem; /* Espaço reduzido para botões */
    flex: 1;
}

/* GRUPO DE BOTÕES */
.custom-btn-group {
    display: flex;
    flex-direction: column;
    margin-top: auto; /* Mantém no final */
    border-radius: 0 0 24px 24px; /* Arredonda apenas parte inferior */
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin: 0.75rem -1.5rem -1.5rem -1.5rem; /* Margem reduzida para aproximar do texto */
    position: relative;
}

/* BOTÕES MODERNIZADOS */
.custom-btn {
    display: block;
    width: 100%;
    border: none;
    padding: 1rem 1.5rem; /* Mesmo padding lateral do conteúdo */
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer; /* Cursor específico para botões */
}

/* EFEITO RIPPLE NOS BOTÕES */
.custom-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.custom-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* BOTÃO DETALHES */
.custom-details-btn {
    background: var(--gradient-primary);
    color: #fff;
    position: relative;
    z-index: 1;
}

.custom-details-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* SEPARADOR ENTRE BOTÕES */
.custom-details-btn:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* BOTÃO WHATSAPP */
.custom-whatsapp-btn {
    background: #1ebd5a;
    color: #fff;
    position: relative;
    z-index: 1;
}

.custom-whatsapp-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: #128c7e;
}

/* ÍCONES NOS BOTÕES */
.custom-btn::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    vertical-align: middle;
    transition: transform 0.3s ease;
}

.custom-details-btn::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M13 3l3.293 3.293-7 7 1.414 1.414 7-7L21 11V3z'/%3E%3Cpath d='M19 13v6a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2h6'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.custom-whatsapp-btn::after {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 24 24'%3E%3Cpath d='M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893A11.821 11.821 0 0020.891 3.488'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}

.custom-btn:hover::after {
    transform: scale(1.1);
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
    .custom-grid-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 2rem 1rem;
    }
    
    .custom-card-content {
        padding: 1.5rem 1.25rem 0.75rem 1.25rem; /* Ajusta padding bottom no mobile */
    }
    
    .custom-btn-group {
        margin: 0.5rem -1.25rem -1.25rem -1.25rem; /* Margem reduzida para mobile */
    }
    
    .custom-card-title {
        font-size: 1.4rem;
    }
    
    .custom-btn {
        padding: 0.875rem 1.25rem;
        font-size: 0.9rem;
    }
    
    .custom-card-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .custom-grid-container {
        padding: 1.5rem 0.75rem;
    }
    
    .custom-card-content {
        padding: 1.25rem 1rem 0.5rem 1rem; /* Ajusta padding bottom no mobile pequeno */
    }
    
    .custom-btn-group {
        margin: 0.25rem -1rem -1rem -1rem; /* Margem reduzida para mobile pequeno */
    }
    
    .custom-card-title {
        font-size: 1.25rem;
    }
    
    .custom-btn {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* LOADING STATES E ESTADOS ESPECIAIS */
.custom-card.loading {
    opacity: 0.7;
    pointer-events: none;
}

.custom-card.featured {
    border: 2px solid var(--accent);
    position: relative;
}

.custom-card.featured::after {
    content: 'DESTAQUE';
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 200;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
}