/* Customizer Wrapper */
.wc-pc-custom-fields-wrapper {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #eaeaea;
}

.wc-pc-custom-fields-wrapper label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

/* Fabric Selector Preview */
.wc-pc-fabric-selector {
    margin-bottom: 20px;
}

.wc-pc-selected-preview {
    cursor: pointer;
    border: 2px dashed #ccc;
    padding: 15px;
    text-align: center;
    border-radius: 6px;
    transition: all 0.3s ease;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 80px;
}

.wc-pc-selected-preview:hover {
    border-color: #666;
    background: #fdfdfd;
}

.wc-pc-selected-preview img {
    max-width: 100px;
    max-height: 100px;
    border-radius: 4px;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.wc-pc-preview-text {
    font-size: 14px;
    color: #555;
    font-weight: 500;
}

.wc-pc-change-fabric {
    margin-top: 15px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #333;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s ease;
}

.wc-pc-change-fabric:hover {
    background: #333;
    color: #fff;
}

/* Mini Gallery UI */
.wc-pc-mini-gallery {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.wc-pc-mini-gallery:hover {
    border-color: #aaa;
}

.wc-pc-mini-thumb {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.wc-pc-mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wc-pc-mini-more {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-weight: 600;
    font-size: 14px;
    border: 1px dashed #ccc;
}

/* Name Input */
.wc-pc-name-input input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 15px;
    box-sizing: border-box;
}

/* Color Inputs */
.wc-pc-color-inputs {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.wc-pc-color-field {
    flex: 1;
}

.wc-pc-color-field label {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
    color: #555;
}

.wc-pc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wc-pc-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
}

.wc-pc-swatch:hover {
    transform: scale(1.1);
}

.wc-pc-swatch.selected {
    border-color: #333;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px #fff inset, 0 1px 3px rgba(0,0,0,0.3);
}

/* Modal Styles */
.wc-pc-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.wc-pc-modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 800px;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: wcPcModalSlideIn 0.3s ease-out;
}

@keyframes wcPcModalSlideIn {
    from { transform: translateY(-30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.wc-pc-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.wc-pc-close:hover,
.wc-pc-close:focus {
    color: #333;
    text-decoration: none;
    cursor: pointer;
}

.wc-pc-modal-content h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 24px;
    color: #222;
    text-align: center;
}

/* Gallery Grid */
.wc-pc-fabric-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 20px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.wc-pc-fabric-item {
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    transition: all 0.2s ease;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.wc-pc-fabric-item img {
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.wc-pc-fabric-item span {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
}

.wc-pc-fabric-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.wc-pc-fabric-item.selected {
    border-color: #000;
    background: #f0f0f0;
}

/* Live Preview Overlay Styles */
.wc-pc-live-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    mix-blend-mode: multiply;
    /* Ajuste de precisión a los márgenes de la mochila (25% a 75%) */
    clip-path: polygon(25% 60%, 75% 60%, 75% 86%, 25% 86%);
    z-index: 1;
}

.wc-pc-live-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    mix-blend-mode: multiply;
    /* Ajuste de precisión a los márgenes de la mochila (25% a 75%) */
    clip-path: polygon(25% 15%, 75% 15%, 75% 60%, 25% 60%);
    z-index: 2;
}

.wc-pc-live-overlay.active {
    opacity: 1;
}

/* Live Text Styles */
.wc-pc-live-text {
    position: absolute;
    /* Centrado en la nueva franja inferior (entre 60% y 85%) */
    top: 72%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Caveat', cursive;
    /* Texto más grande (incrementado un 20%) */
    font-size: 4.8rem;
    color: #fff;
    pointer-events: none;
    z-index: 3;
    width: 80%;
    text-align: center;
    /* Sombras para dar un poco de relieve realista al bordado */
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

@media (min-width: 768px) {
    .wc-pc-live-text {
        font-size: 3rem;
    }
}

/* Center Add to Cart Button */
.single-product div.product form.cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
}

.single-product div.product form.cart .button {
    margin-top: 15px;
    width: 100%;
    max-width: 300px;
    border-radius: 30px;
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 1px;
}

/* Make the title smaller and look better */
.single-product div.product .product_title {
    font-size: 28px !important;
    line-height: 1.2 !important;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Blend the product image white background into the page's beige background */
.woocommerce-product-gallery__image img,
.wc-pc-image-wrapper img {
    mix-blend-mode: multiply;
}

/* Center the customizer wrapper */
.wc-pc-custom-fields-wrapper {
    margin-bottom: 25px;
    padding: 25px;
    background: #ffffff;
    border-radius: 12px;
    border: none;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    text-align: center;
}

.wc-pc-custom-fields-wrapper label {
    display: block;
    margin-bottom: 12px;
    font-weight: 700;
    color: #222;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

/* Center Color inputs */
.wc-pc-color-inputs {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.wc-pc-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}
