/**
 * Rosha Supply — Shop, category archives, and Single Product. WooCommerce's
 * own default stylesheet is dequeued (see inc/woocommerce.php); this file
 * is the complete replacement, built on the same design tokens as the rest
 * of the site.
 */

.rosha-shop, .rosha-single-product,
.rosha-shop *, .rosha-single-product * {
	box-sizing: border-box;
}
.rosha-shop, .rosha-single-product {
	background: var(--rosha-bg);
	color: var(--rosha-text);
	font-family: var(--rosha-font-body);
}

/* ---------------------------------------------------------------- */
/* Breadcrumb                                                         */
/* ---------------------------------------------------------------- */
.rosha-breadcrumb {
	display: block;
	padding-top: 28px;
	font-size: var(--rosha-text-meta);
	color: var(--rosha-text-muted);
}
.rosha-breadcrumb a { color: var(--rosha-text-muted); text-decoration: none; }
.rosha-breadcrumb a:hover { color: var(--rosha-gold-light); }
.rosha-breadcrumb-sep { color: var(--rosha-text-muted); opacity: .6; }

/* ---------------------------------------------------------------- */
/* Shop head                                                          */
/* ---------------------------------------------------------------- */
.rosha-shop-head { padding-top: 6px; padding-bottom: 26px; }
.rosha-shop-title {
	font-family: var(--rosha-font-display);
	font-size: var(--rosha-text-h1);
	font-weight: 700;
	margin: 10px 0 12px;
	text-wrap: balance;
}
.rosha-shop-description { color: var(--rosha-text-muted); max-width: 74ch; line-height: 1.8; }
.rosha-shop-description p { margin: 0 0 8px; }

/* WooCommerce's woocommerce_shop_loop_header (category subcats/description) */
.woocommerce-products-header__title { font-family: var(--rosha-font-display); font-size: var(--rosha-text-h1); font-weight: 700; margin: 10px 0 12px; }
.term-description { color: var(--rosha-text-muted); max-width: 74ch; line-height: 1.8; }

/* ---------------------------------------------------------------- */
/* Layout: sidebar + main                                             */
/* ---------------------------------------------------------------- */
.rosha-shop-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 32px;
	padding-bottom: var(--rosha-section-space);
	align-items: start;
}
@media (max-width: 960px) {
	.rosha-shop-layout { grid-template-columns: 1fr; }
}

.rosha-shop-sidebar {
	background: var(--rosha-surface);
	border: 1px solid var(--rosha-border);
	border-radius: var(--rosha-radius-lg);
	padding: 20px;
	position: sticky;
	top: 90px;
}
.rosha-shop-sidebar-head { display: none; }

.rosha-filter-widget { border-bottom: 1px solid var(--rosha-border); padding-bottom: 18px; margin-bottom: 18px; }
.rosha-filter-widget:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.rosha-filter-widget-title { font-size: var(--rosha-text-small); font-weight: 700; margin: 0 0 12px; }
.rosha-filter-widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rosha-filter-widget a { color: var(--rosha-text-muted); text-decoration: none; font-size: var(--rosha-text-small); }
.rosha-filter-widget a:hover { color: var(--rosha-turquoise-light); }
.rosha-filter-widget .chosen a, .rosha-filter-widget .chosen { color: var(--rosha-gold-light); font-weight: 600; }

