

/* Resto del CSS no modificado */
#cpig-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    padding: 20px;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    background: linear-gradient(145deg, #2a2a2a, #383838);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: #e0e0e0;
    font-family: 'Roboto', sans-serif;
}

#cpig-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.cpig-logo {
    height: auto;
    transition: transform 0.3s ease;
}

.cpig-logo:hover {
    transform: scale(1.1);
}

#cpig-text {
    width: 100%;
    height: 100px;
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    background-color: #1f1f1f;
    color: inherit;
    resize: none;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#cpig-text::placeholder {
    color: #e0e0e0;
}

#cpig-text:focus {
    border-color: #10a37f;
    outline: none;
}

#cpig-generate {
    position: relative;
    width: 200px;
    height: 50px;
    background-color: #10a37f;
    color: #e0e0e0;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 20px;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-align: center;
}

#cpig-generate img {
    width: 24px;
    height: 24px;
    transition: opacity 0.3s ease;
}

#cpig-generate span {
    opacity: 0;
    transition: opacity 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#cpig-generate:hover {
    background-color: #0c8a66;
    transform: scale(1.05);
}

#cpig-generate.hover-enabled:hover img {
    opacity: 0;
}

#cpig-generate.hover-enabled:hover span {
    opacity: 1;
}

#cpig-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-content: flex-start;
    max-width: 100%;

    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.cpig-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    margin: 0 auto;

    width: 100px;
    height: 100px;
    object-fit: cover;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.cpig-thumbnail:hover {
    transform: scale(1.05);
    border-color: #10a37f;
}

#cpig-canvas {
    display: none;
    border: 2px solid #3a3a3a;
    border-radius: 10px;
    margin-top: 20px;
    background-color: #1c1c1c;
}

#cpig-loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#cpig-loading-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

#cpig-loading-logo img {
    width: 100px;
    height: 100px;
    animation: cpig-rotate 2s linear infinite;
}

@keyframes cpig-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media only screen and (max-width: 768px) {
    #cpig-container {
        padding: 10px;
        border-radius: 5px;
    }

    #cpig-text {
        height: 80px;
        padding: 10px;
        font-size: 14px;
    }

    #cpig-generate {
        width: 150px;
        height: 40px;
        font-size: 14px;
    }

    #cpig-generate img {
        width: 20px;
        height: 20px;
    }

    #cpig-loading-logo img {
        width: 70px;
        height: 70px;
    }
}

.cpig-thumbnail-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.cpig-enlarge-button {
    margin-top: 10px;
    background-color: #10a37f;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease;
}

.cpig-enlarge-button:hover {
    background-color: #0c8a66;
}

.cpig-thumbnail-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}
.cpig-enlarge-button {
    margin-top: 5px;
    background-color: #10a37f;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease;
    display: block;
}
.cpig-enlarge-button:hover {
    background-color: #0c8a66;
}

/* Modal container */
#cpig-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

/* Modal content */
#cpig-modal-content {
    position: relative;
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Modal image */
#cpig-modal-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
}

/* Close button */
#cpig-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff0000;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    line-height: 30px;
}

#cpig-modal-close:hover {
    background: #cc0000;
}

/* Estilos para el contenedor de imágenes generadas */
#cpig-generated-images-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
}

.cpig-thumbnail-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 120px;
    padding: 10px;
    border-radius: 5px;
}

.cpig-thumbnail {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    margin-bottom: 10px;
}

.cpig-enlarge-button {
    margin-top: 5px;
    background-color: #10a37f;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease;
}

.cpig-enlarge-button:hover {
    background-color: #0c8a66;
}

@keyframes cpig-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.woocommerce-product-gallery__image {
    position: relative;
}
.cpig-overlay-image {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 90px;
    height: 90px;
    z-index: 10;
}


#cpig-enhance-style {
    margin-top: 10px; 
    width: 100%; 
    border-radius: 5px; 
    background-color: #2b2b2b; 
    color: white; 
    border: 1px solid rgb(16, 163, 127); 
    font-size: 14px; 
    max-height: 150px; /* Limita el espacio visible del desplegable */
    overflow-y: auto;  /* Activa el scroll para las opciones restantes */
    box-sizing: border-box; /* Asegura que los padding no desborden el tamaño */
}

