/* ============================================================
   WOOCOMMERCE OVERRIDES — Fabrique du Valais
   ============================================================ */

/* Archive header */
.wc-archive-header {
	margin-bottom: 32px;
}

.wc-archive-title {
	font-size: 2.2rem;
	margin-bottom: 8px;
}

.wc-archive-description {
	color: var(--color-text-light);
	margin-bottom: 0;
}

/* Products bar (sort + count) */
.wc-products-bar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 32px;
	padding: 16px 0;
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
	flex-wrap: wrap;
	gap: 12px;
}

.woocommerce-ordering select {
	padding: 8px 32px 8px 12px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-white);
	font-family: var(--font-body);
	font-size: 0.85rem;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232D2D2D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
}

.woocommerce-result-count {
	font-size: 0.85rem;
	color: var(--color-text-light);
	margin: 0;
}

/* Products grid */
.products {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Product card */
.fdv-product-card {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
	transition: all var(--transition);
}

.fdv-product-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-lg);
}

.fdv-product-link {
	display: block;
	text-decoration: none;
	color: var(--color-text);
}

.fdv-product-thumb {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: var(--color-bg-warm);
}

.fdv-product-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.fdv-product-card:hover .fdv-product-thumb img {
	transform: scale(1.05);
}

.fdv-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 4px 12px;
	border-radius: 50px;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	z-index: 2;
}

.fdv-badge-sale {
	background: var(--color-red);
	color: var(--color-white);
}

.fdv-badge-soldout {
	background: var(--color-bg-dark);
	color: var(--color-white);
}

.fdv-product-info {
	padding: 20px;
}

.fdv-product-title {
	font-family: var(--font-heading);
	font-size: 1rem;
	font-weight: 600;
	margin-bottom: 4px;
	color: var(--color-bg-dark);
}

.fdv-product-desc {
	font-size: 0.85rem;
	color: var(--color-text-light);
	margin-bottom: 12px;
	line-height: 1.4;
}

.fdv-product-price {
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--color-red);
}

.fdv-product-price del {
	font-weight: 400;
	font-size: 0.85rem;
	color: var(--color-text-light);
	margin-right: 8px;
}

.fdv-product-price ins {
	text-decoration: none;
}

/* Single product */
.fdv-product-single {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	margin-top: 32px;
}

.fdv-product-gallery {
	position: sticky;
	top: 24px;
	align-self: start;
}

.woocommerce-product-gallery {
	border-radius: var(--radius);
	overflow: hidden;
	border: 1px solid var(--color-border);
}

.flex-viewport { border-radius: var(--radius-sm); }

.flex-control-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}

.flex-control-thumbs li {
	width: 80px !important;
	border-radius: var(--radius-sm);
	overflow: hidden;
	border: 2px solid transparent;
	transition: border-color var(--transition);
	cursor: pointer;
}

.flex-control-thumbs li.flex-active {
	border-color: var(--color-red);
}

.fdv-product-summary {
	padding-top: 16px;
}

.fdv-product-summary .product_title {
	font-size: 2rem;
	margin-bottom: 12px;
}

.fdv-product-summary .woocommerce-product-rating {
	margin-bottom: 16px;
}

.star-rating {
	color: var(--color-red);
	font-size: 0.9rem;
}

.fdv-product-summary .price {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--color-red);
	margin-bottom: 20px;
}

.fdv-product-summary .price del {
	font-weight: 400;
	font-size: 1rem;
	color: var(--color-text-light);
	margin-right: 8px;
}

.fdv-product-summary .price ins {
	text-decoration: none;
}

.fdv-product-summary .woocommerce-product-details__short-description {
	margin-bottom: 24px;
	color: var(--color-text-light);
	line-height: 1.7;
}

.cart .quantity {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	overflow: hidden;
}

.cart .quantity input {
	width: 60px;
	padding: 10px;
	border: none;
	text-align: center;
	font-family: var(--font-body);
	font-size: 1rem;
	background: transparent;
}

.single_add_to_cart_button {
	padding: 14px 36px !important;
	font-size: 1rem !important;
}

.product_meta {
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid var(--color-border);
	font-size: 0.85rem;
	color: var(--color-text-light);
}

.product_meta span {
	display: block;
	margin-bottom: 4px;
}

.product_meta a {
	color: var(--color-text);
}

/* Tabs */
.woocommerce-tabs {
	margin-top: 64px;
	grid-column: 1 / -1;
}

.wc-tabs-wrapper {
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
}

.wc-tabs {
	display: flex;
	border-bottom: 1px solid var(--color-border);
	background: var(--color-bg);
	margin: 0;
	padding: 0;
	list-style: none;
}

.wc-tabs li {
	margin: 0;
}

.wc-tabs li a {
	display: block;
	padding: 16px 28px;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--color-text-light);
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: all var(--transition);
}

.wc-tabs li.active a {
	color: var(--color-red);
	border-bottom-color: var(--color-red);
}

.wc-tabs li a:hover {
	color: var(--color-red);
}

.woocommerce-Tabs-panel {
	padding: 32px;
}

