#sp-cartilla-colores{

    display:grid;

    grid-template-columns:
    repeat(auto-fill,minmax(80px,1fr));

    gap:10px;

    margin-top:20px;

    max-height:600px;

    overflow-y:auto;

    width:100%;

}

#sp-cartilla-colores::-webkit-scrollbar{

    width:8px;

}

#sp-cartilla-colores::-webkit-scrollbar-thumb{

    background:#d1d5db;

    border-radius:20px;

}

.sp-color-item{

    width:100%;

    aspect-ratio:1/1;

    min-height:60px;

    border:2px solid #ddd;

    border-radius:8px;

    cursor:pointer;

    transition:.2s;

}

.sp-color-item:hover{

    transform:scale(1.05);

}

.sp-color-item.activo{

    border:4px solid #0b57d0;

    transform:scale(1.08);

    box-shadow:
        0 6px 15px rgba(11,87,208,.35);

}

#sp-canvas{

    width:100% !important;

    height:auto !important;

    max-width:100% !important;

    display:block;

    border:none;

    border-radius:8px;

    box-shadow:
        0 8px 25px rgba(0,0,0,.15);

}

#sp-panel-simulador{

    background:#fff;

    padding:20px;

    border-radius:15px;

    box-shadow:
    0 5px 20px rgba(0,0,0,.08);
}

#sp-intensidad-container{

    margin-top:20px;

    padding:15px;

    background:#ffffff;

    border-radius:8px;

    box-shadow:
        0 2px 8px rgba(0,0,0,.08);

}

#sp-intensidad-container label{

    font-size:14px;

    font-weight:600;

    color:#333;

}

#sp-intensidad{

    width:100%;

    margin-top:10px;

    cursor:pointer;

    -webkit-appearance:none;

    appearance:none;

    height:6px;

    border-radius:20px;

    background:#ddd;

}

#sp-intensidad-valor{

    font-weight:bold;

    color:#111;

}

#sp-intensidad::-webkit-slider-thumb{

    -webkit-appearance:none;

    width:18px;

    height:18px;

    border-radius:50%;

    background:#0b57d0;

    cursor:pointer;

}

#sp-intensidad::-moz-range-thumb{

    width:18px;

    height:18px;

    border:none;

    border-radius:50%;

    background:#0b57d0;

    cursor:pointer;

}

#sp-intensidad::-moz-range-track{

    height:6px;

    border-radius:20px;

    background:#ddd;

}

#sp-filtros-colores{

    margin-top:20px;

    margin-bottom:15px;

}

#sp-filtros-colores label{

    display:block;

    margin-bottom:8px;

    font-size:14px;

    font-weight:600;

    color:#333;

}

#sp-familia-selector{

    width:100%;

    padding:10px;

    border:1px solid #ddd;

    border-radius:6px;

    background:#fff;

    font-size:14px;

}

#sp-buscador-container{

    margin-top:20px;
    margin-bottom:20px;

}

#sp-buscador-color{

    width:100%;

    padding:12px;

    border:1px solid #ddd;

    border-radius:8px;

    font-size:14px;

    box-sizing:border-box;

}

#sp-buscador-color:focus{

    outline:none;

    border-color:#0b57d0;

}

#sp-cartilla-selector-container{

    margin-bottom:20px;

}

#sp-cartilla-selector{

    width:100%;

    padding:12px;

    border:1px solid #ddd;

    border-radius:8px;

    background:#fff;

}

#sp-cartilla-selector,
#sp-familia-selector{

    width:100%;

    max-width:400px;

    height:52px;

    padding:0 15px;

    font-size:16px;

    border:1px solid #ddd;

    border-radius:8px;

    background:#fff;

}

#sp-ficha-color{

    margin-top:25px;

    padding:30px;

    background:#ffffff;

    border-radius:16px;

    border:1px solid #ececec;

    box-shadow:
        0 8px 30px rgba(0,0,0,.06);

}

#sp-ficha-color h3{

    margin:0 0 15px 0;

    font-size:22px;

    font-weight:600;

}

#sp-ficha-contenido{

    line-height:1.7;

    font-size:14px;

    color:#4b5563;

}

#sp-simulador-layout h3{

    font-size:18px;

    font-weight:600;

    color:#1f2937;

    margin-bottom:15px;

}

#sp-ficha-color-header{

    display:flex;

    align-items:center;

    gap:30px;

}

#sp-color-preview{

    width:140px;

    height:140px;

    border-radius:16px;

    border:1px solid #dcdcdc;

    box-shadow:
        0 8px 20px rgba(0,0,0,.08);

    background:#ffffff;

    flex-shrink:0;

}

#sp-color-info{

    flex:1;

    min-height:140px;

    display:flex;

    flex-direction:column;

    justify-content:center;

}

@media(max-width:768px){

    #sp-ficha-color-header{

        flex-direction:column;

        align-items:flex-start;

    }

    #sp-color-preview{

        width:120px;

        height:120px;

    }

}

#sp-comparacion-container{

    margin-top:15px;

    margin-bottom:20px;

    text-align:center;

}

