/**
 * TopTex Product Card Styles
 *
 * @package GeneratePressChild
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

.toptex-product {
	--toptex-primary: #1a1a1a;
	--toptex-secondary: #666666;
	--toptex-accent: #0066cc;
	--toptex-border: #e0e0e0;
	--toptex-bg-light: #f8f9fa;
	--toptex-success: #28a745;
	--toptex-spacing-xs: 0.25rem;
	--toptex-spacing-sm: 0.5rem;
	--toptex-spacing-md: 1rem;
	--toptex-spacing-lg: 1.5rem;
	--toptex-spacing-xl: 2rem;
	--toptex-radius: 8px;
	--toptex-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Base / Layout
   ========================================================================== */

.toptex-product {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--toptex-spacing-lg);
	font-family: inherit;
	color: var(--toptex-primary);
	line-height: 1.6;
}

.toptex-product__body {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--toptex-spacing-xl);
	margin-top: var(--toptex-spacing-lg);
}

@media (min-width: 768px) {
	.toptex-product__body {
		grid-template-columns: 1fr 1fr;
	}
}

/* ==========================================================================
   Header
   ========================================================================== */

.toptex-product__header {
	margin-bottom: var(--toptex-spacing-lg);
}

.toptex-product__title {
	margin: 0;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
}

@media (min-width: 768px) {
	.toptex-product__title {
		font-size: 2.25rem;
	}
}

.toptex-product__badge {
	display: inline-block;
	padding: var(--toptex-spacing-xs) var(--toptex-spacing-sm);
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	border-radius: 4px;
}

.toptex-product__badge--oeko {
	background: var(--toptex-success);
	color: #fff;
}

/* Quote Button */
.toptex-product__quote-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	column-gap: 1em;
	margin-top: 40px;
	padding: 16px 30px;
	background-color: var(--accent);
	color: var(--base-2);
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	text-transform: capitalize;
	border: none;
	border-radius: 3px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.toptex-product__quote-btn:hover {
	background-color: var(--contrast-3);
}

/* ==========================================================================
   Gallery
   ========================================================================== */

.toptex-product__gallery {
	position: sticky;
	top: var(--toptex-spacing-lg);
}

.toptex-product__main-image {
	margin-bottom: var(--toptex-spacing-md);
	border-radius: var(--toptex-radius);
	overflow: hidden;
	background: var(--toptex-bg-light);
}

.toptex-product__main-image img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
	aspect-ratio: 1;
}

.toptex-product__thumbnails {
	display: flex;
	flex-wrap: wrap;
	gap: var(--toptex-spacing-sm);
}

.toptex-product__thumbnail {
	flex: 0 0 auto;
	width: 60px;
	height: 60px;
	padding: 0;
	border: 2px solid var(--toptex-border);
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	background: var(--toptex-bg-light);
	transition: border-color 0.2s ease;
}

.toptex-product__thumbnail:hover,
.toptex-product__thumbnail--active {
	border-color: var(--toptex-accent);
}

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

/* ==========================================================================
   Content
   ========================================================================== */

.toptex-product__content {
	display: flex;
	flex-direction: column;
	gap: var(--toptex-spacing-xl);
}

.toptex-product__section-title {
	margin: 0 0 var(--toptex-spacing-md);
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--toptex-primary);
}

/* Description */
.toptex-product__description-text {
	color: var(--toptex-secondary);
}

.toptex-product__description-text p {
	margin: 0 0 var(--toptex-spacing-md);
}

.toptex-product__description-text p:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Specifications
   ========================================================================== */

.toptex-product__specs-list {
	margin: 0;
	padding: 0;
}

.toptex-product__spec {
	display: flex;
	padding: var(--toptex-spacing-sm) 0;
	border-bottom: 1px solid var(--toptex-border);
}

.toptex-product__spec:last-child {
	border-bottom: none;
}

.toptex-product__spec dt {
	flex: 0 0 40%;
	font-weight: 500;
	color: var(--toptex-primary);
}

.toptex-product__spec dd {
	flex: 1;
	margin: 0;
	color: var(--toptex-secondary);
}

.toptex-product__spec dd .toptex-product__badge {
	vertical-align: middle;
}

/* ==========================================================================
   Pricing Table
   ========================================================================== */

.toptex-product__pricing {
	background: var(--toptex-bg-light);
	padding: var(--toptex-spacing-lg);
	border-radius: var(--toptex-radius);
}