.woocommerce-Tabs-panel h2 {
	font-size: 1.3rem;
	margin-bottom: 16px;
}

/* Related products */
.related.products {
	margin-top: 64px;
	grid-column: 1 / -1;
}

.related.products h2 {
	font-size: 1.5rem;
	margin-bottom: 24px;
}

/* Cart */
.fdv-cart-wrap {
	display: grid;
	grid-template-columns: 1fr 380px;
	gap: 32px;
	align-items: start;
}

.cart-collaterals {
	margin-top: 0;
}

.shop_table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	overflow: hidden;
}

.shop_table th {
	background: var(--color-bg);
	padding: 16px;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	text-align: left;
}

.shop_table td {
	padding: 16px;
	border-top: 1px solid var(--color-border);
	vertical-align: middle;
}

.shop_table .product-thumbnail img {
	width: 80px;
	height: 80px;
	object-fit: cover;
	border-radius: var(--radius-sm);
}

.cart_totals {
	background: var(--color-white);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 24px;
}

.cart_totals h2 {
	font-size: 1.2rem;
	margin-bottom: 16px;
}

.cart_totals table {
	width: 100%;
}

.cart_totals th,
.cart_totals td {
	padding: 12px 0;
	border-bottom: 1px solid var(--color-border);
	font-size: 0.9rem;
}

.cart_totals .order-total th,
.cart_totals .order-total td {
	font-size: 1.1rem;
	font-weight: 700;
	color: var(--color-red);
}

.wc-proceed-to-checkout {
	margin-top: 16px;
}

.wc-proceed-to-checkout .checkout-button {
	display: block;
	text-align: center;
	padding: 14px;
	background: var(--color-red);
	color: var(--color-white);
	border-radius: 50px;
	font-weight: 600;
	text-decoration: none;
	transition: all var(--transition);
}

.wc-proceed-to-checkout .checkout-button:hover {
	background: var(--color-red-dark);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(218,41,28,0.3);
	color: var(--color-white);
}

/* Checkout */
.fdv-checkout-wrap {
	display: grid;
	grid-template-columns: 1fr 400px;
	gap: 40px;
	align-items: start;
	margin-top: 32px;
}

#customer_details {
	display: grid;
	gap: 24px;
}

.form-row {
	margin-bottom: 16px;
}

.form-row label {
	display: block;
	font-size: 0.85rem;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--color-bg-dark);
}

.form-row input,
.form-row textarea,
.form-row select {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	font-family: var(--font-body);
	font-size: 0.95rem;
	transition: border-color var(--transition);
	background: var(--color-white);
}

.form-row input:focus,
.form-row textarea:focus {
	outline: none;
	border-color: var(--color-red);
	box-shadow: 0 0 0 3px rgba(218,41,28,0.08);
}

#order_review_heading {
	font-size: 1.3rem;
	margin-bottom: 16px;
}

.woocommerce-checkout-review-order .shop_table {
	margin-bottom: 24px;
}

.woocommerce-checkout-payment {
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: var(--radius);
	padding: 24px;
}

.payment_methods {
	margin: 0;
	padding: 0;
	list-style: none;
}

.payment_methods li {
	padding: 12px 0;
	border-bottom: 1px solid var(--color-border);
}

.payment_methods li:last-child { border-bottom: none; }

.payment_methods label {
	font-weight: 600;
	margin-left: 8px;
}

.place-order {
	margin-top: 16px;
}

.place-order .button {
	width: 100%;
	padding: 16px;
	font-size: 1.05rem;
	font-weight: 600;
	background: var(--color-red);
	color: var(--color-white);
	border: none;
	border-radius: 50px;
	cursor: pointer;
	transition: all var(--transition);
}

.place-order .button:hover {
	background: var(--color-red-dark);
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(218,41,28,0.3);
}

/* ============================================================
   RESPONSIVE: WOOCOMMERCE
   ============================================================ */

@media (max-width: 1024px) {
	.fdv-cart-wrap {
		grid-template-columns: 1fr;
	}
	.fdv-checkout-wrap {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.products {
		grid-template-columns: repeat(2, 1fr);
		gap: 16px;
	}

	.fdv-product-single {
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.fdv-product-gallery {
		position: static;
	}

	.wc-tabs {
		flex-direction: column;
	}

	.wc-tabs li a {
		border-bottom: none;
		border-left: 2px solid transparent;
		margin-bottom: 0;
	}

	.wc-tabs li.active a {
		border-left-color: var(--color-red);
		border-bottom-color: transparent;
	}

	.woocommerce-Tabs-panel {
		padding: 20px;
	}

	.shop_table th {
		display: none;
	}

	.shop_table td {
		display: block;
		text-align: right;
		padding: 12px;
	}

	.shop_table td::before {
		content: attr(data-title) ': ';
		font-weight: 600;
		float: left;
	}

	.shop_table .product-thumbnail {
		text-align: center;
	}

	.shop_table .product-thumbnail::before {
		display: none;
	}

	.fdv-cart-wrap {
		grid-template-columns: 1fr;
	}

	.fdv-checkout-wrap {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.products {
		grid-template-columns: 1fr;
	}
}
