{% extends 'backfront.html.twig' %}
{% block title %}Packs SIP Academy - Formations groupées et économiques{% endblock %}
{% block meta_description %}
Découvrez nos packs de formation chez SIP Academy. Des offres groupées pour économiser sur vos formations et accélérer votre carrière.
{% endblock %}
{% block body %}
<style>
/* ===== COULEURS MODERNES ===== */
:root {
--gold: #FFAE27;
--gold-dark: #e09500;
--gold-light: #fff8e6;
--navy: #1F3971;
--navy-dark: #162d5a;
--navy-light: #e8edf8;
--text-dark: #1a2a3a;
--text-muted: #6c757d;
--border-light: #eef2f6;
}
/* ===== BREADCRUMB MODERNE ===== */
.breadcrumb-area {
background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
padding: 100px 0 120px;
position: relative;
text-align: center;
}
.breadcrumb-title h1 {
color: #fff;
font-size: 48px;
font-weight: 800;
margin-bottom: 10px;
letter-spacing: -1px;
}
.breadcrumb-list {
list-style: none;
padding: 0;
margin: 0;
display: flex;
justify-content: center;
gap: 15px;
align-items: center;
}
.breadcrumb-list li, .breadcrumb-list li a {
color: rgba(255,255,255,0.7);
font-size: 15px;
text-decoration: none;
transition: color 0.3s;
}
.breadcrumb-list li a:hover {
color: var(--gold);
}
.breadcrumb-list li.active {
color: var(--gold);
}
.breadcrumb-list li i {
font-size: 14px;
color: var(--gold);
}
/* ===== SECTION TITRES ===== */
.section-title-wrapper {
text-align: center;
margin-bottom: 50px;
}
.section-title h3 {
font-size: 36px;
font-weight: 800;
color: var(--text-dark);
margin-bottom: 12px;
position: relative;
display: inline-block;
}
.section-title h3::after {
content: '';
position: absolute;
bottom: -12px;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 4px;
background: linear-gradient(90deg, var(--gold), var(--gold-dark));
border-radius: 2px;
}
.section-title p {
font-size: 16px;
color: var(--text-muted);
margin-top: 20px;
}
/* ===== COURSE AREA ===== */
.course-area {
padding: 80px 0;
background: #fff;
}
/* CARTE PACK - HAUTEUR ÉGALE */
.single-item {
background: #fff;
border-radius: 20px;
overflow: hidden;
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
transition: all 0.3s cubic-bezier(0.4,0,0.2,1);
height: 100%;
display: flex;
flex-direction: column;
border: 1px solid var(--border-light);
}
.single-item:hover {
transform: translateY(-8px);
box-shadow: 0 20px 40px rgba(31,57,113,0.15);
border-color: var(--gold);
}
/* IMAGE */
.single-item-image {
position: relative;
overflow: hidden;
height: 220px;
background: linear-gradient(135deg, #f8faff 0%, #fff 100%);
display: flex;
align-items: center;
justify-content: center;
}
.single-item-image a {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
}
.single-item-image img {
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
object-fit: contain;
transition: transform 0.4s ease;
}
.single-item:hover .single-item-image img {
transform: scale(1.05);
}
/* BADGE PACK (optionnel) */
.pack-badge {
position: absolute;
top: 15px;
right: 15px;
background: linear-gradient(135deg, var(--gold), var(--gold-dark));
color: var(--navy);
padding: 6px 14px;
border-radius: 20px;
font-size: 11px;
font-weight: 800;
text-transform: uppercase;
letter-spacing: 1px;
z-index: 3;
box-shadow: 0 4px 12px rgba(255,174,39,0.3);
}
/* CORPS DE LA CARTE */
.single-item-text {
padding: 20px;
flex: 1;
display: flex;
flex-direction: column;
}
.single-item-text h4 {
font-size: 18px;
font-weight: 700;
margin-bottom: 12px;
line-height: 1.4;
min-height: 50px;
}
.single-item-text h4 a {
color: var(--text-dark);
text-decoration: none;
transition: color 0.2s;
}
.single-item-text h4 a:hover {
color: var(--gold);
}
/* DESCRIPTION */
.single-item-text > p {
font-size: 13px;
color: var(--text-muted);
line-height: 1.6;
margin-bottom: 16px;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
}
/* BADGE ÉCONOMIE */
.economy-badge {
display: inline-block;
background: rgba(255,174,39,0.15);
color: var(--gold-dark);
font-size: 11px;
font-weight: 700;
padding: 4px 10px;
border-radius: 20px;
margin-bottom: 15px;
width: fit-content;
}
/* INFOS CARTE (PRIX + PANIER) */
.single-item-content {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: auto;
padding-top: 15px;
border-top: 1px solid var(--border-light);
}
.single-item-comment-view {
display: flex;
gap: 15px;
align-items: center;
}
.single-item-comment-view span {
font-size: 18px;
font-weight: 700;
color: var(--gold);
display: flex;
align-items: center;
gap: 5px;
}
.single-item-comment-view span svg {
width: 24px;
height: 24px;
}
.single-item-comment-view span svg path {
fill: var(--gold);
}
/* PRIX BARRÉ (ancien prix) */
.old-price {
font-size: 13px;
color: var(--text-muted);
text-decoration: line-through;
margin-left: 8px;
font-weight: normal;
}
/* BOUTON PANIER */
.btn-ajout-panier {
background: linear-gradient(135deg, var(--navy), var(--navy-dark));
border: none;
color: white;
padding: 10px 15px;
border-radius: 12px;
transition: all 0.3s ease;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
}
.btn-ajout-panier:hover {
background: linear-gradient(135deg, var(--gold), var(--gold-dark));
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(255,174,39,0.3);
}
.btn-ajout-panier svg {
width: 22px;
height: 22px;
}
.btn-ajout-panier svg path {
fill: #fff;
transition: fill 0.3s ease;
}
.btn-ajout-panier:hover svg path {
fill: var(--navy);
}
.btn-ajout-panier:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none;
}
/* MESSAGE AUCUN PACK */
.no-packs-message {
text-align: center;
padding: 60px 40px;
background: #fff;
border-radius: 24px;
border: 1px solid var(--border-light);
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
max-width: 500px;
margin: 0 auto;
}
.no-packs-icon {
font-size: 64px;
color: var(--gold);
margin-bottom: 20px;
}
.no-packs-message h3 {
font-size: 24px;
font-weight: 700;
color: var(--text-dark);
margin-bottom: 12px;
}
.no-packs-message p {
font-size: 15px;
color: var(--text-muted);
margin-bottom: 25px;
}
/* PAGINATION */
.pagination-wrapper {
margin-top: 40px;
text-align: center;
}
.pagination {
display: flex;
justify-content: center;
gap: 8px;
list-style: none;
padding: 0;
margin: 0;
}
.pagination .page-item {
list-style: none;
}
.pagination .page-link {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 12px;
background: #fff;
border: 1px solid var(--border-light);
color: var(--navy);
font-weight: 500;
text-decoration: none;
transition: all 0.3s ease;
}
.pagination .page-link:hover {
background: var(--gold);
border-color: var(--gold);
color: var(--navy);
}
.pagination .active .page-link {
background: linear-gradient(135deg, var(--navy), var(--navy-dark));
border-color: var(--navy);
color: #fff;
}
/* RESPONSIVE */
@media (max-width: 768px) {
.section-title h3 {
font-size: 28px;
}
.single-item-image {
height: 180px;
}
.single-item-text h4 {
font-size: 16px;
min-height: auto;
}
.pagination .page-link {
width: 36px;
height: 36px;
font-size: 13px;
}
.breadcrumb-title h1 {
font-size: 32px;
}
.single-item-comment-view span {
font-size: 16px;
}
.single-item-comment-view span svg {
width: 20px;
height: 20px;
}
.btn-ajout-panier {
padding: 8px 12px;
}
.btn-ajout-panier svg {
width: 18px;
height: 18px;
}
}
</style>
<!-- BREADCRUMB AREA -->
<div class="breadcrumb-area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="breadcrumb-title">
<h1>Nos Packs</h1>
<ul class="breadcrumb-list">
<li><a href="{{ path('app_home') }}">Accueil</a></li>
<li><i class="zmdi zmdi-chevron-right"></i></li>
<li class="active">Packs</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- COURSE AREA -->
<div class="course-area">
<div class="container">
<div class="row">
<div class="col-md-12">
<div class="section-title-wrapper">
<div class="section-title">
<h3>Nos Packs</h3>
<p>Des offres groupées économiques pour accélérer votre carrière</p>
</div>
</div>
</div>
</div>
<div class="row">
{% if packs is empty %}
<div class="col-md-12">
<div class="no-packs-message">
<div class="no-packs-icon">
<i class="zmdi zmdi-info-outline"></i>
</div>
<h3>Aucun pack disponible</h3>
<p>De nouveaux packs seront bientôt disponibles. Revenez prochainement !</p>
</div>
</div>
{% else %}
{% for pack in packs %}
<div class="col-lg-4 col-md-6 col-12 mb-4 d-flex">
<div class="single-item w-100">
<div class="single-item-image overlay-effect">
<a href="#">
<img src="{{ asset('uploads/formation/' ~ pack.image) }}" alt="{{ pack.libelle }}">
</a>
</div>
<div class="single-item-text">
<h4><a href="#">{{ pack.libelle }}</a></h4>
{# <div class="economy-badge">#}
{# <i class="zmdi zmdi-trending-down"></i> Économisez jusqu'à 30%#}
{# </div>#}
<p>
{% if pack.description|striptags|length > 100 %}
{{ pack.description|striptags|slice(0, 100) }}...
{% else %}
{{ pack.description|striptags }}
{% endif %}
</p>
<div class="single-item-content">
<div class="single-item-comment-view">
<span>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M4.616 19q-.691 0-1.153-.462T3 17.384V6.616q0-.691.463-1.153T4.615 5h14.77q.69 0 1.152.463T21 6.616v10.769q0 .69-.463 1.153T19.385 19zm5.884-4.5H7q-.213 0-.356.144t-.144.357t.144.356T7 15.5h1.5v.5q0 .213.144.356t.357.144t.356-.144T9.5 16v-.5h1.23q.328 0 .549-.221t.221-.548v-2.462q0-.327-.221-.548t-.548-.221H7.5v-2H11q.213 0 .356-.144t.144-.357t-.144-.356T11 8.5H9.5V8q0-.213-.145-.356q-.146-.144-.36-.144q-.203 0-.317.16q-.115.161-.178.34v.5H7.27q-.328 0-.549.221T6.5 9.27v2.462q0 .327.221.548t.548.221H10.5zm5.637 1.344l1.054-1.053q.105-.106.055-.227t-.192-.122h-2.112q-.132 0-.185.122q-.053.12.053.227l1.053 1.053q.056.056.135.056t.139-.056m-1.19-6.036h2.111q.133 0 .185-.121q.053-.121-.052-.227l-1.054-1.053q-.056-.057-.135-.057t-.138.056L14.81 9.46q-.106.106-.056.227q.05.12.192.12"/>
</svg>
{{ pack.prix }} DT
</span>
</div>
<button class="btn-ajout-panier" data-id="{{ pack.id }}">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024">
<path d="M1015.66 284a31.82 31.82 0 0 0-25.999-13.502h-99.744L684.78 95.666c-24.976-24.976-65.52-25.008-90.495 0L392.638 270.498h-82.096l-51.408-177.28c-20.16-69.808-68.065-77.344-87.713-77.344H34.333c-17.568 0-31.776 14.224-31.776 31.776S16.78 79.425 34.332 79.425h137.056c4.336 0 17.568 0 26.593 31.184l176.848 649.936c3.84 13.712 16.336 23.183 30.592 23.183h431.968c13.408 0 25.376-8.4 29.904-21.024l152.256-449.68c3.504-9.744 2.048-20.592-3.888-29.024zM639.537 140.93l152.032 129.584H487.457zm175.488 579.263H429.538L328.386 334.065h616.096zm-63.023 127.936c-44.192 0-80 35.808-80 80s35.808 80 80 80s80-35.808 80-80s-35.808-80-80-80m-288 0c-44.192 0-80 35.808-80 80s35.808 80 80 80s80-35.808 80-80s-35.808-80-80-80"/>
</svg>
</button>
</div>
</div>
</div>
</div>
{% endfor %}
{% endif %}
</div>
<!-- PAGINATION -->
{% if paginator is defined and paginator.pageCount > 1 %}
<div class="row">
<div class="col-12">
<div class="pagination-wrapper">
{{ knp_pagination_render(paginator, 'formation/custom_pagination.html.twig') }}
</div>
</div>
</div>
{% endif %}
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
const cartCount = document.getElementById('cart-count');
document.querySelectorAll('.btn-ajout-panier').forEach(button => {
button.addEventListener('click', () => {
const packId = button.dataset.id;
fetch(`/panier/ajouter/${packId}`, {
method: 'POST',
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(response => response.json())
.then(data => {
if (data.status === 'ok') {
if (cartCount) cartCount.textContent = data.total_items;
Swal.fire({
icon: 'success',
title: 'Pack ajouté au panier !',
text: data.message,
timer: 1500,
showConfirmButton: false,
background: '#fff',
customClass: {
popup: 'swal-popup'
}
});
button.disabled = true;
button.style.opacity = '0.6';
button.style.cursor = 'not-allowed';
} else if (data.status === 'already_in_cart') {
Swal.fire({
icon: 'info',
title: 'Déjà dans le panier',
text: data.message,
confirmButtonColor: '#FFAE27'
});
button.disabled = true;
button.style.opacity = '0.6';
button.style.cursor = 'not-allowed';
} else {
Swal.fire({
icon: 'error',
title: 'Erreur',
text: data.message ?? 'Erreur lors de l\'ajout au panier.',
confirmButtonColor: '#FFAE27'
});
}
})
.catch(() => {
Swal.fire({
icon: 'error',
title: 'Erreur réseau',
text: 'Impossible d\'ajouter le pack.',
confirmButtonColor: '#FFAE27'
});
});
});
});
});
</script>
{% endblock %}