/* WC Category Products v2.5.3 – Buyno compatible + performance */

.byno-page-layout {
	border-radius: 14px;
	margin: 18px 0;
	padding: 0;
	background: #FFF;
}

header.byno-page-header {
	padding: 20px 20px 10px;
}

.wccp-wrapper {
	--wccp-green: #88ad2f;
	--wccp-green-dark: #6f8f24;
	--wccp-text: #1e293b;
	--wccp-muted: #94a3b8;
	--wccp-border: #e2e8f0;
	--wccp-card: #ffffff;
	--wccp-radius: 18px;
	--wccp-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	--wccp-sticky-offset: 50px;
	font-family: inherit;
	color: var(--wccp-text);
	line-height: 1.5;
	direction: rtl;
	padding-bottom: 24px;
	position: relative;
	contain: layout style;
}

/* ========== Banner Slider ========== */
.wccp-slider-wrap {
	width: 100%;
	margin: 0 0 16px;
	border-radius: 16px;
	overflow: hidden;
	aspect-ratio: 1000 / 280;
	max-height: 240px;
	background: #e8eef3;
}

.wccp-banner-static,
.wccp-banner-swiper {
	width: 100%;
	height: 100%;
	border-radius: 16px;
	overflow: hidden;
}

.wccp-banner-picture {
	display: block;
	width: 100%;
	height: 100%;
}

.wccp-banner-img {
	display: block;
	width: 100%;
	height: 100%;
	max-height: 220px;
	object-fit: cover;
	object-position: center;
	content-visibility: auto;
}

@media (max-width: 768px) {
	.wccp-slider-wrap {
		aspect-ratio: 16 / 7;
		max-height: 160px;
	}
	.wccp-banner-img {
		max-height: 160px;
	}
}

@media (min-width: 1200px) {
	.wccp-slider-wrap {
		max-height: 240px;
	}
	.wccp-banner-img {
		max-height: 240px;
	}
}

.wccp-banner-pagination {
	bottom: 10px !important;
}

.wccp-banner-pagination .swiper-pagination-bullet {
	background: #fff;
	opacity: 0.6;
}

.wccp-banner-pagination .swiper-pagination-bullet-active {
	opacity: 1;
	background: var(--wccp-green);
}

/* ========== Tabs – sticky under fixed header, no jank ========== */
.wccp-tabs {
	position: sticky;
	top: var(--wccp-sticky-offset, 72px);
	z-index: 90;
	background: #f0f4f8;
	padding: 5px 0 !important;
	border-radius: 20px;
	/* GPU layer + isolation to stop mobile shake */
	transform: translate3d(0, 0, 0);
	-webkit-transform: translate3d(0, 0, 0);
	backface-visibility: hidden;
	-webkit-backface-visibility: hidden;
	will-change: transform;
	contain: layout style;
}

@media (max-width: 900px) {
	/* Mobile sticky header is 50px at top:0 — tabs flush underneath */
	.wccp-tabs {
		top: var(--wccp-sticky-offset, 50px);
		will-change: auto;
		z-index: 90; /* header is 99 */
	}
}

.wccp-tabs-scroll-wrap {
	position: relative;
	overflow: hidden;
}

.wccp-tabs-inner {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: thin;
	scrollbar-color: #cbd5e1 transparent;
	padding: 8px 16px 12px;
	/* avoid smooth scroll fighting page scroll on mobile */
	scroll-behavior: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	touch-action: pan-x;
}

