/**
 * Shop Styler v2 — WooCommerce design layer
 * Every visual decision is driven by CSS custom properties injected from
 * the settings panel (WooCommerce > Shop Styler). Scoped to
 * .shop-styler-active so nothing leaks outside shop contexts.
 */

/* ---------------------------------------------------------------------------
   1. Product grid
--------------------------------------------------------------------------- */

.shop-styler-active .woocommerce ul.products,
.shop-styler-active ul.products {
	display: grid !important;
	grid-template-columns: repeat(var(--ss-cols, 4), minmax(0, 1fr));
	gap: var(--ss-gap, 24px);
	margin: 0 0 2.5em;
	padding: 0;
	list-style: none;
}

.shop-styler-active ul.products::before,
.shop-styler-active ul.products::after {
	display: none;
}

.shop-styler-active ul.products li.product {
	float: none !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	position: relative;
	background: var(--ss-card-bg);
	border: var(--ss-card-border);
	border-radius: var(--ss-radius);
	box-shadow: var(--ss-card-shadow);
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.shop-styler-active ul.products li.product:hover {
	transform: var(--ss-hover-lift);
	box-shadow: var(--ss-hover-shadow);
}

/* ---------------------------------------------------------------------------
   2. Product image + optional second-image crossfade
--------------------------------------------------------------------------- */

.shop-styler-active ul.products li.product .woocommerce-LoopProduct-link {
	display: block;
	position: relative;
	overflow: hidden;
	text-decoration: none;
}

.shop-styler-active ul.products li.product a img,
.shop-styler-active ul.products li.product .attachment-woocommerce_thumbnail {
	width: 100% !important;
	aspect-ratio: var(--ss-ratio, 1 / 1);
	object-fit: var(--ss-fit, cover);
	background: #fff;
	margin: 0 !important;
	display: block;
	transition: transform 0.4s ease, opacity 0.35s ease;
	border-radius: 0;
}

.shop-styler-active ul.products li.product:hover a img {
	transform: var(--ss-hover-zoom);
}

/* Second gallery image sits on top, revealed on hover */
.shop-styler-active ul.products li.product .ss-hover-image {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100%;
	aspect-ratio: var(--ss-ratio, 1 / 1);
	object-fit: var(--ss-fit, cover);
	opacity: 0;
	z-index: 2;
	pointer-events: none;
}

.shop-styler-active ul.products li.product:hover .ss-hover-image {
	opacity: 1;
}

/* ---------------------------------------------------------------------------
   3. Sale badge
--------------------------------------------------------------------------- */

.shop-styler-active ul.products li.product .onsale,
.shop-styler-active.ss-single .single-product span.onsale {
	position: absolute;
	top: 12px;
	left: 12px;
	right: auto;
	z-index: 3;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 5px 12px;
	background: var(--ss-sale);
	color: var(--ss-sale-text, #fff);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.4;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* ---------------------------------------------------------------------------
   4. Card body
--------------------------------------------------------------------------- */

.shop-styler-active ul.products li.product .ss-card-body {
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 4px;
	padding: 16px 16px 18px;
	text-align: var(--ss-align, left);
}

.ss-align-center ul.products li.product .ss-card-body {
	align-items: center;
}

.ss-card-minimal ul.products li.product .ss-card-body {
	padding: 14px 2px 4px;
}

.shop-styler-active ul.products li.product .ss-category {
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #6b7280;
	margin-bottom: 2px;
}

.shop-styler-active ul.products li.product .woocommerce-loop-product__title,
.shop-styler-active ul.products li.product h2 {
	font-size: var(--ss-title-size, 15px) !important;
	font-weight: var(--ss-title-weight, 600);
	line-height: 1.4;
	margin: 0;
	padding: 0 !important;
	color: var(--ss-title-color, #111827);
	text-transform: var(--ss-title-transform, none);
	letter-spacing: 0.005em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.shop-styler-active ul.products li.product .star-rating {
	margin: 2px 0;
	font-size: 12px;
	color: #f59e0b;
}

.ss-align-center ul.products li.product .star-rating {
	margin-left: auto;
	margin-right: auto;
}

.shop-styler-active ul.products li.product .price {
	margin: 4px 0 0 !important;
	font-size: var(--ss-price-size, 16px) !important;
	font-weight: 700;
	color: var(--ss-price-color) !important;
	display: flex;
	align-items: baseline;
	gap: 8px;
	flex-wrap: wrap;
}

.ss-align-center ul.products li.product .price {
	justify-content: center;
}

.shop-styler-active ul.products li.product .price del {
	font-size: 0.8em;
	font-weight: 400;
	color: #9ca3af;
	opacity: 1;
}

.shop-styler-active ul.products li.product .price ins {
	text-decoration: none;
	font-weight: 700;
	background: none;
}

/* ---------------------------------------------------------------------------
   5. Loop buttons
--------------------------------------------------------------------------- */

.shop-styler-active ul.products li.product .button,
.shop-styler-active ul.products li.product .add_to_cart_button,
.shop-styler-active ul.products li.product a.button {
	margin-top: auto;
	align-self: stretch;
	text-align: center;
	padding: 11px 18px;
	background: var(--ss-btn-bg) !important;
	color: var(--ss-btn-color) !important;
	border: var(--ss-btn-border);
	border-radius: var(--ss-btn-radius);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.03em;
	line-height: 1.2;
	text-transform: none;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.shop-styler-active ul.products li.product .button:hover {
	background: var(--ss-accent-hover) !important;
	border-color: var(--ss-accent-hover);
	color: #fff !important;
}

.shop-styler-active ul.products li.product .button:active {
	transform: scale(0.98);
}

.shop-styler-active ul.products li.product .ss-card-body .button {
	margin-top: 12px;
}

.shop-styler-active ul.products li.product .added_to_cart {
	margin-top: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ss-accent);
	text-align: center;
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
   6. Shop toolbar
--------------------------------------------------------------------------- */

.shop-styler-active .woocommerce-result-count {
	font-size: 13px;
	color: #6b7280;
	margin: 6px 0 24px;
}

.shop-styler-active .woocommerce-ordering {
	margin: 0 0 24px;
}

.shop-styler-active .woocommerce-ordering select {
	padding: 9px 36px 9px 14px;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	background-color: #fff;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	appearance: none;
	-webkit-appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7280' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	cursor: pointer;
}

.shop-styler-active .woocommerce-ordering select:focus {
	outline: 2px solid var(--ss-accent);
	outline-offset: 1px;
	border-color: var(--ss-accent);
}

/* ---------------------------------------------------------------------------
   7. Pagination
--------------------------------------------------------------------------- */

.shop-styler-active .woocommerce-pagination {
	margin-top: 12px;
}

.shop-styler-active .woocommerce-pagination ul.page-numbers {
	display: flex;
	justify-content: center;
	gap: 6px;
	border: none;
	margin: 0;
}

.shop-styler-active .woocommerce-pagination ul.page-numbers li {
	border: none;
	margin: 0;
}

.shop-styler-active .woocommerce-pagination ul.page-numbers li .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	text-decoration: none;
	transition: all 0.15s ease;
}

.shop-styler-active .woocommerce-pagination ul.page-numbers li .page-numbers:hover {
	border-color: var(--ss-accent);
	color: var(--ss-accent);
	background: #fff;
}

.shop-styler-active .woocommerce-pagination ul.page-numbers li .page-numbers.current {
	background: var(--ss-accent);
	border-color: var(--ss-accent);
	color: #fff;
}

/* ---------------------------------------------------------------------------
   8. Notices
--------------------------------------------------------------------------- */

.shop-styler-active .woocommerce-message,
.shop-styler-active .woocommerce-info {
	border-top: none;
	border-left: 4px solid var(--ss-accent);
	background: #f8fafc;
	border-radius: 8px;
	padding: 16px 20px 16px 52px;
	font-size: 14px;
	color: #1f2937;
}

.shop-styler-active .woocommerce-message::before,
.shop-styler-active .woocommerce-info::before {
	color: var(--ss-accent);
}

.shop-styler-active .woocommerce-message .button,
.shop-styler-active .woocommerce-info .button {
	background: var(--ss-accent);
	color: #fff;
	border-radius: 8px;
	font-weight: 600;
}

/* ---------------------------------------------------------------------------
   9. Single product (body.ss-single)
--------------------------------------------------------------------------- */

.ss-single .single-product div.product .product_title {
	font-size: var(--ss-sp-title-size, 32px);
	color: var(--ss-sp-title-color);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
}

.ss-single .single-product div.product p.price,
.ss-single .single-product div.product span.price {
	color: var(--ss-sp-price-color);
	font-size: var(--ss-sp-price-size, 26px);
	font-weight: 700;
	margin: 10px 0 18px;
}

.ss-single .single-product div.product p.price del {
	font-size: 0.65em;
	font-weight: 400;
	color: #9ca3af;
	opacity: 1;
}

.ss-single .single-product div.product p.price ins {
	text-decoration: none;
	background: none;
}

.ss-single .single-product div.product .woocommerce-product-details__short-description {
	font-size: var(--ss-sp-desc-size, 15px);
	line-height: 1.7;
	color: var(--ss-text, #374151);
}

.ss-single .single-product div.product form.cart {
	display: flex;
	align-items: stretch;
	gap: 10px;
	flex-wrap: wrap;
	margin: 20px 0 16px;
}

.ss-single .single-product div.product form.cart div.quantity .qty {
	height: 100%;
	min-height: 48px;
	width: 74px;
	border: 1px solid #d1d5db;
	border-radius: var(--ss-btn-radius);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
}

.ss-single .single-product div.product form.cart .single_add_to_cart_button,
.ss-single .single-product div.product .button {
	padding: 14px 32px;
	background: var(--ss-btn-bg);
	color: var(--ss-btn-color);
	border: var(--ss-btn-border);
	border-radius: var(--ss-btn-radius);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.02em;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ss-single .single-product div.product form.cart .single_add_to_cart_button:hover,
.ss-single .single-product div.product .button:hover {
	background: var(--ss-accent-hover);
	border-color: var(--ss-accent-hover);
	color: #fff;
}

/* Variable product table */
.ss-single .single-product div.product form.cart table.variations {
	width: 100%;
	margin-bottom: 8px;
}

.ss-single .single-product div.product form.cart table.variations select {
	padding: 10px 14px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 14px;
}

/* Trust text */
.ss-single .ss-trust-text {
	margin: 4px 0 18px;
	font-size: 13.5px;
	line-height: 1.7;
	color: var(--ss-text, #374151);
}

.ss-single .ss-trust-text p {
	margin: 0 0 4px;
}

/* Gallery */
.ss-single .single-product div.product .woocommerce-product-gallery img {
	border-radius: var(--ss-sp-gallery-r, 12px);
}

.ss-single .single-product div.product .woocommerce-product-gallery .flex-control-thumbs {
	display: flex;
	gap: 8px;
	margin-top: 10px;
	padding: 0;
}

.ss-single .single-product div.product .woocommerce-product-gallery .flex-control-thumbs li {
	width: auto;
	flex: 0 0 calc(25% - 6px);
	margin: 0;
	float: none;
}

.ss-single .single-product div.product .woocommerce-product-gallery .flex-control-thumbs img {
	border-radius: calc(var(--ss-sp-gallery-r, 12px) * 0.6);
	border: 2px solid transparent;
	opacity: 0.7;
	transition: opacity 0.15s ease, border-color 0.15s ease;
}

.ss-single .single-product div.product .woocommerce-product-gallery .flex-control-thumbs img.flex-active,
.ss-single .single-product div.product .woocommerce-product-gallery .flex-control-thumbs img:hover {
	opacity: 1;
	border-color: var(--ss-accent);
}

/* Meta row */
.ss-single .product_meta {
	font-size: 13px;
	color: #6b7280;
	border-top: 1px solid #e5e7eb;
	padding-top: 14px;
	margin-top: 6px;
}

.ss-single .product_meta a {
	color: var(--ss-accent);
	text-decoration: none;
}

/* --- Tabs: underline variant (default) --- */
.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs {
	padding: 0;
	margin: 0 0 24px;
	border-bottom: 1px solid #e5e7eb;
	display: flex;
	gap: 4px;
	background: none;
}

.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs::before,
.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs::after,
.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs li::before,
.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: none;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 12px 18px;
	font-size: 14px;
	font-weight: 600;
	color: #6b7280;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.ss-tabs-underline .single-product .woocommerce-tabs ul.tabs li.active a {
	color: var(--ss-accent);
	border-bottom-color: var(--ss-accent);
}

/* --- Tabs: pills variant --- */
.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs {
	padding: 0;
	margin: 0 0 24px;
	border: none;
	display: flex;
	gap: 8px;
	background: none;
}

.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs::before,
.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs::after,
.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs li::before,
.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs li::after {
	display: none;
}

.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs li {
	background: transparent;
	border: none;
	border-radius: 0;
	margin: 0;
	padding: 0;
}

.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs li a {
	display: block;
	padding: 10px 20px;
	font-size: 13.5px;
	font-weight: 600;
	color: #374151;
	background: #f3f4f6;
	border-radius: 999px;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.ss-tabs-pills .single-product .woocommerce-tabs ul.tabs li.active a {
	background: var(--ss-accent);
	color: #fff;
}

/* Section headings */
.ss-single .single-product section.related > h2,
.ss-single .single-product section.upsells > h2,
.ss-single .single-product .woocommerce-tabs .panel > h2:first-of-type {
	font-size: 1.35em;
	font-weight: 700;
	color: var(--ss-heading);
	margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
   9b. Appeal features — savings, badges, stock, breadcrumb
--------------------------------------------------------------------------- */

/* Savings callout */
.ss-single .ss-savings-callout {
	display: inline-block;
	margin: -8px 0 16px;
	padding: 5px 12px;
	background: color-mix(in srgb, var(--ss-sale) 12%, transparent);
	color: var(--ss-sale);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.01em;
	border-radius: 6px;
}

/* Trust badge row */
.ss-single .ss-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 22px;
	margin: 18px 0 8px;
	padding: 16px 0 0;
	border-top: 1px solid #e5e7eb;
}

.ss-single .ss-badge {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--ss-text, #374151);
}

.ss-single .ss-badge__icon {
	display: inline-flex;
	width: 20px;
	height: 20px;
	color: var(--ss-accent);
	flex-shrink: 0;
}

.ss-single .ss-badge__icon svg {
	width: 100%;
	height: 100%;
}

/* Stock labels */
.ss-stock .single-product div.product .stock {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 5px 12px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 14px;
}

.ss-stock .single-product div.product .stock::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.ss-stock .single-product div.product .stock.in-stock {
	background: #ecfdf5;
	color: #059669;
}

.ss-stock .single-product div.product .stock.out-of-stock {
	background: #fef2f2;
	color: #dc2626;
}

/* Low-stock ("Only X left") gets an amber urgency treatment */
.ss-stock .single-product div.product .stock.available-on-backorder,
.ss-stock .single-product div.product p.stock.in-stock:not(:empty)[class*="left"] {
	background: #fffbeb;
	color: #d97706;
}

.ss-stock-pulse .single-product div.product .stock.in-stock::before {
	animation: ss-pulse 1.6s ease-in-out infinite;
}

@keyframes ss-pulse {
	0%, 100% { transform: scale(1); opacity: 1; }
	50% { transform: scale(1.5); opacity: 0.5; }
}

/* Breadcrumb */
.ss-breadcrumb .woocommerce-breadcrumb {
	font-size: 12.5px;
	color: #9ca3af;
	margin-bottom: 22px;
	letter-spacing: 0.01em;
}

.ss-breadcrumb .woocommerce-breadcrumb a {
	color: #6b7280;
	text-decoration: none;
	transition: color 0.15s ease;
}

.ss-breadcrumb .woocommerce-breadcrumb a:hover {
	color: var(--ss-accent);
}

/* Empty state */
.shop-styler-active .shop-styler-empty {
	font-size: 15px;
}

/* ---------------------------------------------------------------------------
   10. Sticky add-to-cart bar
--------------------------------------------------------------------------- */

.ss-sticky-atc {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
	transform: translateY(110%);
	transition: transform 0.3s ease;
	padding-bottom: env(safe-area-inset-bottom, 0);
}

.ss-sticky-atc.is-visible {
	transform: translateY(0);
}

.ss-sticky-atc__inner {
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 1080px;
	margin: 0 auto;
	padding: 10px 16px;
}

.ss-sticky-atc__img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
}

.ss-sticky-atc__meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
}

.ss-sticky-atc__title {
	font-size: 14px;
	font-weight: 600;
	color: var(--ss-heading, #111827);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ss-sticky-atc__price {
	font-size: 13px;
	font-weight: 700;
	color: var(--ss-accent);
}

.ss-sticky-atc__price del {
	font-weight: 400;
	color: #9ca3af;
	margin-right: 6px;
}

.ss-sticky-atc__price ins {
	text-decoration: none;
	background: none;
}

.ss-sticky-atc__button {
	flex-shrink: 0;
	padding: 12px 26px;
	background: var(--ss-btn-bg);
	color: var(--ss-btn-color);
	border: var(--ss-btn-border);
	border-radius: var(--ss-btn-radius);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.ss-sticky-atc__button:hover {
	background: var(--ss-accent-hover);
	color: #fff;
}

/* ---------------------------------------------------------------------------
   11. Responsive — uses configured tablet/mobile column counts
--------------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.shop-styler-active ul.products {
		grid-template-columns: repeat(var(--ss-cols-tablet, 3), minmax(0, 1fr)) !important;
	}
}

@media (max-width: 640px) {
	.shop-styler-active ul.products {
		grid-template-columns: repeat(var(--ss-cols-mobile, 2), minmax(0, 1fr)) !important;
		gap: calc(var(--ss-gap, 24px) * 0.6);
	}

	.shop-styler-active ul.products li.product .ss-card-body {
		padding: 12px 12px 14px;
	}

	.ss-single .single-product div.product .product_title {
		font-size: calc(var(--ss-sp-title-size, 32px) * 0.75);
	}

	.ss-single .single-product div.product p.price {
		font-size: calc(var(--ss-sp-price-size, 26px) * 0.85);
	}
}

/* ---------------------------------------------------------------------------
   12. Accessibility
--------------------------------------------------------------------------- */

.shop-styler-active ul.products li.product a:focus-visible,
.shop-styler-active ul.products li.product .button:focus-visible,
.ss-sticky-atc__button:focus-visible {
	outline: 2px solid var(--ss-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.shop-styler-active ul.products li.product,
	.shop-styler-active ul.products li.product a img,
	.shop-styler-active ul.products li.product .ss-hover-image,
	.shop-styler-active ul.products li.product .button,
	.ss-sticky-atc {
		transition: none !important;
	}

	.shop-styler-active ul.products li.product:hover {
		transform: none;
	}

	.shop-styler-active ul.products li.product:hover a img {
		transform: none;
	}

	.ss-stock-pulse .single-product div.product .stock.in-stock::before {
		animation: none !important;
	}
}
