/* ============================================
   CSS NUANCIER TERRAZZO - LucemStone®
   Fichier séparé pour le nuancier terrazzo
   ============================================ */

/* Masquer le contenu initialement pour éviter le flash */
.nuances-grid {
    opacity: 0;
}

.nuances-grid.loaded {
    opacity: 1;
}

/* Surcharge pour la page terrazzo - collections centrées sur une ligne */
.nuancier-main .nuances-grid {
    display: flex;
    flex-direction: column;
    gap: 50px;
    margin-top: 40px;
    padding: 0 40px;
    max-width: 100%;
    align-items: center;
}

.nuancier-main .collections-row {
    display: flex;
    flex-direction: row;
    gap: 40px;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: nowrap;
}

.nuancier-main .collection-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 0 0 auto;
}

/* Titres plus petits */
.nuancier-main .collection-title {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
}

/* Images plus grandes */
.nuancier-main .nuance-item {
    width: 110px;
}

.nuancier-main .nuance-color {
    width: 110px;
    height: 110px;
}

.nuancier-main .nuance-name {
    font-size: 11px;
    min-height: 30px;
}

/* Désactiver les décalages spécifiques au béton ciré */
.nuancier-main .collection-group.collection-01-left {
    margin-right: 0;
    align-self: auto;
}

.nuancier-main .collection-group.collection-beige-left {
    position: static;
    left: 0;
}

/* Grilles pour terrazzo - par défaut 4 colonnes */
.nuancier-main .collection-items {
    display: grid;
    grid-template-columns: repeat(4, 110px);
    gap: 8px;
    justify-content: start;
}

/* Semi Précieuse - 3 colonnes */
.nuancier-main .collection-items-3col {
    grid-template-columns: repeat(3, 110px) !important;
}

/* Inclusion Verre - 2 colonnes */
.nuancier-main .collection-items-2col {
    grid-template-columns: repeat(2, 110px) !important;
}

/* Classique - 7 colonnes */
.nuancier-main .collection-items-7col {
    grid-template-columns: repeat(7, 110px) !important;
}

/* Sur écran 24 pouces Full HD (1920x1080) */
@media (min-width: 1920px) and (max-width: 1920px) {
    .nuancier-main .nuance-item {
        width: 115px;
    }
    
    .nuancier-main .nuance-color {
        width: 115px;
        height: 115px;
    }
    
    .nuancier-main .collection-items {
        grid-template-columns: repeat(4, 115px);
    }
    
    .nuancier-main .collection-items-3col {
        grid-template-columns: repeat(3, 115px) !important;
    }
    
    .nuancier-main .collection-items-2col {
        grid-template-columns: repeat(2, 115px) !important;
    }
    
    .nuancier-main .collection-items-7col {
        grid-template-columns: repeat(7, 115px) !important;
    }
}

/* Sur très grand écran uniquement (4K, etc.) */
@media (min-width: 1921px) {
    .nuancier-main .nuance-item {
        width: 120px;
    }
    
    .nuancier-main .nuance-color {
        width: 120px;
        height: 120px;
    }
    
    .nuancier-main .collection-items {
        grid-template-columns: repeat(4, 120px);
    }
    
    .nuancier-main .collection-items-3col {
        grid-template-columns: repeat(3, 120px) !important;
    }
    
    .nuancier-main .collection-items-2col {
        grid-template-columns: repeat(2, 120px) !important;
    }
    
    .nuancier-main .collection-items-7col {
        grid-template-columns: repeat(7, 120px) !important;
    }
}

/* Aligner les collections sur laptop */
@media (max-width: 1600px) and (min-width: 1025px) {
    .nuancier-main .nuance-item {
        width: 80px;
    }
    
    .nuancier-main .nuance-color {
        width: 80px;
        height: 80px;
    }
    
    .nuancier-main .collection-items {
        grid-template-columns: repeat(4, 80px);
        gap: 10px;
    }
    
    .nuancier-main .collection-items-3col {
        grid-template-columns: repeat(3, 80px) !important;
    }
    
    .nuancier-main .collection-items-2col {
        grid-template-columns: repeat(2, 80px) !important;
    }
    
    .nuancier-main .collection-items-7col {
        grid-template-columns: repeat(7, 80px) !important;
    }
    
    .nuancier-main .collections-row {
        justify-content: center;
        gap: 20px;
    }
    
    .nuancier-main .collection-title {
        font-size: 11px;
    }
    
    .nuancier-main .nuance-name {
        font-size: 9px;
    }
}

/* Responsive tablette - passer en colonne */
@media (max-width: 1024px) {
    .nuancier-main .collections-row {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 50px;
        align-items: center;
    }
    
    .nuancier-main .collection-group {
        align-items: center;
    }
    
    .nuancier-main .collection-title {
        text-align: center;
        font-size: 12px;
    }

    .nuancier-main .collection-items {
        justify-content: center;
    }
    
    .nuancier-main .collection-items-7col {
        grid-template-columns: repeat(4, 90px) !important;
    }
    
    .nuancier-main .nuance-item {
        width: 90px;
    }
    
    .nuancier-main .nuance-color {
        width: 90px;
        height: 90px;
    }
}

/* Responsive mobile */
@media (max-width: 768px) {
    .nuancier-main .nuances-grid {
        padding: 0 15px;
    }

    .nuancier-main .collections-row {
        flex-direction: column;
        gap: 40px;
        align-items: center;
    }

    .nuancier-main .collection-group {
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
    }
    
    .nuancier-main .collection-title {
        text-align: center;
        font-size: 12px;
    }
    
    .nuancier-main .nuance-item {
        width: 85px;
    }
    
    .nuancier-main .nuance-color {
        width: 85px;
        height: 85px;
    }

    .nuancier-main .collection-items {
        display: grid;
        gap: 12px;
        justify-content: center;
        justify-items: center;
        grid-template-columns: repeat(3, 85px) !important;
    }
    
    .nuancier-main .collection-items-3col {
        grid-template-columns: repeat(3, 85px) !important;
    }
    
    .nuancier-main .collection-items-2col {
        grid-template-columns: repeat(2, 85px) !important;
    }
    
    .nuancier-main .collection-items-7col {
        grid-template-columns: repeat(3, 85px) !important;
    }
}

