/* Single product page — loaded by inc/single-product.php (product pages only). */

body.single-product {
	/* Tweak these to restyle the product page. */
	--kp-sp-green: var(--wd-primary-color, #216837);
	--kp-sp-green-soft: #eaf5ed;
	--kp-sp-amber: #f6b511;          /* Add to cart */
	--kp-sp-amber-hover: #e9a800;
	--kp-sp-amber-text: #1f1a05;
	--kp-sp-red: #e5372b;            /* -% OFF badge */
	--kp-sp-line: #ebe8e0;           /* thin off-white borders */
	--kp-sp-muted: #6b716d;
	--kp-sp-btn-h: 50px;
}

/* ---------- Title, short description, price ---------- */

body.single-product .wd-single-title .product_title {
	color: #1a1a1a;
	font-size: clamp(24px, 2.4vw, 32px);
	font-weight: 700;
	line-height: 1.3;
}

body.single-product .wd-single-short-desc .woocommerce-product-details__short-description {
	color: var(--kp-sp-green);
	font-size: 15px;
	line-height: 1.75;
}

body.single-product .wd-single-price .price {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
}

body.single-product .wd-single-price .price ins,
body.single-product .wd-single-price .price > .woocommerce-Price-amount {
	order: 1;
	color: var(--kp-sp-green);
	font-size: 32px;
	font-weight: 700;
	text-decoration: none;
}

body.single-product .wd-single-price .price del {
	order: 2;
	color: #a0a4a1;
	font-size: 16px;
	font-weight: 400;
}

.kp-off-badge {
	order: 3;
	padding: 4px 9px;
	border-radius: 6px;
	background: var(--kp-sp-red);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .02em;
	line-height: 1.3;
}

/* ---------- Subtotal + quantity, then the two buttons ----------
 *   Subtotal Price        Quantity
 *   ৳3,800 [Save ৳600]    [-  1  +]
 *   [ Add to cart ]       [ Buy now ]   */

body.single-product .wd-single-add-cart form.cart:not(.variations_form),
body.single-product .wd-single-add-cart .woocommerce-variation-add-to-cart {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 6px 14px;
}

.kp-subtotal {
	grid-column: 1;
	grid-row: 1 / span 2;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.kp-subtotal[hidden] {
	display: none;
}

.kp-subtotal__label,
.kp-qty-label {
	color: #333;
	font-size: 13px;
	font-weight: 600;
}

.kp-subtotal__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.kp-subtotal__value {
	color: var(--kp-sp-green);
	font-size: 21px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.kp-subtotal__save {
	padding: 2px 8px;
	border: 1px solid #b9dcc3;
	border-radius: 6px;
	background: var(--kp-sp-green-soft);
	color: var(--kp-sp-green);
	font-size: 12px;
	font-weight: 600;
}

.kp-subtotal__save[hidden] {
	display: none;
}

.kp-qty-label {
	grid-column: 2;
	grid-row: 1;
}

body.single-product .wd-single-add-cart form.cart .quantity {
	grid-column: 2;
	grid-row: 2;
	justify-self: start;
	display: inline-flex;
	align-items: stretch;
	height: 46px;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--kp-sp-line);
	border-radius: 10px;
	background: #fff;
}

body.single-product .wd-single-add-cart form.cart .quantity .btn {
	min-height: 0;
	width: 42px;
	height: auto;
	border: 0;
	background: transparent;
	color: #555;
	font-size: 18px;
}

body.single-product .wd-single-add-cart form.cart .quantity .btn:hover {
	background: var(--kp-sp-green-soft);
	color: var(--kp-sp-green);
}

body.single-product .wd-single-add-cart form.cart .quantity input.qty {
	width: 48px;
	height: auto;
	border: 0;
	border-inline: 1px solid var(--kp-sp-line);
	font-size: 16px;
	font-weight: 600;
}

/* Buttons */
body.single-product .wd-single-add-cart .single_add_to_cart_button,
body.single-product .wd-single-add-cart .wd-buy-now-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	min-height: var(--kp-sp-btn-h);
	margin: 14px 0 0 !important;
	border-radius: 999px !important;
	font-size: 16px;
	font-weight: 600;
	text-transform: none;
	transition: background-color .2s, box-shadow .2s, transform .2s;
}

body.single-product .wd-single-add-cart .single_add_to_cart_button {
	grid-column: 1;
	grid-row: 3;
	background-color: var(--kp-sp-amber) !important;
	box-shadow: 0 6px 16px rgba(246, 181, 17, .3);
	color: var(--kp-sp-amber-text) !important;
}

body.single-product .wd-single-add-cart .single_add_to_cart_button:hover {
	background-color: var(--kp-sp-amber-hover) !important;
	transform: translateY(-1px);
}

body.single-product .wd-single-add-cart .wd-buy-now-btn {
	grid-column: 2;
	grid-row: 3;
	background-color: var(--kp-sp-green) !important;
	box-shadow: 0 6px 16px rgba(33, 104, 55, .28);
	color: #fff !important;
}

body.single-product .wd-single-add-cart .wd-buy-now-btn:hover {
	filter: brightness(1.08);
	transform: translateY(-1px);
}

/* Icons: cart with + on Add to cart, box on Buy now. */
body.single-product .wd-single-add-cart .single_add_to_cart_button::before,
body.single-product .wd-single-add-cart .wd-buy-now-btn::before {
	content: "";
	flex: none;
	width: 20px;
	height: 20px;
	background: currentColor;
	-webkit-mask: var(--kp-icon) center / contain no-repeat;
	mask: var(--kp-icon) center / contain no-repeat;
}

body.single-product .wd-single-add-cart .single_add_to_cart_button::before {
	--kp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 4h2l2.4 10.2a1 1 0 0 0 1 .8h8.9a1 1 0 0 0 1-.8L20 7H6.2'/%3E%3Ccircle cx='9' cy='19.5' r='1.3'/%3E%3Ccircle cx='17' cy='19.5' r='1.3'/%3E%3Cpath d='M13 9.5v-5M10.5 7h5'/%3E%3C/svg%3E");
}

body.single-product .wd-single-add-cart .wd-buy-now-btn::before {
	--kp-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l8 4.5v9L12 21l-8-4.5v-9z'/%3E%3Cpath d='M12 12l8-4.5M12 12v9M12 12L4 7.5'/%3E%3C/svg%3E");
}

/* ---------- Call / WhatsApp ---------- */

.kp-order-alt {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
	margin-top: 14px;
}

.kp-order-alt__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 54px;
	padding: 6px 14px;
	border: 1px solid var(--kp-sp-line);
	border-radius: 999px;
	background: #fff;
	color: #1a1a1a !important;
	text-decoration: none !important;
	transition: border-color .2s, box-shadow .2s;
}