.wccp-tabs-inner::-webkit-scrollbar { height: 4px; }
.wccp-tabs-inner::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.wccp-tabs-fade {
	position: absolute;
	top: 0;
	bottom: 8px;
	width: 28px;
	pointer-events: none;
	z-index: 2;
}
.wccp-tabs-fade-right { right: 0; background: linear-gradient(to left, #f0f4f8 20%, transparent); }
.wccp-tabs-fade-left { left: 0; background: linear-gradient(to right, #f0f4f8 20%, transparent); }

.wccp-tab {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	background: var(--wccp-card);
	border: 2px solid transparent;
	border-radius: 14px;
	padding: 10px 12px 8px;
	cursor: pointer;
	min-width: 78px;
	max-width: 96px;
	transition: border-color 0.12s;
	font-family: inherit;
	box-shadow: var(--wccp-shadow);
}
.wccp-tab:hover { border-color: color-mix(in srgb, var(--wccp-green) 40%, transparent); }
.wccp-tab.is-active {
	border-color: var(--wccp-green);
	background: #f4f9e8;
	box-shadow: 0 0 0 1px var(--wccp-green), var(--wccp-shadow);
}

.wccp-tab-img {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	overflow: hidden;
	background: #f8fafc;
	display: flex;
	align-items: center;
	justify-content: center;
}
.wccp-cat-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wccp-cat-placeholder { display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #e2e8f0, #f1f5f9); }

.wccp-tab-name {
	font-size: 11.5px;
	font-weight: 500;
	color: var(--wccp-muted);
	text-align: center;
	line-height: 1.3;
	white-space: normal !important;
	max-width: 100%;
}
.wccp-tab.is-active .wccp-tab-name { color: var(--wccp-green); font-weight: 600; }

/* ========== Sections ========== */
.wccp-sections { padding: 0 !important; }
.wccp-section {
	margin-bottom: 28px;
	scroll-margin-top: calc(var(--wccp-sticky-offset, 72px) + 90px);
	content-visibility: auto;
	contain-intrinsic-size: 1px 800px;
}
.wccp-section-title {
	font-size: 17px;
	font-weight: 700;
	margin: 22px 0 14px;
	text-align: center;
	color: var(--wccp-text);
}

/* ========== Product Card ========== */
.wccp-product {
	background: var(--wccp-card);
	border-radius: var(--wccp-radius);
	box-shadow: var(--wccp-shadow);
	margin-bottom: 18px;
	overflow: hidden;
	border: 1px solid rgba(226, 232, 240, 0.7);
	padding: 18px 18px 16px;
	content-visibility: auto;
	contain-intrinsic-size: 1px 220px;
}

.wccp-product.is-outofstock { opacity: 0.7; }

.wccp-product-top {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	margin-bottom: 14px;
}

.wccp-product-image-link {
	position: relative;
	flex: 0 0 132px;
	width: 132px;
	height: 132px;
	border-radius: 16px;
	overflow: hidden;
	background: #f8fafc;
	display: block;
}
.wccp-product-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wccp-no-image { display: block; width: 100%; height: 100%; background: #f1f5f9; }

.wccp-sale-badge {
	position: absolute;
	top: 8px;
	right: 8px;
	background: #ef4444;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 8px;
	border-radius: 8px;
	line-height: 1.3;
	z-index: 2;
	white-space: nowrap;
}

.wccp-product-head { flex: 1; min-width: 0; }

.wccp-product-title-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px;
}

.wccp-product-title {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.4;
	color: var(--wccp-green);
	flex: 1;
}
.wccp-product-title a { color: inherit; text-decoration: none; }
.wccp-product-title a:hover { opacity: 0.85; }

.wccp-product .byno-wishlist-btn,
.wccp-wishlist-btn {
	flex: 0 0 auto;
	background: transparent;
	border: 0;
	padding: 4px;
	cursor: pointer;
	color: var(--wccp-muted);
	font-size: 18px;
	line-height: 1;
}
.wccp-product .byno-wishlist-btn.is-active,
.wccp-wishlist-btn.is-active {
	color: #ef4444;
}

.wccp-product-desc {
	margin: 8px 0 0;
	font-size: 13.5px;
	color: #64748b;
	line-height: 1.65;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wccp-variations {
	display: flex;
	flex-direction: column;
	border-top: 1px solid var(--wccp-border);
	margin-top: 4px;
}

.wccp-var-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--wccp-border);
}
.wccp-var-row:last-child { border-bottom: 0; padding-bottom: 0; }
.wccp-var-row.is-disabled { opacity: 0.5; pointer-events: none; }

.wccp-var-action {
	flex: 0 0 auto;
	min-width: 100px;
}

.wccp-btn-select {
	background: transparent;
	border: 1.5px solid var(--wccp-green);
	color: var(--wccp-green);
	font-size: 13px;
	font-weight: 600;
	padding: 8px 20px;
	border-radius: 10px;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.12s, color 0.12s;
	min-width: 90px;
	text-align: center;
}
.wccp-btn-select:hover:not(:disabled) {
	background: var(--wccp-green);
	color: #fff;
}
.wccp-btn-select:disabled { opacity: 0.55; cursor: not-allowed; }
.wccp-btn-select.is-loading { opacity: 0.7; pointer-events: none; }

.wccp-qty-control,
.wccp-var-action .byno-quantity {
	display: inline-flex;
	align-items: center;
	gap: 0;
	border: 1.5px solid var(--wccp-border);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}
.wccp-qty-minus,
.wccp-qty-plus,
.wccp-var-action .quantity-minus,
.wccp-var-action .quantity-plus {
	width: 36px;
	height: 36px;
	border: 0;
	background: #f8fafc;
	color: var(--wccp-text);
	font-size: 18px;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: inherit;
	padding: 0;
	line-height: 1;
}
.wccp-qty-minus:hover,
.wccp-qty-plus:hover,
.wccp-var-action .quantity-minus:hover,
.wccp-var-action .quantity-plus:hover {
	background: #e2e8f0;
}
.wccp-qty-input,
.wccp-var-action .quantity-input {
	width: 40px;
	height: 36px;
	border: 0;
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--wccp-text);
	background: #fff;
	font-family: inherit;
	-moz-appearance: textfield;
}
.wccp-qty-input::-webkit-outer-spin-button,
.wccp-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wccp-var-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 2px;
	text-align: left;
}

.wccp-var-label {
	font-size: 13px;
	color: var(--wccp-text);
	font-weight: 600;
}

.wccp-price {
	font-size: 15px;
	font-weight: 700;
	color: var(--wccp-text);
}
.wccp-regular-price {
	font-size: 12.5px;
	color: var(--wccp-muted);
}
.wccp-regular-price del {
	text-decoration: line-through;
}

.wccp-empty,
.wccp-no-products {
	text-align: center;
	padding: 40px 16px;
	color: #94a3b8;
	font-size: 14px;
}

/* ========== Back to top ========== */
.wccp-back-top {
	position: fixed;
	left: 16px;
	bottom: 88px;
	z-index: 120;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 0;
	background: var(--wccp-green);
	color: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(8px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
	font-size: 18px;
	line-height: 1;
	padding: 0;
}
.wccp-back-top.is-visible {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}
.wccp-back-top:hover {
	background: var(--wccp-green-dark);
}
@media (min-width: 901px) {
	.wccp-back-top {
		bottom: 28px;
		left: 24px;
	}
}

@media (max-width: 480px) {
	.wccp-product {
		padding: 16px 14px 14px;
		margin-bottom: 14px;
	}
	.wccp-product-top {
		gap: 12px;
	}
	.wccp-product-image-link {
		flex: 0 0 112px;
		width: 112px;
		height: 112px;
		border-radius: 14px;
	}
	.wccp-product-title { font-size: 14.5px; }
	.wccp-product-desc {
		font-size: 13px;
		-webkit-line-clamp: 4;
	}
	.wccp-btn-select { padding: 7px 14px; font-size: 12.5px; min-width: 80px; }
	.wccp-tab { min-width: 70px; max-width: 86px; padding: 8px; }
	.wccp-tab-img { width: 42px; height: 42px; }
	.wccp-section { scroll-margin-top: calc(var(--wccp-sticky-offset, 0px) + 100px); }
}
