/*
 * VRC Product Comparison Table — Styles
 * Plugin: vrc-product-comparison
 * Loaded only on WooCommerce single product pages.
 */

/* ─── Section wrapper ────────────────────────────────────────────────── */
.vrc-pct-section {
	margin-top: 3rem;
	margin-bottom: 2rem;
}

/* ─── Inner container ────────────────────────────────────────────────── */
.vrc-pct-inner {
	background-color: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	padding: 2rem 2rem 1.75rem;
}

/* ─── Section heading ────────────────────────────────────────────────── */
.vrc-pct-heading {
	font-size: 1.25rem;
	font-weight: 700;
	color: #111827;
	margin: 0 0 1.25rem 0;
	padding: 0;
	line-height: 1.4;
}

/* ─── Scrollable wrapper (horizontal scroll on small screens) ─────────── */
.vrc-pct-scroll-wrapper {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-radius: 6px;
	outline: none;
}

/* ─── Table base ─────────────────────────────────────────────────────── */
.vrc-pct-table {
	width: 100%;
	min-width: 560px; /* forces horizontal scroll before columns crush */
	border-collapse: collapse;
	font-size: 0.9rem;
	color: #374151;
	table-layout: auto;
}

/* ─── Header row ─────────────────────────────────────────────────────── */
.vrc-pct-table thead tr {
	background-color: #111827;
}

.vrc-pct-table thead th {
	padding: 0.65rem 1rem;
	text-align: left;
	font-size: 0.78rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #f9fafb;
	white-space: nowrap;
	border: none;
}

/* ─── Column widths & text wrapping ──────────────────────────────────── */
.vrc-pct-table th,
.vrc-pct-table td {
	white-space: normal;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.vrc-pct-col-name { min-width: 140px; max-width: 180px; }
.vrc-pct-col-gsm { max-width: 90px; }
.vrc-pct-col-composition { max-width: 180px; }
.vrc-pct-col-width { max-width: 100px; }
.vrc-pct-col-count { max-width: 100px; }

/* ─── Category & Composition Group Headers ───────────────────────────── */
.vrc-pct-table tbody tr.vrc-pct-header-row td {
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid #e5e7eb;
}

.vrc-pct-cat-row {
	background-color: #1f2937 !important;
	color: #ffffff;
}

.vrc-pct-cat-cell {
	font-size: 0.85rem;
	font-weight: 700;
	color: #ffffff;
	letter-spacing: 0.02em;
}

.vrc-pct-cat-label {
	text-transform: uppercase;
	font-size: 0.7rem;
	letter-spacing: 0.06em;
	color: #9ca3af;
	margin-right: 0.25rem;
}

.vrc-pct-comp-row {
	background-color: #e0e7ff !important;
	color: #1e1b4b;
}

.vrc-pct-comp-cell {
	font-size: 0.8rem;
	font-weight: 600;
	color: #3730a3;
}

.vrc-pct-comp-label {
	text-transform: uppercase;
	font-size: 0.68rem;
	letter-spacing: 0.05em;
	color: #4338ca;
	margin-right: 0.25rem;
}

/* ─── Body rows ──────────────────────────────────────────────────────── */
.vrc-pct-table tbody tr.vrc-pct-row {
	border-bottom: 1px solid #e5e7eb;
	transition: background-color 0.15s ease;
}

/* Alternating stripes */
.vrc-pct-table tbody tr.vrc-pct-row:nth-child(odd) {
	background-color: #ffffff;
}

.vrc-pct-table tbody tr.vrc-pct-row:nth-child(even) {
	background-color: #f3f4f6;
}

/* Hover highlight */
.vrc-pct-table tbody tr.vrc-pct-row:hover {
	background-color: #eff6ff;
}

/* ─── Current product row highlight ──────────────────────────────────── */
.vrc-pct-table tbody tr.vrc-pct-row--current {
	background-color: #fef9c3 !important; /* soft amber highlight */
}

.vrc-pct-table tbody tr.vrc-pct-row--current:hover {
	background-color: #fef08a !important;
}

/* ─── Table cells ────────────────────────────────────────────────────── */
.vrc-pct-table tbody td {
	padding: 0.6rem 0.75rem;
	vertical-align: middle;
	border: none;
}

/* ─── Product name link ───────────────────────────────────────────────── */
.vrc-pct-product-link {
	display: inline;
	color: #1d4ed8;
	font-weight: 600;
	text-decoration: none;
	transition: color 0.15s ease, text-decoration 0.15s ease;
	word-break: break-word;
}

.vrc-pct-product-link:hover,
.vrc-pct-product-link:focus {
	color: #1e40af;
	text-decoration: underline;
}

.vrc-pct-product-link:focus-visible {
	outline: 2px solid #3b82f6;
	outline-offset: 2px;
	border-radius: 2px;
}

/* ─── "Current" badge on the current product's name ─────────────────── */
.vrc-pct-current-badge {
	display: inline-block;
	font-size: 0.65rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #92400e;
	background-color: #fde68a;
	border: 1px solid #f59e0b;
	border-radius: 4px;
	padding: 0.05rem 0.35rem;
	line-height: 1.4;
	vertical-align: middle;
	margin-left: 0.25rem;
}

/* ─── Last row: no bottom border ─────────────────────────────────────── */
.vrc-pct-table tbody tr.vrc-pct-row:last-child {
	border-bottom: none;
}

/* ─── Mobile / Small Screen Responsiveness ───────────────────────────── */
@media (max-width: 768px) {
	.vrc-pct-table {
		font-size: 0.825rem;
	}

	.vrc-pct-table thead th {
		font-size: 0.725rem;
		padding: 0.5rem 0.6rem;
	}

	.vrc-pct-table tbody td {
		padding: 0.5rem 0.6rem;
	}

	.vrc-pct-col-name { max-width: 140px; }
	.vrc-pct-col-gsm { max-width: 70px; }
	.vrc-pct-col-composition { max-width: 140px; }
	.vrc-pct-col-width { max-width: 80px; }
	.vrc-pct-col-count { max-width: 80px; }
}

@media (max-width: 480px) {
	.vrc-pct-inner {
		padding: 1rem 0.75rem;
	}

	.vrc-pct-heading {
		font-size: 1.05rem;
		margin-bottom: 0.75rem;
	}

	.vrc-pct-table {
		font-size: 0.75rem;
	}

	.vrc-pct-table thead th {
		font-size: 0.675rem;
		padding: 0.4rem 0.5rem;
	}

	.vrc-pct-table tbody td {
		padding: 0.45rem 0.5rem;
	}

	.vrc-pct-current-badge {
		font-size: 0.6rem;
		padding: 0 0.25rem;
	}

	.vrc-pct-col-name { max-width: 120px; }
}

