:root {
    --background-color: #FFFCFA;
    --primary-color: #3DCC3D; 
    --text-color: #373435; 
    --header-bg: #f8f8f8;
    --header-border: #ddd;
    --secondary-bg: #e9ecef;
    --font-main: 'Space Grotesk', sans-serif;
    --font-heading: 'Concert One', sans-serif;
}

body.dark-mode {
    --background-color: #111827;
    --primary-color: #3DCC3D; 
    --text-color: #FFFCFA; 
    --header-bg: #1f2937;
    --header-border: #4b5563;
    --secondary-bg: #1f2937;
}

body {
    margin: 0;
    padding: 0;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    font-family: var(--font-main);
    overflow-x: hidden;
}

/* Centrage global de la page */
main, .main-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

h2 {
    font-family: var(--font-main);
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-color);
    width: 100%;
    display: block;
}

@media (max-width: 768px) {
    h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
}

a {
    text-decoration: none;
    color: inherit;
}

/* SECTION FILTRE - centrée */
.filter-section {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin: 40px auto 20px;
    padding: 15px 35px;
    background-color: var(--header-bg);
    border-radius: 50px;
    border: 1px solid var(--header-border);
    width: fit-content;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

#filter-material {
    padding: 8px 16px;
    border-radius: 12px;
    border: 1px solid var(--header-border);
    background: var(--background-color);
    color: var(--text-color);
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    outline: none;
    height: 40px;
    box-sizing: border-box;
    cursor: pointer;
}

#filter-material:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(61, 204, 61, 0.2);
}

.filter-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

.filter-group label {
    font-weight: bold;
    color: var(--text-color);
}

.filter-label {
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

#services {
    padding: 60px 0;
    background-color: var(--background-color);
    width: 100%;
}

/* CORRECTION : Grille des produits - centrage parfait */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 280px);
    gap: 25px;
    justify-content: center;
    margin: 40px auto;
    width: 100%;
}

.service-card.has-photo {
    display: flex;
    flex-direction: column;
    background: linear-gradient(155deg, var(--background-color) 0%, var(--secondary-bg) 140%);
    border: 1px solid var(--header-border);
    border-radius: 25px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease, border-color 0.3s ease;
    text-decoration: none;
    height: 380px;
    width: 280px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}

.service-card.has-photo .product-photo {
    position: relative;
    width: 100%;
    height: 46%;
    flex-shrink: 0;
    overflow: hidden;
}

.service-card.has-photo .product-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0) 55%);
    pointer-events: none;
}

.service-card.has-photo .product-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.service-card.has-photo:hover .product-photo img {
    transform: scale(1.08);
}

.service-card.has-photo .product-tag {
    position: absolute;
    top: 14px;
    left: 14px;
    background-color: rgba(255, 255, 255, 0.92);
    color: var(--text-color);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 5px 12px;
    border-radius: 50px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Grand numéro en filigrane, signature d'un style éditorial premium */
.service-card.has-photo .service-index {
    position: absolute;
    top: 14px;
    right: 22px;
    font-family: var(--font-heading);
    font-size: 3.6rem;
    line-height: 1;
    color: white;
    opacity: 0.85;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35);
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.service-card.has-photo:hover .service-index {
    opacity: 1;
}

/* Trait d'accent qui s'allonge au survol */
.service-card.has-photo .service-accent {
    width: 32px;
    height: 3px;
    margin: 22px 26px 0;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(.2,.8,.2,1);
}

.service-card.has-photo:hover .service-accent {
    width: 56px;
}

/* Conteneur de texte */
.service-card.has-photo .text-container {
    padding: 14px 26px 22px;
    display: flex;
    flex-direction: column;
    text-align: left;
    flex: 1;
}

.service-card.has-photo .text-container h3 {
    font-family: var(--font-main);
    color: var(--primary-color);
    font-size: 1.2rem;
    margin: 0 0 8px 0;
}

.service-card.has-photo .text-container p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Effet au survol */
.service-card.has-photo:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

/* Adaptation Desktop large (moins de 1200px) */
@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 280px);
        gap: 25px;
    }
}