.toptex-product__price-table {
	width: 100%;
	border-collapse: collapse;
}

.toptex-product__price-table th,
.toptex-product__price-table td {
	padding: var(--toptex-spacing-sm) var(--toptex-spacing-md);
	text-align: left;
}

.toptex-product__price-table thead {
	background: var(--toptex-primary);
	color: #fff;
}

.toptex-product__price-table thead th {
	font-weight: 600;
}

.toptex-product__price-table thead th:first-child {
	border-radius: 4px 0 0 4px;
}

.toptex-product__price-table thead th:last-child {
	border-radius: 0 4px 4px 0;
}

.toptex-product__price-table tbody tr {
	border-bottom: 1px solid var(--toptex-border);
}

.toptex-product__price-table tbody tr:last-child {
	border-bottom: none;
}

.toptex-product__price-table tbody tr:nth-child(even) {
	background: rgba(0, 0, 0, 0.02);
}

.toptex-product__price-table td:last-child {
	font-weight: 600;
	color: var(--toptex-accent);
}

/* ==========================================================================
   Variations (Colors & Sizes)
   ========================================================================== */

.toptex-product__colors {
	display: flex;
	flex-wrap: wrap;
	gap: var(--toptex-spacing-md);
}

.toptex-product__color {
	display: flex;
	align-items: center;
	gap: var(--toptex-spacing-sm);
	padding: var(--toptex-spacing-sm) var(--toptex-spacing-md);
	background: var(--toptex-bg-light);
	border-radius: var(--toptex-radius);
	cursor: default;
}

.toptex-product__color-swatch {
	display: inline-block;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px var(--toptex-border);
}

.toptex-product__color-swatch--small {
	width: 16px;
	height: 16px;
}

.toptex-product__color-name {
	font-size: 0.875rem;
	color: var(--toptex-secondary);
}

/* Sizes */
.toptex-product__size-list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--toptex-spacing-sm);
}

.toptex-product__size {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 36px;
	padding: 0 var(--toptex-spacing-sm);
	font-size: 0.875rem;
	font-weight: 500;
	background: var(--toptex-bg-light);
	border: 1px solid var(--toptex-border);
	border-radius: 4px;
}

/* ==========================================================================
   Packshots (Images by Color)
   ========================================================================== */

.toptex-product__packshots {
	margin-top: var(--toptex-spacing-xl);
	padding-top: var(--toptex-spacing-xl);
	border-top: 1px solid var(--toptex-border);
}

.toptex-product__packshots-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: var(--toptex-spacing-lg);
}

.toptex-product__packshot-group {
	background: var(--toptex-bg-light);
	padding: var(--toptex-spacing-md);
	border-radius: var(--toptex-radius);
}

.toptex-product__packshot-color {
	display: flex;
	align-items: center;
	gap: var(--toptex-spacing-sm);
	margin: 0 0 var(--toptex-spacing-md);
	font-size: 0.875rem;
	font-weight: 600;
}

.toptex-product__packshot-images {
	display: flex;
	flex-wrap: wrap;
	gap: var(--toptex-spacing-sm);
}

.toptex-product__packshot-image {
	position: relative;
	flex: 0 0 auto;
	width: 70px;
	height: 70px;
	padding: 0;
	border: 2px solid var(--toptex-border);
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	background: #fff;
	transition: border-color 0.2s ease, transform 0.2s ease;
}

.toptex-product__packshot-image:hover {
	border-color: var(--toptex-accent);
	transform: scale(1.05);
}

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

.toptex-product__packshot-view {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 2px;
	font-size: 0.625rem;
	text-align: center;
	text-transform: uppercase;
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 767px) {
	.toptex-product {
		padding: var(--toptex-spacing-md);
	}

	.toptex-product__gallery {
		position: static;
	}

	.toptex-product__spec {
		flex-direction: column;
		gap: var(--toptex-spacing-xs);
	}

	.toptex-product__spec dt {
		flex: none;
	}

	.toptex-product__price-table th,
	.toptex-product__price-table td {
		padding: var(--toptex-spacing-sm);
		font-size: 0.875rem;
	}

	.toptex-product__packshots-grid {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.toptex-product {
		padding: 0;
	}

	.toptex-product__thumbnail,
	.toptex-product__packshot-image {
		cursor: default;
	}

	.toptex-product__packshot-image:hover {
		transform: none;
	}
}