#sp-toggle-original{

    padding:12px 25px;

    border:none;

    border-radius:8px;

    background:#1f2937;

    color:#fff;

    font-size:14px;

    font-weight:600;

    cursor:pointer;

    transition:.2s;

}

#sp-toggle-original:hover{

    transform:translateY(-2px);

}

#sp-descargar-imagen{

    padding:12px 25px;

    margin-left:10px;

    border:none;

    border-radius:8px;

    background:#0b57d0;

    color:#ffffff;

    font-size:14px;

    font-weight:600;

    cursor:pointer;

    transition:.2s;

}

#sp-descargar-imagen:hover{

    transform:translateY(-2px);

}

.sp-ambiente-card{

    flex:0 0 100px;

    cursor:pointer;

    overflow:hidden;

    border-radius:12px;

    background:#fff;

    border:2px solid #e5e7eb;

    transition:.25s;

    box-shadow:
        0 4px 12px rgba(0,0,0,.08);

}

.sp-ambiente-card:hover{

    transform:translateY(-4px);

}

.sp-ambiente-card.activo{

    border:3px solid #0b57d0;

}

.sp-ambiente-card img{

    width:100%;

    height:70px;

    object-fit:cover;

    display:block;

}

.sp-ambiente-card span{

    display:block;

    padding:8px;

    text-align:center;

    font-size:13px;

    font-weight:600;

}

#sp-galeria-ambientes{

    flex:1;

    display:flex;

    gap:15px;

    overflow-x:auto;

    overflow-y:hidden;

    padding-bottom:10px;

    scroll-behavior:smooth;

    scrollbar-width:none;

    -ms-overflow-style:none;

}

#sp-galeria-ambientes::-webkit-scrollbar{

    display:none;

}

#sp-carrusel-wrapper{

    display:flex;

    align-items:center;

    gap:10px;

    padding:20px;

    background:#ffffff;

    border-radius:15px;

    margin-bottom:25px;

    box-shadow:
        0 5px 20px rgba(0,0,0,.08);

}

#sp-carrusel-prev,
#sp-carrusel-next{

    width:42px;

    height:42px;

    border:none;

    border-radius:50%;

    background:#ffffff;

    color:#111111;

    cursor:pointer;

    font-size:24px;

    font-weight:700;

    line-height:42px;

    text-align:center;

    padding:0;

    margin:0 5px;

    box-shadow:
        0 2px 8px rgba(0,0,0,.15);

}

#sp-carrusel-prev:hover,
#sp-carrusel-next:hover{

    background:#f3f4f6;

}

#sp-main-layout{

    display:grid;

    grid-template-columns:
    72% 28%;

    gap:25px;

    margin-top:25px;

}

/* ==========================================
   CONTENEDOR GENERAL
========================================== */

#sp-simulador-layout{

    max-width:1600px;

    margin:0 auto;

    padding:20px;

}

#sp-panel-colores{

    background:#fff;

    padding:20px;

    border-radius:15px;

    height:fit-content;

    box-shadow:
        0 5px 20px rgba(0,0,0,.08);

    display:flex;

    flex-direction:column;

}

#sp-canvas-container{

    position:relative;

    width:100%;

    overflow:hidden;

    border-radius:12px;

    height:auto !important;
    min-height:auto !important;
    display:inline-block !important;

}

#sp-canvas-loading{

    position:absolute;

    inset:0;

    display:flex;

    align-items:center;

    justify-content:center;

    background:rgba(255,255,255,.8);

    z-index:10;

    font-size:18px;

    font-weight:600;

    pointer-events:none;

}

@media(max-width:1200px){

    #sp-main-layout{

        grid-template-columns:1fr;

    }

}

@media(max-width:768px){

    #sp-main-layout{

        grid-template-columns:1fr;

        gap:15px;

    }

    #sp-simulador-layout{

        padding:10px;

    }

    #sp-carrusel-wrapper{

        padding:10px;

        gap:5px;

        margin-bottom:15px;

    }

    .sp-ambiente-card{

        flex:0 0 80px;

    }

    .sp-ambiente-card img{

        height:55px;

    }

    .sp-ambiente-card span{

        font-size:11px;

        padding:4px;

    }

    #sp-carrusel-prev,
    #sp-carrusel-next{

        width:34px;

        height:34px;

        line-height:34px;

        font-size:18px;

    }

    #sp-canvas{

        width:100%;

        height:auto;

        max-width:none;

    }

    #sp-panel-colores{

        padding:12px;

    }

    #sp-cartilla-colores{

        grid-template-columns:
        repeat(auto-fill,minmax(50px,1fr));

    }

    #sp-comparacion-container{

        display:flex;

        flex-direction:column;

        gap:10px;

    }

    #sp-descargar-imagen{

        margin-left:0;

    }

}

#sp-cartilla-selector-container label,
#sp-filtros-colores label{

    display:block;

    margin-bottom:8px;

    font-size:14px;

    font-weight:600;

    color:#374151;

}

@media(max-width:768px){

    #sp-canvas-container{

        height:auto !important;

        min-height:0 !important;

    }

    #sp-panel-simulador{

        height:auto !important;

        min-height:0 !important;

    }

}