.product-gallery__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 0.5rem;
}

.product-gallery__tile {
	position: relative;
}

.product-gallery__thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border: 1px solid var(--bs-gray-200);
	border-radius: 0.5rem;
	background: var(--bs-gray-100);
}

.product-gallery__thumb img,
.product-gallery__thumb video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.product-gallery__thumb:hover img,
.product-gallery__thumb:hover video {
	transform: scale(1.05);
}

.product-gallery__thumb:focus-visible {
	outline: 2px solid var(--bs-primary);
	outline-offset: 2px;
}

.product-gallery__thumb.is-video::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.3);
}

.product-gallery__play {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 0.8125rem;
	transform: translate(-50%, -50%);
	transition: transform 0.15s ease;
}

.product-gallery__thumb:hover .product-gallery__play {
	transform: translate(-50%, -50%) scale(1.1);
}

.product-gallery__tile .product-gallery__actions {
	position: absolute;
	top: 0.25rem;
	right: 0.25rem;
	z-index: 2;
}

.product-gallery__tile .product-gallery__actions .custom-table-action-button {
	background: rgba(255, 255, 255, 0.85);
}

.product-gallery__documents {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	margin-bottom: 0;
}

.product-gallery__document {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.625rem 0.75rem;
	border: 1px solid var(--bs-gray-200);
	border-radius: 0.5rem;
}

.product-gallery__document-icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 0.5rem;
	background: var(--bs-gray-100);
	font-size: 1.05rem;
}

.product-gallery__confirm {
	min-width: 240px;
}

.product-gallery__upload {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.75rem 1rem;
	border: 1px dashed rgba(var(--bs-primary-rgb), 0.6);
	border-radius: 0.5rem;
	background: rgba(var(--bs-primary-rgb), 0.04);
	color: var(--bs-primary);
	font-size: 0.8125rem;
	font-weight: 500;
}

.product-gallery__upload:hover,
.product-gallery__upload:focus-visible {
	background: rgba(var(--bs-primary-rgb), 0.08);
}

.product-gallery__filepond .filepond--root {
	margin-bottom: 0;
}

.product-gallery__loading {
	position: absolute;
	inset: -0.5rem;
	z-index: 5;
	padding-top: 3rem;
	text-align: center;
	background-color: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.7);
	border-radius: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {

	.product-gallery__thumb img,
	.product-gallery__thumb video,
	.product-gallery__play {
		transition: none;
	}
}

body[data-style-mode="dark"] .product-gallery__thumb,
body[data-style-mode="dark"] .product-gallery__document {
	border-color: var(--bs-gray-700);
}

body[data-style-mode="dark"] .product-gallery__thumb,
body[data-style-mode="dark"] .product-gallery__document-icon {
	background: var(--bs-gray-800);
}

.product-gallery__dropzone {
	min-height: 12rem;
}

.product-gallery__dropzone>.chat-drag-overlay {
	position: absolute;
	inset: -0.5rem;
	z-index: 6;
	display: none;
	align-items: center;
	justify-content: center;
	border: 2px dashed rgba(var(--bs-primary-rgb), 0.65);
	border-radius: 0.75rem;
	background: rgba(var(--bs-body-bg-rgb, 255, 255, 255), 0.9);
	color: var(--bs-primary);
	pointer-events: none;
	backdrop-filter: blur(2px);
}

.product-gallery__dropzone .chat-drag-overlay-content {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 500;
}