/* WooCommerce price filter widget */
.price_slider { margin-bottom: 14px; }
.price_slider_amount { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--rosha-text-muted); }
.price_slider_amount .button {
	background: var(--rosha-gold); color: var(--rosha-bg); border: none; border-radius: var(--rosha-radius-sm);
	padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.ui-slider { position: relative; height: 4px; background: var(--rosha-border); border-radius: 2px; margin: 10px 4px 18px; }
.ui-slider .ui-slider-range { position: absolute; height: 100%; background: var(--rosha-gold); border-radius: 2px; }
.ui-slider-handle {
	position: absolute; top: 50%; width: 15px; height: 15px; margin-top: -8px; margin-inline-start: -8px;
	background: var(--rosha-gold-light); border: 2px solid var(--rosha-bg); border-radius: 50%; cursor: pointer;
}

/* ---------------------------------------------------------------- */
/* Mobile filter drawer                                               */
/* ---------------------------------------------------------------- */
.rosha-shop-filters-backdrop { display: none; }
.rosha-shop-filter-trigger {
	display: none;
	align-items: center;
	gap: 8px;
	padding: 10px 16px;
	border: 1px solid var(--rosha-border);
	border-radius: var(--rosha-radius);
	background: var(--rosha-surface);
	color: var(--rosha-text);
	font-size: var(--rosha-text-small);
	cursor: pointer;
}

@media (max-width: 960px) {
	.rosha-shop-filter-trigger { display: inline-flex; }
	.rosha-shop-sidebar-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-weight: 700; }
	.rosha-shop-filters-close { width: 32px; height: 32px; border: none; background: transparent; color: var(--rosha-text-muted); cursor: pointer; }
	.rosha-shop-sidebar {
		position: fixed;
		top: 0; bottom: 0;
		inset-inline-end: 0;
		width: min(86vw, 360px);
		border-radius: 0;
		z-index: 110;
		overflow-y: auto;
		transform: translateX(100%);
		transition: transform var(--rosha-speed-slow) var(--rosha-ease);
	}
	[dir="rtl"] .rosha-shop-sidebar { transform: translateX(-100%); }
	.rosha-shop-sidebar.is-open { transform: translateX(0); }
	.rosha-shop-filters-backdrop {
		display: block;
		position: fixed; inset: 0;
		background: var(--rosha-overlay);
		z-index: 105;
		opacity: 0; visibility: hidden;
		transition: opacity var(--rosha-speed-slow) var(--rosha-ease);
	}
	.rosha-shop-filters-backdrop.is-open { opacity: 1; visibility: visible; }
}

/* ---------------------------------------------------------------- */
/* Toolbar                                                            */
/* ---------------------------------------------------------------- */
.rosha-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	margin-bottom: 20px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--rosha-border);
}
.rosha-shop-toolbar-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-inline-start: auto; }
.woocommerce-result-count { color: var(--rosha-text-muted); font-size: var(--rosha-text-small); margin: 0; }
.woocommerce-ordering select {
	background: var(--rosha-surface);
	border: 1px solid var(--rosha-border);
	color: var(--rosha-text);
	border-radius: var(--rosha-radius-sm);
	padding: 8px 12px;
	font-size: var(--rosha-text-small);
	font-family: inherit;
}