.kp-order-alt__btn:hover {
	border-color: var(--kp-sp-green);
	box-shadow: 0 4px 14px rgba(33, 104, 55, .12);
}

.kp-order-alt__icon {
	flex: none;
	width: 22px;
	height: 22px;
}

.kp-order-alt__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.kp-order-alt__icon--call svg {
	fill: none;
	stroke: var(--kp-sp-green);
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.kp-order-alt__icon--wa {
	color: #25d366;
}

.kp-order-alt__text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
}

.kp-order-alt__text b {
	font-size: 14.5px;
	font-weight: 600;
}

.kp-order-alt__text small {
	color: var(--kp-sp-muted);
	font-size: 12px;
}

/* ---------- Trust badges ---------- */

.kp-badges {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
	margin: 20px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid var(--kp-sp-line);
	list-style: none;
	text-align: center;
}

.kp-badges__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin: 0;
}

.kp-badges__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin-bottom: 4px;
	border-radius: 50%;
	background: var(--kp-sp-green-soft);
	color: var(--kp-sp-green);
}

.kp-badges__icon svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.kp-badges__item b {
	color: #1a1a1a;
	font-size: 13.5px;
	font-weight: 600;
}

.kp-badges__item small {
	color: var(--kp-sp-muted);
	font-size: 12px;
	line-height: 1.45;
}

/* ---------- Gallery: rounded frame, rounded thumbnails ---------- */

body.single-product .wd-single-gallery .wd-gallery-images {
	overflow: hidden;
	border: 1px solid var(--kp-sp-line);
	border-radius: 16px;
	background: #fff;
}

body.single-product .wd-single-gallery .wd-gallery-thumb .wd-carousel-item img {
	border: 1px solid var(--kp-sp-line);
	border-radius: 10px;
	transition: border-color .2s, box-shadow .2s;
}

body.single-product .wd-single-gallery .wd-gallery-thumb .wd-thumb-active img {
	border-color: var(--kp-sp-green);
	box-shadow: 0 0 0 1px var(--kp-sp-green);
}

/* ---------- Phones ---------- */

@media (max-width: 767px) {
	body.single-product .wd-single-price .price ins,
	body.single-product .wd-single-price .price > .woocommerce-Price-amount {
		font-size: 27px;
	}

	body.single-product .wd-single-add-cart .single_add_to_cart_button,
	body.single-product .wd-single-add-cart .wd-buy-now-btn {
		font-size: 15px;
	}

	.kp-order-alt {
		gap: 10px;
	}

	.kp-order-alt__btn {
		padding: 6px 10px;
	}

	.kp-order-alt__text b {
		font-size: 13.5px;
	}
}

@media (max-width: 400px) {
	.kp-order-alt {
		grid-template-columns: 1fr;
	}
}