/* ============================================
   VUE DÉTAILLÉE - MODAL OVERLAY
   ============================================ */

.terrazzo-detail-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9990;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

/* Cacher la barre de recherche quand le modal est actif */
body:has(.terrazzo-detail-modal.active) .nuancier-search-container {
    display: none !important;
}

.terrazzo-detail-modal.active {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.terrazzo-detail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

.terrazzo-detail-content {
    position: relative;
    background: #fff;
    max-width: 1100px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 40px;
    z-index: 1;
}

.terrazzo-detail-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.terrazzo-detail-close:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.terrazzo-detail-next {
    position: absolute;
    top: 15px;
    right: 65px;
    width: 40px;
    height: 40px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.terrazzo-detail-next:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.terrazzo-detail-inner {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.terrazzo-detail-ref {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.terrazzo-detail-images {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.terrazzo-detail-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terrazzo-detail-main img {
    width: 100%;
    height: auto;
    aspect-ratio: 2.4/1;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.terrazzo-detail-main img:hover {
    opacity: 0.9;
}

.terrazzo-detail-small {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.terrazzo-detail-small img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.terrazzo-detail-small img:hover {
    opacity: 0.9;
}

.terrazzo-scale-label {
    font-size: 12px;
    color: #888;
    font-style: italic;
}

.terrazzo-detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}

.terrazzo-btn {
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    box-sizing: border-box;
}

.terrazzo-btn-primary {
    background: #000;
    color: white;
    border: none;
}

.terrazzo-btn-primary:hover {
    background: #333;
}

.terrazzo-btn-secondary {
    background: #000;
    color: white;
    border: none;
}

.terrazzo-btn-secondary:hover {
    background: #333;
}

.terrazzo-btn-outline {
    background: white;
    color: #000;
    border: 2px solid #000;
    display: flex;
    align-items: center;
    gap: 8px;
}

.terrazzo-btn-outline:hover {
    background: #f0f0f0;
}

/* Lightbox */
.terrazzo-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.terrazzo-lightbox.active {
    display: flex;
    opacity: 1;
}

.terrazzo-lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    cursor: default;
    pointer-events: none;
}

.terrazzo-lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    width: 50px;
    height: 50px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    z-index: 10001;
    transition: opacity 0.3s ease;
}

.terrazzo-lightbox-close:hover {
    opacity: 0.7;
}

/* ========================================
   Section Textures
   ======================================== */
.textures-section {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

.textures-layout {
    display: flex;
    gap: 80px;
    justify-content: space-between;
}

/* Colonne gauche - Images verticales grandes */
.textures-left {
    flex: 0 0 400px;
}

.textures-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Collection de textures */
.texture-collection {
    margin-bottom: 30px;
}

.texture-collection .collection-title {
    font-size: 14px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #000;
    text-decoration: none;
    display: block;
    width: 100%;
}

.texture-collection .collection-title strong {
    font-weight: 700;
}

/* Items verticaux (colonne gauche) */
.texture-items-vertical {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.texture-item-large {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.texture-item-large img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.texture-item-large img:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.texture-item-large .texture-name {
    font-size: 14px;
    font-style: italic;
    color: #333;
}

/* Items en grille (colonne droite) */
.texture-items-grid {
    display: grid;
    gap: 20px;
}

.texture-items-7col {
    grid-template-columns: repeat(7, 100px);
}

.texture-items-4col {
    grid-template-columns: repeat(4, 100px);
}

.texture-items-2col {
    grid-template-columns: repeat(2, 100px);
}

.texture-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100px;
}

.texture-item img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 0;
    cursor: pointer;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.texture-item img:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

.texture-item .texture-name {
    font-size: 11px;
    color: #333;
    text-align: center;
}

/* Responsive textures */
@media (max-width: 1200px) {
    .textures-layout {
        flex-direction: column;
        gap: 40px;
    }
    
    .textures-left {
        flex: 1;
    }
    
    .texture-items-vertical {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .texture-item-large {
        flex: 1;
        min-width: 250px;
    }
    
    .texture-item-large img {
        height: 180px;
    }
    
    .texture-items-7col {
        grid-template-columns: repeat(4, 100px);
    }
    
    .texture-item {
        width: 100px;
    }
    
    .texture-item img {
        width: 100px;
        height: 100px;
    }
}

@media (max-width: 768px) {
    .textures-section {
        padding: 20px;
    }
    
    .texture-items-grid {
        gap: 15px;
    }
    
    .texture-items-7col,
    .texture-items-4col,
    .texture-items-2col {
        grid-template-columns: repeat(3, 85px);
    }
    
    .texture-item {
        width: 85px;
    }
    
    .texture-item img {
        width: 85px;
        height: 85px;
    }
    
    .texture-item .texture-name {
        font-size: 10px;
    }
    
    .texture-item-large img {
        height: 150px;
    }
}

/* Responsive modal */
@media (max-width: 768px) {
    .terrazzo-detail-content {
        padding: 20px;
        width: 95%;
    }
    
    .terrazzo-detail-images {
        flex-direction: column;
    }
    
    .terrazzo-detail-small {
        flex: none;
        width: 100%;
    }
    
    .terrazzo-detail-actions {
        flex-direction: column;
    }
    
    .terrazzo-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}
