/* Prestige Fabric Addon — frontend styles
 *
 * The theme's existing fabric swatch CSS hides labels behind hover tooltips,
 * which only works when fabrics have visible images. We use our own markup
 * so the fabric NAME is always visible, image or no image.
 */

/* Container ────────────────────────────────────────────────────────────── */
.pfa-swatches-wrap {
	margin: 0;
}

.pfa-swatches-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 12px;
}

@media (max-width: 600px) {
	.pfa-swatches-list {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
		gap: 8px;
	}
}

.pfa-swatch-item {
	margin: 0;
	padding: 0;
}

/* Swatch button ────────────────────────────────────────────────────────── */
.pfa-swatch {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	padding: 0;
	margin: 0;
	background: #fff;
	border: 2px solid #e5e7eb;
	border-radius: 6px;
	cursor: pointer;
	overflow: hidden;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	font: inherit;
	color: inherit;
	text-align: left;
	position: relative;
}

.pfa-swatch:hover {
	border-color: #c7cdd5;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.pfa-swatch:focus-visible {
	outline: none;
	border-color: #1a1f2e;
	box-shadow: 0 0 0 3px rgba(26, 31, 46, 0.15);
}

.pfa-swatch.is-selected {
	border-color: #1a1f2e;
}

/* Selected check mark ─────────────────────────────────────────────────── */
.pfa-swatch.is-selected::before {
	content: "";
	position: absolute;
	top: 6px;
	right: 6px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #1a1f2e;
	z-index: 2;
}

.pfa-swatch.is-selected::after {
	content: "✓";
	position: absolute;
	top: 6px;
	right: 6px;
	width: 22px;
	height: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	z-index: 3;
}

/* Image area ───────────────────────────────────────────────────────────── */
.pfa-swatch-img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: #f3f4f6;
}

/* Placeholder pattern when no image is uploaded yet — soft diagonal stripes
 * so it reads as "intentionally empty" rather than broken. */
.pfa-swatch-img-placeholder {
	background-color: #f3f4f6;
	background-image: repeating-linear-gradient(
		45deg,
		transparent,
		transparent 8px,
		rgba(0, 0, 0, 0.04) 8px,
		rgba(0, 0, 0, 0.04) 16px
	);
	position: relative;
}

.pfa-swatch-img-placeholder::after {
	content: "No image";
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #9ca3af;
	font-size: 11px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

/* Label area ───────────────────────────────────────────────────────────── */
.pfa-swatch-label {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 8px 10px;
	background: #fff;
	border-top: 1px solid #f1f3f5;
}

.pfa-swatch-name {
	font-size: 13px;
	font-weight: 500;
	color: #1a1f2e;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pfa-swatch-price {
	font-size: 12px;
	color: #6b7280;
	font-weight: 600;
}

/* Header host kept hidden until JS moves the inner element. */
.pfa-accordion-header-host {
	display: none !important;
}

/* Cart / checkout fabric meta display ─────────────────────────────────── */
.pfa-cart-fabric {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.pfa-cart-fabric-thumb {
	width: 28px;
	height: 28px;
	object-fit: cover;
	border-radius: 3px;
	border: 1px solid #e5e7eb;
	flex: 0 0 auto;
}


/* Mini-cart fabric display ───────────────────────────────────────────── */
.pfa-minicart-fabric {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	font-size: 12px;
	color: #6b7280;
	font-weight: normal;
	line-height: 1.3;
}

.pfa-minicart-fabric-thumb {
	width: 20px;
	height: 20px;
	object-fit: cover;
	border-radius: 2px;
	border: 1px solid #e5e7eb;
	flex: 0 0 auto;
}

