/* Single product: gallery, summary, specs, tabs, sticky buy bar. */

.single-product div.product {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
	gap: clamp(22px, 3.2vw, 46px);
	align-items: start;
	padding-block: 14px;
}

.rb-gallery {
	position: sticky;
	top: calc(var(--rb-header-h) + 16px);
	min-width: 0;
	display: grid;
	gap: 12px;
}

.rb-gallery__main {
	position: relative;
	border-radius: var(--rb-r-tile);
	overflow: hidden;
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
	aspect-ratio: 1;
}

.rb-gallery__main img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }

.rb-gallery__thumbs {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
	scrollbar-width: thin;
}

.rb-gallery__thumb {
	flex: 0 0 74px;
	aspect-ratio: 1;
	border-radius: 13px;
	overflow: hidden;
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
	padding: 0;
	cursor: pointer;
}

.rb-gallery__thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.rb-gallery__thumb[aria-current] { outline: 3px solid var(--rb-blue-dark); outline-offset: 1px; }

.single-product .summary { display: flex; flex-direction: column; gap: 15px; min-width: 0; }
.single-product .product_title { font-size: clamp(1.6rem, 1.2rem + 1.9vw, 2.5rem); }

.single-product .woocommerce-product-rating { display: flex; align-items: center; gap: 10px; font-size: .875rem; }

.single-product .summary .price {
	font-family: var(--rb-display);
	font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.35rem);
	font-weight: 600;
	color: var(--rb-ink);
	font-variant-numeric: tabular-nums;
}
.single-product .summary .price del { font-family: var(--rb-body); font-size: 1.05rem; color: var(--rb-ink-soft); margin-left: 10px; font-weight: 600; }
.single-product .summary .price ins { text-decoration: none; }

.woocommerce-product-details__short-description { font-size: 1.03rem; line-height: 1.65; }
.woocommerce-product-details__short-description p + p { margin-top: .9em; }

/* --- spec block --------------------------------------------------------- */
.rb-specs {
	background: var(--rb-white);
	border-radius: var(--rb-r-card);
	box-shadow: var(--rb-sh-1);
	overflow: hidden;
	margin: 0;
}
.rb-specs__row { display: flex; gap: 16px; padding: 13px 17px; font-size: .9375rem; border-bottom: 1px solid var(--rb-line); }
.rb-specs__row:last-child { border-bottom: 0; }
.rb-specs dt { flex: 0 0 132px; font-weight: 800; color: var(--rb-ink-soft); margin: 0; }
.rb-specs dd { margin: 0; font-weight: 700; min-width: 0; }
.rb-tag {
	display: inline-block;
	background: var(--rb-sky);
	color: var(--rb-blue-deep);
	border-radius: 999px;
	padding: 2px 10px;
	font-size: .78rem;
	font-weight: 800;
	margin: 2px 4px 2px 0;
}

/* --- add to cart --------------------------------------------------------- */
.single-product form.cart { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 0; }
.single-product form.cart .quantity {
	display: inline-flex;
	align-items: center;
	background: var(--rb-white);
	border-radius: 999px;
	box-shadow: var(--rb-sh-1);
	height: 52px;
	padding: 0 6px;
}
.single-product form.cart .quantity input {
	width: 62px;
	height: 52px;
	border: 0;
	background: none;
	text-align: center;
	font-weight: 800;
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
	color: var(--rb-ink);
}

.rb-ask {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 20px;
	border-radius: 999px;
	background: #E9F9EF;
	color: #13694A;
	font-weight: 800;
	font-size: .94rem;
}
.rb-ask:hover { background: #D5F3E2; color: #0F5639; }

.single-product .product_meta { font-size: .84rem; color: var(--rb-ink-soft); font-weight: 700; }

/* --- tabs ---------------------------------------------------------------- */
.woocommerce-tabs { grid-column: 1 / -1; margin-top: 8px; }
.woocommerce-tabs ul.tabs {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	list-style: none;
	margin: 0;
	padding: 0;
	border-bottom: 2px solid var(--rb-line);
}
.woocommerce-tabs ul.tabs li { margin: 0; }
.woocommerce-tabs ul.tabs li a {
	display: inline-flex;
	align-items: center;
	min-height: 48px;
	padding: 0 17px;
	font-weight: 800;
	font-size: .94rem;
	color: var(--rb-ink-soft);
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	white-space: nowrap;
}
.woocommerce-tabs ul.tabs li.active a { color: var(--rb-ink); border-bottom-color: var(--rb-orange-dark); }
.woocommerce-tabs .panel { padding-top: 20px; max-width: 76ch; line-height: 1.7; }
.woocommerce-tabs .panel h2 { font-size: 1.2rem; margin-bottom: 10px; }

/* --- related -------------------------------------------------------------- */
.related.products,
.up-sells { grid-column: 1 / -1; margin-top: 10px; }
.related.products > h2,
.up-sells > h2 { font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem); margin-bottom: 18px; }

/* --- sticky buy bar -------------------------------------------------------- */
.rb-buybar { display: none; }

@media (max-width: 860px) {
	.single-product div.product { grid-template-columns: 1fr; gap: 26px; }
	.rb-gallery { position: static; }
	.rb-specs dt { flex-basis: 110px; }

	.rb-buybar {
		display: flex;
		position: fixed;
		inset-inline: 0;
		bottom: 0;
		z-index: 46;
		gap: 12px;
		align-items: center;
		background: var(--rb-white);
		border-top: 1px solid var(--rb-line);
		padding: 10px max(14px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-right, 0px));
		box-shadow: 0 -6px 20px rgba(24, 36, 48, .09);
	}

	.rb-buybar[hidden] { display: none; }
	.rb-buybar__price { font-family: var(--rb-display); font-size: 1.3rem; font-weight: 600; white-space: nowrap; }
	.rb-buybar__price del { display: none; }
	.rb-buybar .rb-btn { flex: 1; min-height: 48px; }

	/* The buy bar replaces the tab bar so the two never stack. */
	.single-product .rb-tabbar,
	.single-product .rb-whatsapp { display: none; }
	.single-product body,
	body.single-product { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
