/** ADMIN **/
.oec-variation-gallery-wrap {
    margin: 10px 0;
    display: inline-block;
    vertical-align: top;
}

.oec-variation-gallery-field {
    margin: 0;
    padding: 0;
}

.oec-gallery-images-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    max-width: 400px;
}

.oec-product-variation-gallery-single-image-wrapper {
    position: relative;
    width: 64px;
    height: 64px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.oec-product-variation-gallery-single-image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.oec-remove-gallery-item {
    position: absolute;
    top: 2px; /* Move inside the wrapper */
    right: 2px; /* Move inside the wrapper */
    width: 16px;
    height: 16px;
    background: #fff;
    color: #999;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    text-indent: 0;
    font-family: Dashicons;
    text-decoration: none;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
    z-index: 100; /* Ensure it’s above the image */
}

.oec-remove-gallery-item:before {
    content: "\f153"; /* Dashicon 'X' */
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    line-height: 16px;
}

.oec-remove-gallery-item:hover {
    color: #ff0000;
}

.oec-variation-gallery-button {
    margin-top: 5px;
    vertical-align: top;
}

.ui-sortable-placeholder {
    width: 64px;
    height: 64px;
    background: #f0f0f0;
    border: 1px dashed #ccc;
    visibility: visible !important;
}

.woocommerce_variable_attributes .upload_image {
    display: inline-block;
    vertical-align: top;
    margin-right: 20px;
}

/** FRONTEND (unchanged) **/
.woocommerce-product-gallery__image img {
    width: 100%;
    height: auto !important;
    object-fit: contain;
}

.flex-viewport {
    max-height: 600px !important;
    overflow: hidden !important;
}

.flexslider .slides img {
    max-height: 600px;
    width: auto !important;
    margin: 0 auto;
}

.woocommerce-product-gallery .flexslider {
    max-width: 100%;
    margin: 0 auto;
}