/* Tablette (moins de 768px) */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 280px;
        gap: 25px;
    }
}

/* SECTION ENCRES */
.inks-section {
    margin: 80px auto 60px;
    padding: 0 20px;
    max-width: 1200px;
    width: 100%;
    box-sizing: border-box;
}

.inks-title {
    font-family: var(--font-main, 'Concert One', sans-serif);
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 20px;
    color: var(--text-color);
}

.inks-subtitle {
    text-align: center;
    color: var(--primary-color);
    font-family: var(--font-main);
    font-size: 1.1rem;
    margin-bottom: 50px;
    opacity: 0.9;
}

/* CORRECTION : Grille des encres - centrage parfait */
.inks-grid {
    display: grid;
    grid-template-columns: repeat(3, 320px);
    justify-content: center;
    gap: 30px;
    margin: 40px auto;
    width: 100%;
}

.ink-card {
    display: flex;
    flex-direction: column;
    background: linear-gradient(155deg, var(--background-color) 0%, var(--secondary-bg) 140%);
    border: 1px solid var(--header-border);
    border-radius: 25px;
    overflow: hidden;
    transition: transform 0.4s cubic-bezier(.2,.8,.2,1), box-shadow 0.4s ease, border-color 0.3s ease;
    text-decoration: none;
    height: 500px;
    width: 320px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.04);
    padding: 26px 26px 22px;
    box-sizing: border-box;
}

.ink-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

/* Grand numéro en filigrane, cohérent avec le reste du site */
.ink-card .service-index {
    position: absolute;
    top: 14px;
    right: 22px;
    font-family: var(--font-heading);
    font-size: 4.5rem;
    line-height: 1;
    color: var(--text-color);
    opacity: 0.06;
    letter-spacing: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
    pointer-events: none;
}

.ink-card:hover .service-index {
    opacity: 0.1;
    transform: translateY(-4px);
}

/* Médaillon icône discret, à la place du grand bandeau coloré */
.ink-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, #2a9e2a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px rgba(61, 204, 61, 0.25);
}

.ink-icon-badge i {
    font-size: 1.4rem;
    color: white;
}

/* Trait d'accent qui s'allonge au survol */
.ink-card .service-accent {
    width: 32px;
    height: 3px;
    margin: 16px 0 18px;
    background-color: var(--primary-color);
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(.2,.8,.2,1);
}

.ink-card:hover .service-accent {
    width: 56px;
}

.ink-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
    min-height: 0;
}

.ink-content h3 {
    font-family: var(--font-main);
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ink-badge {
    display: inline-block;
    background: rgba(61, 204, 61, 0.15);
    color: var(--primary-color);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 50px;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    width: fit-content;
    align-self: flex-start;
}

.ink-description {
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.4;
    margin-bottom: 8px;
    opacity: 0.85;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ink-features {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
    border-top: 1px solid var(--header-border);
    padding-top: 8px;
    margin-top: 8px;
}

.ink-features li {
    font-size: 0.85rem;
    padding: 3px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--text-color);
}

.ink-features li i {
    color: var(--primary-color);
    font-size: 0.8rem;
    width: 16px;
}

.food-grade {
    background: rgba(61, 204, 61, 0.1);
    border-left: 3px solid var(--primary-color);
    padding: 6px 8px;
    margin-top: 8px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.food-grade i {
    color: var(--primary-color);
    font-size: 0.7rem;
}

/* Tablette : 2 cartes encres par ligne */
@media (max-width: 1200px) {
    .inks-grid {
        grid-template-columns: repeat(2, 320px);
        gap: 30px;
    }
}

/* Téléphone : 1 carte encre par ligne */
@media (max-width: 768px) {
    .inks-grid {
        grid-template-columns: 320px;
        gap: 30px;
    }
    
    .inks-title {
        font-size: 1.8rem;
    }
}

/* Petit téléphone (moins de 480px) */
@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .service-card {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .inks-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    
    .ink-card {
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
    }
    
    .filter-section {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
        border-radius: 25px;
    }
    
    .filter-group {
        width: 100%;
        justify-content: center;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .inks-section {
        padding: 0 15px;
    }
}