/**
 * WooCommerce — single product & product cards
 * Firre Contracter theme
 */

/* --------------------------------------------------------------------------
   Reset WooCommerce float layout (conflicts with Bootstrap grid)
   -------------------------------------------------------------------------- */
.firre-single-product div.product .woocommerce-product-gallery,
.firre-single-product div.product div.images,
.firre-single-product div.product div.summary,
.firre-single-product .firre-product__gallery {
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	margin: 0 !important;
	clear: none !important;
}

.firre-single-product div.product::before,
.firre-single-product div.product::after,
.firre-single-product ul.products::before,
.firre-single-product ul.products::after {
	display: none !important;
	content: none !important;
}

/* --------------------------------------------------------------------------
   Main shell & section spacing
   -------------------------------------------------------------------------- */
.firre-wc-main {
	background: var(--white);
}

.firre-product-main {
	padding-top: 40px;
	padding-bottom: 0;
}

.firre-product-tabs-wrap.sec-alt {
	margin-top: 56px;
}

.firre-related-wrap {
	margin-top: 56px;
	padding-top: 0;
	padding-bottom: 0;
}

/* .firre-related-products {
	margin-top: 0;
	margin-bottom: 0;
} */

.page-header--product {
	padding: 48px 0;
}

.page-header--product.h1,
.page-header--product h1,
.page-header--product .page-header__title {
	font-family: var(--font-heading);
	font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
	line-height: 1.25;
	font-weight: var(--font-700);
}

/* Tighten page-header bottom gap on product pages */
.firre-single-product .page-header--product.mb-40 {
	margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Notices
   -------------------------------------------------------------------------- */
.firre-single-product .woocommerce-notices-wrapper,
.firre-wc-main .woocommerce-notices-wrapper {
	margin-bottom: 24px;
}

.firre-single-product .woocommerce-message,
.firre-single-product .woocommerce-info,
.firre-single-product .woocommerce-error {
	border-radius: 10px;
	border: 1px solid var(--border-color);
	background: var(--surface-light);
	padding: 14px 18px;
	list-style: none;
	margin: 0 0 16px;
}

.firre-single-product .woocommerce-message {
	border-color: rgba(255, 180, 37, 0.45);
	background: var(--secondary-light);
}

.firre-single-product .woocommerce-error {
	border-color: rgba(244, 49, 48, 0.35);
	background: var(--primary-light);
}

.firre-single-product .woocommerce-message a,
.firre-single-product .woocommerce-info a {
	font-weight: var(--font-600);
}

/* --------------------------------------------------------------------------
   Summary stack spacing
   -------------------------------------------------------------------------- */
.firre-product__gallery {
	position: relative;
}

.firre-product__info {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.firre-product__info > * {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}

.firre-product__info .price {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 10px;
	font-family: var(--font-heading);
	font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.85rem);
	font-weight: var(--font-700);
	color: var(--text-color);
	line-height: 1.2;
}

.firre-product__info .price del {
	font-size: 0.65em;
	font-weight: var(--font-500);
	color: var(--text-muted);
	opacity: 0.85;
}

.firre-product__info .price ins {
	text-decoration: none;
	color: var(--primary-color);
}

.firre-product__info .woocommerce-product-rating {
	display: flex;
	align-items: center;
	gap: 10px;
}

.firre-product__info .star-rating {
	color: var(--secondary-color);
}

.firre-product__info .woocommerce-product-details__short-description p {
	margin-bottom: 0;
	font-size: 1.05rem;
}

.firre-product__info .stock {
	font-weight: var(--font-600);
	font-size: 0.95rem;
}

.firre-product__info .stock.in-stock {
	color: #1a7a3a;
}

.firre-product__info .stock.out-of-stock {
	color: var(--primary-color);
}

.firre-product__info .product_title {
	font-family: var(--font-heading);
	font-size: clamp(1.5rem, 1.25rem + 0.8vw, 2rem);
	font-weight: var(--font-700);
	line-height: 1.25;
	color: var(--text-color);
}

/* --------------------------------------------------------------------------
   Gallery
   -------------------------------------------------------------------------- */
.firre-product__gallery .woocommerce-product-gallery {
	position: relative;
	opacity: 1 !important;
	width: 100% !important;
	border: 1px solid var(--border-color);
	border-radius: 12px;
	overflow: hidden;
	background: var(--white);
}

.firre-product__gallery .woocommerce-product-gallery__wrapper {
	margin: 0;
}

.firre-product__gallery .woocommerce-product-gallery__image {
	border-radius: 12px;
	overflow: hidden;
}

.firre-product__gallery .woocommerce-product-gallery__image img,
.firre-product__gallery .wp-post-image {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: var(--surface-light);
}

.firre-product__gallery .flex-control-thumbs {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin: 12px 0 0;
	padding: 0 12px 12px;
	list-style: none;
}

.firre-product__gallery .flex-control-thumbs li {
	margin: 0;
	float: none !important;
	width: auto !important;
}

.firre-product__gallery .flex-control-thumbs img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
	border: 2px solid transparent;
	cursor: pointer;
	opacity: 0.7;
	transition: var(--transition);
}

