.product-images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.product-image-item {
    position: relative;
    aspect-ratio: 1;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-image-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.product-image-item[draggable="true"] {
    cursor: move;
}

.product-image-item[draggable="true"]:hover {
    opacity: 0.8;
}

.product-image-item.drag-over {
    background-color: #e7f3ff;
    border: 2px dashed #0066cc;
}

.image-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    flex-direction: column;
    gap: 0.5rem;
}

.product-image-item:hover .image-overlay {
    opacity: 1;
}

.image-order {
    color: white;
    font-size: 0.875rem;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.drag-hint {
    color: white;
    font-size: 1.25rem;
    opacity: 0.7;
}

.btn-delete-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    opacity: 0;
}

.product-image-item:hover .btn-delete-image {
    opacity: 1;
}

.btn-delete-image:hover {
    background: rgba(220, 53, 69, 1);
}

.btn-delete-image:active {
    transform: scale(0.95);
}

.image-upload-area {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border: 2px dashed #ccc;
    border-radius: 8px;
    transition: border-color 0.2s, background-color 0.2s;
}

.image-upload-area.drag-over {
    border-color: #0066cc;
    background: #e7f3ff;
}

.upload-image-box {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px dashed #ccc;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
    min-height: 120px;
}

.upload-image-box:hover {
    border-color: #0066cc;
    background: #e7f3ff;
}

.upload-image-box.drag-over {
    border-color: #0066cc;
    background: #d0e7f6;
    border-width: 2px;
}

.upload-icon {
    text-align: center;
}

.upload-icon svg {
    width: 32px;
    height: 32px;
    margin-bottom: 0.5rem;
    color: #666;
}

.upload-icon p {
    margin: 0;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

.upload-icon small {
    display: block;
    color: #999;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.image-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin: 1rem 0;
    font-size: 0.875rem;
    color: #666;
}

.image-count {
    font-weight: 600;
}

.image-limit-warning {
    color: #dc3545;
    font-weight: 600;
}

.image-limit-info {
    color: #28a745;
}

.upload-image-box.loading {
    opacity: 0.6;
    pointer-events: none;
}

.upload-progress {
    width: 100%;
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0066cc, #0052a3);
    width: 0%;
    transition: width 0.3s;
}

@media (max-width: 768px) {
    .product-images-container,
    .image-upload-area {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .upload-image-box {
        min-height: 100px;
    }

    .upload-icon svg {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .product-images-container,
    .image-upload-area {
        grid-template-columns: repeat(2, 1fr);
    }

    .image-stats {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
