.pic-customizer-wrapper {
    background: #fff;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    margin: 12px 0;
    clear: both;
}

.pic-customizer-wrapper h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #333;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
}

.pic-description {
    color: #666;
    font-size: 12px;
    margin-bottom: 8px;
    line-height: 1.4;
}

.pic-upload-section {
    margin-bottom: 10px;
    padding: 0;
    background: transparent;
    border: none;
}

.pic-upload-section label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#pic-file-input {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: #fff;
    width: 100%;
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

#pic-file-input:hover {
    border-color: #0073aa;
}

#pic-file-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

#pic-controls-container {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e0e0e0;
}

.pic-controls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.pic-control-group {
    background: transparent;
    padding: 5px 0;
    border: none;
}

.pic-control-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 3px;
}

.pic-control-group label {
    font-weight: 600;
    color: #555;
    font-size: 12px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pic-control-group input[type="range"] {
    width: 100%;
    cursor: pointer;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    margin: 0;
}

.pic-control-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 10px;
    height: 10px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pic-control-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #005a87;
    transform: scale(1.1);
}

.pic-control-group input[type="range"]::-moz-range-thumb {
    width: 10px;
    height: 10px;
    background: #0073aa;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.pic-button-group {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

#pic-reset-btn {
    background: #f9f9f9;
    color: #666;
    border: 1px solid #ddd;
    padding: 7px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 80px;
}

#pic-reset-btn:hover {
    background: #e0e0e0;
    border-color: #ccc;
}

#pic-finalize-btn {
    background: #46b450;
    color: #fff;
    border: none;
    padding: 7px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
    flex: 2;
    min-width: 120px;
}

#pic-finalize-btn:hover {
    background: #3d9e45;
}

#pic-finalize-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.pic-remove-button {
    background: #d63638 !important; /* Solid Red */
    color: #fff !important;
    border: none !important;
    padding: 7px 14px !important;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 80px;
}

.pic-remove-button:hover {
    background: #b32d2e !important;
    color: #fff !important;
}

#pic-finalize-message {
    margin-top: 10px;
}

.pic-success-message {
    background: #d4edda;
    border: 1px solid #46b450;
    color: #155724;
    padding: 8px 12px;
    border-radius: 3px;
    font-size: 12px;
    margin: 0;
    animation: slideDown 0.3s ease;
}

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

#pic-canvas-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    pointer-events: none !important;
    z-index: 999 !important;
    display: none;
}

#pic-overlay-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.woocommerce-product-gallery,
.woocommerce-product-gallery__wrapper,
.woocommerce-product-gallery__image,
.product-images,
.product-image,
.images {
    position: relative !important;
}

.pic-zoom-window {
    position: fixed;
    width: 350px;
    height: 350px;
    border: 2px solid #ccc;
    border-radius: 6px;
    overflow: hidden;
    pointer-events: none;
    z-index: 999999; /* Increased z-index */
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.25);
    display: none;
}

.pic-zoom-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #fff;
}

.pic-cart-image-wrapper {
    margin: 5px 0;
}

.pic-cart-thumbnail {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pic-cart-thumbnail:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.woocommerce-cart-form__cart-item .pic-order-customization {
    margin-top: 6px;
}

.pic-order-customization {
    margin-top: 8px;
    padding: 8px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
}

.pic-order-customization strong {
    color: #333;
    font-size: 13px;
}

.pic-order-customization img {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pic-order-customization img:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.pic-order-images-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.pic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.pic-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

.pic-modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    margin: 5vh auto;
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0,0,0,0.5);
    animation: modalZoomIn 0.3s ease;
}

@keyframes modalZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.pic-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.6);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.2s ease;
}

.pic-modal-close:hover {
    background: rgba(220,50,50,0.9);
    transform: rotate(90deg);
}

#pic-modal-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 85vh;
    object-fit: contain;
}

.pic-modal-caption {
    background: #fff;
    padding: 10px 15px;
    text-align: center;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    border-top: 2px solid #e0e0e0;
}

#pic-controls-container > p {
    margin: 0;
    padding: 15px;
    text-align: center;
    color: #0073aa;
    font-weight: 600;
}

.woocommerce-cart-form__cart-item .product-thumbnail img {
    border-radius: 3px;
}

.woocommerce-order-details .pic-order-customization {
    margin-top: 10px;
    background: #fff;
    padding: 10px;
    border: 1px solid #e0e0e0;
}

.pic-clickable-image {
    cursor: pointer;
}

@media (max-width: 768px) {
    .pic-customizer-wrapper {
        padding: 12px;
    }

    .pic-customizer-wrapper h3 {
        font-size: 14px;
    }

    .pic-controls-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .pic-button-group {
        flex-direction: column;
        width: 100%;
    }

    #pic-reset-btn,
    #pic-finalize-btn,
    .pic-remove-button {
        width: 100% !important;
        min-width: 0;
        text-align: center;
    }

    .pic-upload-section {
        padding: 0;
    }

    .pic-modal-content {
        width: 95%;
        margin: 2.5vh auto;
    }

    .pic-modal-close {
        font-size: 26px;
        width: 35px;
        height: 35px;
        line-height: 35px;
        top: 8px;
        right: 8px;
    }

    .pic-zoom-window {
        width: 280px;
        height: 280px;
    }
}

@media (max-width: 480px) {
    .pic-customizer-wrapper {
        padding: 10px;
        margin: 12px 0;
    }

    .pic-customizer-wrapper h3 {
        font-size: 13px;
    }

    .pic-control-group {
        padding: 6px;
    }

    .pic-control-header {
        font-size: 11px;
    }

    .pic-zoom-window {
        width: 240px;
        height: 240px;
    }
}

#pic-controls-container {
    animation: fadeIn 0.3s ease-in;
}

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

.pic-clickable-image:active {
    transform: scale(0.98);
}

html.pic-modal-open {
    overflow: hidden;
}

@media print {
    .pic-modal,
    .pic-zoom-window {
        display: none !important;
    }
}