/* ---------------------------------------------------------------- */
/* Product grid (loop) — cards reuse .rosha-product-card from rosha.css? */
/* ---------------------------------------------------------------- */
ul.products {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}
@media (max-width: 1280px) { ul.products { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { ul.products { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 400px)  { ul.products { grid-template-columns: 1fr; } }

.rosha-product-li { list-style: none; }

.rosha-shop-empty {
	grid-column: 1 / -1;
	text-align: center;
	padding: 64px 24px;
	background: var(--rosha-surface);
	border: 1px dashed var(--rosha-border-gold);
	border-radius: var(--rosha-radius-lg);
	color: var(--rosha-text-muted);
}

.rosha-shop-pagination { margin-top: 36px; }
.woocommerce-pagination ul.page-numbers { display: flex; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.woocommerce-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 38px; height: 38px; padding: 0 8px;
	border: 1px solid var(--rosha-border); border-radius: var(--rosha-radius-sm);
	color: var(--rosha-text-muted); text-decoration: none; font-size: var(--rosha-text-small);
}
.woocommerce-pagination .page-numbers.current { background: var(--rosha-gold); color: var(--rosha-bg); border-color: var(--rosha-gold); }
.woocommerce-pagination .page-numbers:hover:not(.current) { border-color: var(--rosha-border-gold); color: var(--rosha-gold-light); }

/* ---------------------------------------------------------------- */
/* Single product                                                     */
/* ---------------------------------------------------------------- */
.rosha-single-product-breadcrumb { padding-bottom: 6px; }

div[id^="product-"] {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	padding-block: 36px var(--rosha-section-space);
	align-items: start;
}
@media (max-width: 900px) { div[id^="product-"] { grid-template-columns: 1fr; gap: 24px; } }

/* Gallery — WooCommerce's native gallery/zoom/lightbox, restyled */
.woocommerce-product-gallery { position: relative; }
.woocommerce-product-gallery__wrapper { list-style: none; margin: 0; padding: 0; border-radius: var(--rosha-radius-lg); overflow: hidden; background: var(--rosha-surface); }
.woocommerce-product-gallery__image img { width: 100%; height: auto; aspect-ratio: 1/1; object-fit: cover; display: block; }
.woocommerce-product-gallery .flex-control-thumbs { list-style: none; display: flex; gap: 10px; margin: 12px 0 0; padding: 0; flex-wrap: wrap; }
.woocommerce-product-gallery .flex-control-thumbs li { width: 72px; }
.woocommerce-product-gallery .flex-control-thumbs img {
	width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: var(--rosha-radius-sm);
	border: 1.5px solid var(--rosha-border); cursor: pointer; opacity: .75;
}
.woocommerce-product-gallery .flex-control-thumbs img.flex-active, .woocommerce-product-gallery .flex-control-thumbs img:hover { opacity: 1; border-color: var(--rosha-gold); }
.rosha-product-gallery-placeholder {
	aspect-ratio: 1/1;
	border-radius: var(--rosha-radius-lg);
	overflow: hidden;
}
.rosha-product-gallery-universal img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.onsale {
	position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2;
	background: var(--rosha-turquoise); color: var(--rosha-bg);
	font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px;
}

/* Summary */
.rosha-single-brand { display: inline-block; color: var(--rosha-gold-light); font-weight: 600; font-size: var(--rosha-text-small); text-decoration: none; margin-bottom: 8px; }
.product_title { font-family: var(--rosha-font-display); font-size: var(--rosha-text-h1); font-weight: 700; margin: 0 0 12px; text-wrap: balance; }
.woocommerce-product-rating { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: var(--rosha-gold); font-size: var(--rosha-text-small); }
.woocommerce-review-link { color: var(--rosha-text-muted); }

p.price, span.price {
	font-size: var(--rosha-text-h2);
	font-weight: 700;
	color: var(--rosha-text);
	display: block;
	margin-bottom: 18px;
}
p.price ins, span.price ins { text-decoration: none; color: var(--rosha-turquoise); }
p.price del, span.price del { color: var(--rosha-text-muted); font-size: .65em; font-weight: 400; margin-inline-end: 8px; }

.woocommerce-product-details__short-description { color: var(--rosha-text-muted); line-height: 1.85; margin-bottom: 22px; }
.woocommerce-product-details__short-description p:last-child { margin-bottom: 0; }

.stock { display: inline-block; font-size: var(--rosha-text-small); font-weight: 600; margin-bottom: 16px; padding: 5px 12px; border-radius: 999px; }
.stock.in-stock { color: var(--rosha-turquoise); background: var(--rosha-border-turquoise); }
.stock.out-of-stock { color: var(--rosha-text-muted); background: var(--rosha-bg-secondary); }
.stock.available-limited { color: var(--rosha-gold); background: var(--rosha-border-gold); }

/* Add to cart form (simple + variable share this) */
form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 14px;
	margin-bottom: 20px;
}
.quantity { display: inline-flex; }
.quantity .qty {
	width: 76px; height: 46px;
	text-align: center;
	background: var(--rosha-surface);
	border: 1px solid var(--rosha-border);
	border-radius: var(--rosha-radius);
	color: var(--rosha-text);
	font-family: inherit;
	font-size: 1rem;
}
form.cart .single_add_to_cart_button,
form.cart .button {
	display: inline-flex; align-items: center; justify-content: center;
	height: 46px; padding-inline: 32px;
	background: var(--rosha-gold); color: var(--rosha-bg);
	border: none; border-radius: var(--rosha-radius);
	font-weight: 700; font-size: var(--rosha-text-button);
	cursor: pointer; text-decoration: none;
	transition: background var(--rosha-speed) var(--rosha-ease), transform var(--rosha-speed) var(--rosha-ease);
}
form.cart .single_add_to_cart_button:hover, form.cart .button:hover { background: var(--rosha-turquoise); color: var(--rosha-accent-contrast); transform: translateY(-1px); }
form.cart .single_add_to_cart_button.disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* Variation table */
table.variations { width: 100%; margin-bottom: 14px; border-collapse: collapse; }
table.variations tr { display: flex; flex-direction: column; margin-bottom: 12px; }
table.variations label { font-size: var(--rosha-text-small); font-weight: 600; margin-bottom: 6px; }
table.variations select {
	background: var(--rosha-surface); border: 1px solid var(--rosha-border); color: var(--rosha-text);
	border-radius: var(--rosha-radius); padding: 10px 14px; font-family: inherit; font-size: var(--rosha-text-small); max-width: 320px;
}
.woocommerce-variation-price .price { font-size: var(--rosha-text-h3); margin-bottom: 8px; }
.woocommerce-variation-availability { margin-bottom: 10px; }
a.reset_variations { display: inline-block; font-size: 12.5px; color: var(--rosha-text-muted); margin-inline-start: 8px; }

.product_meta { font-size: 12.5px; color: var(--rosha-text-muted); padding-top: 14px; border-top: 1px solid var(--rosha-border); }
.product_meta > span { display: block; margin-bottom: 4px; }
.product_meta a { color: var(--rosha-turquoise-light); text-decoration: none; }

/* Trust strip */
.rosha-single-trust {
	list-style: none; margin: 20px 0 0; padding: 16px 0 0;
	border-top: 1px solid var(--rosha-border);
	display: flex; flex-wrap: wrap; gap: 16px 24px;
}
.rosha-single-trust li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--rosha-text-muted); }
.rosha-single-trust svg { color: var(--rosha-gold); flex-shrink: 0; width: 18px; height: 18px; }