#cpig-enhance-style option {
    padding: 10px; 
    background-color: #2b2b2b; 
    color: white;
    border: none;
}

/* Estilo del scroll */
#cpig-enhance-style::-webkit-scrollbar {
    width: 8px;
}
#cpig-enhance-style::-webkit-scrollbar-thumb {
    background-color: rgb(16, 163, 127);
    border-radius: 5px;
}
#cpig-enhance-style::-webkit-scrollbar-track {
    background: transparent;
}

/* Contenedor general para los botones de formato */
.format-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

/* Estilo para la etiqueta */
.format-label {
    color: #fff;
    font-weight: bold;
    margin: 0;
}

/* Botones generales */
.format-button {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 5px;
    background-color: transparent;
    border: 2px solid rgb(16, 163, 127);
    transition: all 0.3s ease; /* Transición suave */
}

.format-button span {
    font-size: 12px;
    font-weight: bold;
    color: #007BFF;
}

/* Botón cuadrado */
.format-button.square {
    width: 50px;
    height: 50px;
}

/* Botón alargado */
.format-button.portrait {
    width: 30px;
    height: 50px;
}

/* Botón seleccionado */
.format-button.selected {
    background-color: #007BFF;
    color: #fff;
    border-color: #0056b3;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
}



#status-bar-label {
    font-size: 12px; /* Tamaño de la etiqueta */
    color: #ffffff; /* Color del texto */
    margin-bottom: 5px; /* Separación de la barra */
    text-align: center;
    font-weight: normal; /* Peso del texto */
}

#status-bar {
    width: 100%;
    height: 10px; /* Altura de 1 cm aproximadamente */
    background-color: #4CAF50; /* Verde por defecto */
    margin-top: 10px;
    border-radius: 5px;
    animation: none; /* Animación inicial desactivada */
}

.status-bar.green {
    background-color: #4CAF50!important; /* Verde: éxito */
}

.status-bar.red {
    background-color: #f44336!important; /* Rojo: error */
}

.status-bar.blue-flashing {
    background-color: #2196F3 !important; /* Azul parpadeante */
    animation: flash 1s infinite!important; /* Animación de parpadeo */
}

@keyframes flash {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

#design-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 1;
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

#design-popup img {
    max-width: 90%;
    max-height: 90%;
}

#design-popup button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: red;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
}


.woocommerce-cart-table .product-design {
    text-align: center;
    vertical-align: middle;
}

/* Ajustar la imagen de diseño */
.woocommerce-cart-table .product-design img {
    max-width: 100px;
    height: auto;
    display: inline-block;
    margin: 0 auto;
}

.cpig-overlay-image {
    height: 210px !important;
    width: auto;
    top: calc(30% + 50px) ; /* Desplazamiento de 1 cm hacia abajo */
    position: absolute !important;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

/* Viewport pequeño (móviles muy pequeños) */
@media (max-width: 480px) {
    .cpig-overlay-image {
        height: 115px !important;
        width: auto;
        top: calc(30% + 40px) !important;
    }
}

/* Móviles pequeños */
@media (max-width: 539px) and (min-width: 481px) {
    .cpig-overlay-image {
        height: 130px !important;
        width: auto;
    }
}

/* Móviles grandes */
@media (max-width: 768px) and (min-width: 577px) {
    .cpig-overlay-image {
        height: 205px !important;
        width: auto;
    }
}

/* Tablets pequeñas */
@media (max-width: 992px) and (min-width: 825px) {
    .cpig-overlay-image {
        height: 150px !important;
        width: auto;
    }
}

/* Tablets grandes */
@media (max-width: 1200px) and (min-width: 993px) {
    .cpig-overlay-image {
        height: 170px !important;
        width: auto;
    }
}

/* Portátiles pequeños */
@media (max-width: 1366px) and (min-width: 1201px) {
    .cpig-overlay-image {
        height: 190px !important;
        width: auto;
    }
}

/* Portátiles estándar */
@media (max-width: 1440px) and (min-width: 1367px) {
    .cpig-overlay-image {
        height: 190px !important;
        width: auto;
    }
}

/* Pantallas grandes */
@media (max-width: 1920px) and (min-width: 1441px) {
    .cpig-overlay-image {
        height: 190px !important;
        width: auto;
    }
}

