.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.template-card {
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid transparent;
}

.template-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.template-info {
    padding: 2rem;
}

.template-info h3 {
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 1.3rem;
    color: var(--text);
    margin-bottom: 0.8rem;
}

.template-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.template-features {
    list-style: none;
    margin-bottom: 2rem;
    padding: 0;
}

.template-features li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.template-features li::before {
    content: '✓';
    color: #10b981;
    font-weight: bold;
}

.template-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05), rgba(29, 78, 216, 0.05));
    border-radius: 12px;
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    font-family: "Montserrat", sans-serif;
}

.price-currency {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.price-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-left: auto;
}

.template-buttons {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
}

.template-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 0.8rem 1rem;
}

.popular-badge {
    position: absolute;
    top: 15px;
    right: -8px;
    background: #10b981;
    color: white;
    padding: 0.3rem 1.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    transform: rotate(8deg);
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    z-index: 3;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.template-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.template-date {
    font-size: 0.8rem;
    color: var(--text-light);
    font-family: 'Courier New', monospace;
}

.template-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* VISUELS CSS INTÉGRÉS DANS LES TEMPLATES */
.template-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: white;
    transform: scale(1.2);
}

.visual-label {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* DASHBOARD VISUAL */
.visual-grid {
    display: flex;
    align-items: flex-end;
    gap: 0.8rem;
    height: 80px;
}

.visual-bar {
    width: 16px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    animation: barPulse 2s ease-in-out infinite;
}

.visual-bar:nth-child(1) { animation-delay: 0s; }
.visual-bar:nth-child(2) { animation-delay: 0.2s; }
.visual-bar:nth-child(3) { animation-delay: 0.4s; }
.visual-bar:nth-child(4) { animation-delay: 0.6s; }

@keyframes barPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* CONSULTING LAYOUT VISUAL */
.visual-layout {
    width: 100px;
    height: 75px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.layout-header {
    height: 18px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 4px 4px 0 0;
}

.layout-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
}

.content-block {
    height: 10px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 2px;
}

.layout-sidebar {
    position: absolute;
    right: 6px;
    top: 24px;
    width: 16px;
    height: 40px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 3px;
}

/* ESCAPE GAME LOCK VISUAL */
.visual-lock {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(1.3);
}

.lock-body {
    width: 50px;
    height: 40px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    position: relative;
}

.lock-keyhole {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.lock-keys {
    display: flex;
    gap: 6px;
    margin-top: 12px;
}

.key {
    width: 4px;
    height: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

/* RESTAURANT VISUAL */
.visual-restaurant {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transform: scale(1.3);
}

.restaurant-plate {
    position: relative;
    width: 45px;
    height: 45px;
}

.pizza-base {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
}

.pizza-slice {
    position: absolute;
    width: 10px;
    height: 10px;
    background: rgba(255, 200, 100, 0.9);
    border-radius: 50%;
}

.pizza-slice:nth-child(2) { top: 10px; left: 15px; }
.pizza-slice:nth-child(3) { top: 24px; left: 10px; }
.pizza-slice:nth-child(4) { top: 18px; right: 10px; }

.restaurant-menu {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-line {
    width: 28px;
    height: 3px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
}

/* BAR VISUAL */
.visual-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    transform: scale(1.2);
}

.bar-counter {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
}

.bar-glass {
    width: 12px;
    height: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 0 0 4px 4px;
    margin: 0 3px;
    display: inline-block;
}

.bar-bottles {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

.bottle {
    width: 6px;
    height: 28px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px 3px 0 0;
}

/* ANIMATION AU SURVOL */
.template-card:hover .template-visual {
    transform: scale(1.3);
}

.template-card:hover .visual-lock {
    transform: scale(1.5);
}

.template-card:hover .visual-restaurant {
    transform: scale(1.5);
}

.template-card:hover .visual-bar {
    transform: scale(1.4);
}

.template-card:hover .visual-bar {
    animation-duration: 1s;
}

/* RESPONSIVE POUR LES VISUELS */
@media (max-width: 768px) {
    .template-visual {
        transform: scale(1.1);
    }
    
    .visual-grid {
        height: 70px;
    }
    
    .visual-layout {
        width: 90px;
        height: 65px;
    }
    
    .visual-lock {
        transform: scale(1.2);
    }
    
    .visual-restaurant {
        transform: scale(1.2);
    }
    
    .visual-bar {
        transform: scale(1.1);
    }
}

/* RESPONSIVE POUR LA SECTION TEMPLATES */
@media (max-width: 768px) {
    .templates-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .template-info {
        padding: 1.5rem;
    }
    
    .template-buttons {
        flex-direction: column;
    }
    
    .popular-badge {
        top: 10px;
        right: -5px;
        padding: 0.25rem 1.2rem;
    }
}

@media (max-width: 480px) {
    .price-amount {
        font-size: 2rem;
    }
    
    .template-price {
        padding: 0.8rem;
    }
}