/* Tabs */
.woocommerce-tabs { grid-column: 1 / -1; margin-top: 20px; }
.woocommerce-tabs ul.tabs { list-style: none; display: flex; gap: 4px; margin: 0 0 24px; padding: 0; border-bottom: 1px solid var(--rosha-border); flex-wrap: wrap; }
.woocommerce-tabs ul.tabs li { margin: 0; }
.woocommerce-tabs ul.tabs li a {
	display: inline-block; padding: 12px 20px; color: var(--rosha-text-muted); text-decoration: none; font-size: var(--rosha-text-small); font-weight: 600;
	border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.woocommerce-tabs ul.tabs li.active a { color: var(--rosha-gold-light); border-bottom-color: var(--rosha-gold); }
.woocommerce-tabs .panel { color: var(--rosha-text-muted); line-height: 1.85; max-width: 74ch; }
.woocommerce-tabs .panel h2 { font-family: var(--rosha-font-display); font-size: var(--rosha-text-h3); color: var(--rosha-text); margin: 0 0 16px; }
.woocommerce-product-attributes { width: 100%; border-collapse: collapse; margin-top: 8px; }
.woocommerce-product-attributes th, .woocommerce-product-attributes td { text-align: start; padding: 10px 14px; border-bottom: 1px solid var(--rosha-border); font-size: var(--rosha-text-small); }
.woocommerce-product-attributes th { color: var(--rosha-text); font-weight: 600; width: 200px; }
.woocommerce-product-attributes td { color: var(--rosha-text-muted); }

/* Related / upsells — reuse the same product grid styling */
.related.products, .upsells.products {
	grid-column: 1 / -1;
	margin-top: var(--rosha-section-space);
	padding-top: var(--rosha-section-space);
	border-top: 1px solid var(--rosha-border);
}
.related.products > h2, .upsells.products > h2 {
	font-family: var(--rosha-font-display); font-size: var(--rosha-text-h2); font-weight: 700; margin: 0 0 24px;
}

/* Accordion conversion on mobile for tabs */
@media (max-width: 700px) {
	.woocommerce-tabs ul.tabs { display: none; }
	.woocommerce-tabs .panel { display: block !important; border-bottom: 1px solid var(--rosha-border); padding-bottom: 20px; margin-bottom: 20px; }
	.woocommerce-tabs .panel::before { content: attr(data-rosha-tab-label); display: block; font-family: var(--rosha-font-display); font-weight: 700; font-size: var(--rosha-text-h3); color: var(--rosha-text); margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
	.rosha-shop-sidebar, .rosha-shop-filters-backdrop { transition-duration: 0.01ms !important; }
}