.firre-product__gallery .flex-control-thumbs img:hover,
.firre-product__gallery .flex-control-thumbs img.flex-active {
	opacity: 1;
	border-color: var(--primary-color);
}

.firre-onsale,
.firre-product__gallery .onsale {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 5;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 64px;
	padding: 6px 14px;
	border-radius: 999px;
	background: var(--primary-color);
	color: var(--white);
	font-size: 13px;
	font-weight: var(--font-600);
	letter-spacing: 0.02em;
	text-transform: uppercase;
	line-height: 1.2;
}

/* --------------------------------------------------------------------------
   Quote CTA
   -------------------------------------------------------------------------- */
.firre-product-quote {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.firre-product-quote__note {
	font-size: 15px;
}

.firre-product-quote__actions .btn {
	min-height: 48px;
}

/* --------------------------------------------------------------------------
   Assurance + meta
   -------------------------------------------------------------------------- */
.firre-product-assurance {
	list-style: none;
	margin: 0;
	padding: 20px 0 0;
	border-top: 1px solid var(--border-color);
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.firre-product-assurance li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 15px;
	font-weight: var(--font-500);
	color: var(--text-color);
}

.firre-product-assurance__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--primary-light);
	color: var(--primary-color);
	flex-shrink: 0;
}

.firre-product-meta {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding-top: 20px;
	border-top: 1px solid var(--border-color);
	font-size: 14px;
}

.firre-product-meta__row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
}

.firre-product-meta__label {
	min-width: 88px;
	font-weight: var(--font-600);
	color: var(--text-color);
}

.firre-product-meta a {
	color: var(--text-muted);
}

.firre-product-meta a:hover {
	color: var(--primary-color);
}

/* --------------------------------------------------------------------------
   Product details (description) section — uses theme .sec-alt
   -------------------------------------------------------------------------- */
.firre-product-details {
	position: relative;
}

.firre-product-details .sec-h h2 {
	margin-bottom: 0;
}

.firre-product-details__body>h2:first-child {
	display: none;
}

.firre-product-details__body p {
	font-size: 1.0625rem;
	line-height: 1.8;
	color: var(--text-muted);
	margin-bottom: 1.15em;
}

.firre-product-details__body p:last-child {
	margin-bottom: 0;
}

.firre-product-details__body strong {
	color: var(--text-color);
	font-weight: var(--font-600);
}

.firre-product-details__body ul,
.firre-product-details__body ol {
	margin: 0 0 1.15em;
	padding-left: 1.25em;
	color: var(--text-muted);
	line-height: 1.8;
}

.firre-product-details__body li+li {
	margin-top: 0.4em;
}

.firre-product-details__body a {
	font-weight: var(--font-600);
}

.firre-product-details__body a:hover {
	color: var(--secondary-color);
}

/* Multi-tab fallback (description + additional info, etc.) */
.firre-product-tabs {
	margin: 0;
	border: 1px solid var(--border-color);
	border-radius: 14px;
	overflow: hidden;
	background: var(--white);
}

.firre-product-tabs ul.wc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	list-style: none;
	margin: 0;
	padding: 0 8px;
	border-bottom: 1px solid var(--border-color);
	background: var(--surface-light);
}

.firre-product-tabs ul.wc-tabs::before,
.firre-product-tabs ul.wc-tabs::after {
	display: none;
}

.firre-product-tabs ul.wc-tabs li {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	border-radius: 0;
	float: none !important;
}

.firre-product-tabs ul.wc-tabs li a {
	display: block;
	padding: 16px 20px;
	font-weight: var(--font-600);
	font-size: 15px;
	color: var(--text-muted);
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.firre-product-tabs ul.wc-tabs li a:hover {
	color: var(--text-color);
}

.firre-product-tabs ul.wc-tabs li.active a,
.firre-product-tabs ul.wc-tabs li.active a:hover {
	color: var(--primary-color);
	border-bottom-color: var(--primary-color);
	background: var(--white);
}

.firre-product-tabs .woocommerce-Tabs-panel {
	padding: 32px 36px;
	margin: 0;
	max-width: 820px;
}

.firre-product-tabs .woocommerce-Tabs-panel h2:first-child {
	display: none;
}

.firre-product-tabs .woocommerce-Tabs-panel p {
	font-size: 1.0625rem;
	line-height: 1.8;
	margin-bottom: 1.1em;
}

.firre-product-tabs .woocommerce-Tabs-panel p:last-child {
	margin-bottom: 0;
}

.firre-product-tabs table.shop_attributes,
.firre-product-details table.shop_attributes {
	width: 100%;
	border-collapse: collapse;
	margin-top: 8px;
}

.firre-product-tabs table.shop_attributes th,
.firre-product-tabs table.shop_attributes td,
.firre-product-details table.shop_attributes th,
.firre-product-details table.shop_attributes td {
	padding: 12px 14px;
	border: 1px solid var(--border-color);
	text-align: left;
	font-size: 15px;
}

.firre-product-tabs table.shop_attributes th,
.firre-product-details table.shop_attributes th {
	width: 35%;
	background: var(--surface-light);
	font-weight: var(--font-600);
	color: var(--text-color);
}

/* --------------------------------------------------------------------------
   Related products (homepage product-card)
   -------------------------------------------------------------------------- */
.firre-related-products .product-card {
	height: 100%;
}

/* Shop archive product grid */
.firre-wc-archive-content {
	padding-top: 40px;
	padding-bottom: 56px;
}

.firre-wc-archive-toolbar {
	width: 100%;
}

.firre-wc-archive-toolbar .woocommerce-result-count {
	margin: 0;
	color: var(--text-muted);
	font-size: 15px;
}

.firre-wc-archive-toolbar .woocommerce-ordering {
	margin: 0;
}

.firre-wc-archive-toolbar .woocommerce-ordering select {
	min-width: 220px;
	height: 46px;
	padding: 0 40px 0 14px;
	border: 1px solid var(--border-color);
	border-radius: 10px;
	background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23222222' d='M1.41 0L6 4.58 10.59 0 12 1.41l-6 6-6-6z'/%3E%3C/svg%3E") no-repeat right 14px center;
	appearance: none;
	font-size: 15px;
	color: var(--text-color);
	cursor: pointer;
}

.firre-wc-archive-pagination {
	margin-top: 40px;
}

.firre-wc-archive-pagination .woocommerce-pagination {
	margin: 0;
}

.firre-wc-archive-pagination .woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
	border: 0;
}

.firre-wc-archive-pagination .woocommerce-pagination ul li {
	margin: 0;
	border: 0;
	overflow: visible;
}

.firre-wc-archive-pagination .woocommerce-pagination ul li a,
.firre-wc-archive-pagination .woocommerce-pagination ul li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border: 1px solid var(--border-color);
	border-radius: 999px;
	background: var(--white);
	color: var(--text-color);
	font-weight: var(--font-600);
	line-height: 1;
}

.firre-wc-archive-pagination .woocommerce-pagination ul li a:hover,
.firre-wc-archive-pagination .woocommerce-pagination ul li span.current {
	background: var(--primary-color);
	border-color: var(--primary-color);
	color: var(--white);
}

.firre-wc-archive-content .product-card,
.firre-related-products .product-card {
	height: 100%;
}

.firre-wc-archive-content .product-image img,
.firre-related-products .product-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.firre-wc-archive-content .product-card:hover .product-image img,
.firre-related-products .product-card:hover .product-image img {
	transform: scale(1.04);
}

@media (max-width: 767px) {
	.firre-wc-archive-content {
		padding-top: 28px;
		padding-bottom: 40px;
	}
}

@media (max-width: 767px) {
	.firre-product-main {
		padding-top: 28px;
	}

	.firre-product-tabs-wrap.sec-alt {
		margin-top: 40px;
	}

	.firre-product-tabs .woocommerce-Tabs-panel {
		padding: 22px 18px;
	}

	.firre-product-tabs ul.wc-tabs li a {
		padding: 14px 16px;
		font-size: 14px;
	}
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: no-preference) {

	.firre-product__gallery,
	.firre-product__info,
	.firre-product-tabs {
		animation: firre-product-fade-up 0.55s ease both;
	}

	.firre-product__info {
		animation-delay: 0.08s;
	}

	.firre-product-tabs {
		animation-delay: 0.14s;
	}

	.firre-wc-archive-content .product-card,
	.firre-related-products .product-card {
		transition: box-shadow 0.3s ease, transform 0.3s ease;
	}

	.firre-wc-archive-content .product-card:hover,
	.firre-related-products .product-card:hover {
		transform: translateY(-4px);
	}
}

@keyframes firre-product-fade-up {
	from {
		opacity: 0;
		transform: translateY(16px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}