/**
 * WooCommerce tweaks for Tin Nông TNTECH storefront (paired with Tailwind theme).
 */

.tntech-wc-gallery-wrap .woocommerce-product-gallery,
.tntech-wc-single .woocommerce-product-gallery {
	width: 100%;
	margin-bottom: 0;
}

.tntech-wc-single-gallery-card .woocommerce-product-gallery {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.tntech-wc-single-gallery-card .woocommerce-product-gallery__wrapper {
	width: 100%;
}

.tntech-wc-single-gallery-card .woocommerce-product-gallery__image img,
.tntech-wc-single-gallery-card .woocommerce-product-gallery__image picture img {
	max-height: 20rem;
	width: auto;
	max-width: 100%;
	object-fit: contain;
	margin-inline: auto;
}

.tntech-wc-single .flex-control-thumbs {
	margin-top: 0.75rem;
}

/* Override storefront % widths so summary fills its grid column. */
.woocommerce #content div.product div.summary,
.woocommerce div.product div.summary,
.woocommerce-page #content div.product div.summary,
.woocommerce-page div.product div.summary {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	float: none;
	box-sizing: border-box;
}

.tntech-wc-single .summary .price {
	color: #782e01;
	font-size: 1.5rem;
	font-weight: 700;
	margin-bottom: 0.75rem;
}

.tntech-wc-single .summary form.cart .button,
.tntech-wc-single .summary .single_add_to_cart_button {
	background: linear-gradient(90deg, #782e01, #d78131);
	color: #fff;
	border-radius: 999px;
	padding: 0.75rem 2rem;
	font-weight: 700;
	border: none;
	box-shadow: 0 10px 15px -3px rgb(0 0 0 / 10%);
}

.tntech-wc-single .summary form.cart .button:hover,
.tntech-wc-single .summary .single_add_to_cart_button:hover {
	filter: brightness(1.05);
}

/* Long description & extra sections: readable typography */
.tntech-wc-long-desc-inner img,
.tntech-wc-extra-section-inner img {
	max-width: 100%;
	height: auto;
}

/* Single product — reviews sidebar (“Đánh Giá Nông Dân” UI). */
.tntech-wc-reviews-sidebar #reviews > h2,
.tntech-wc-reviews-sidebar .woocommerce-Reviews-title {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.tntech-wc-reviews-sidebar .woocommerce-Reviews-title + p {
	margin-top: 0;
}

.tntech-wc-reviews-sidebar__card {
	box-shadow: 0 4px 22px rgb(15 23 42 / 0.06), 0 2px 6px rgb(15 23 42 / 0.035);
}

.tntech-wc-reviews-sidebar__title {
	color: #5d2d06;
	line-height: 1.35;
}

.tntech-wc-reviews-sidebar__count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 9999px;
	background-color: #d68133;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
	box-shadow: 0 2px 4px rgb(0 0 0 / 0.14);
}

.tntech-wc-reviews-sidebar__body #reviews .woocommerce-Reviews-inner,
.tntech-wc-reviews-sidebar__body #reviews #comments {
	margin-top: 0;
}

.tntech-wc-reviews-sidebar__body #reviews #comments .tntech-wc-commentlist-scroll {
	max-height: 400px;
	overflow-y: auto;
}

.tntech-wc-reviews-sidebar__body #reviews #comments ol.commentlist {
	list-style: none;
	margin: 0;
	padding: 0;
	max-height: none;
	overflow: visible;
}

/* WooCommerce đệm trái cho avatar mặc định — layout TNTECH không dùng avatar */
.woocommerce #reviews #comments ol.commentlist li .comment-text {
	margin-left: 0 !important;
}

/* Review cards (template overrides — không avatar) */
.tntech-wc-reviews-sidebar__body #reviews ol.commentlist > li.review {
	list-style: none;
	margin: 0 0 0.75rem !important;
	padding: 0 !important;
	border: none;
	background: transparent;
}

.tntech-wc-reviews-sidebar__body li.review .comment_container img.avatar {
	display: none !important;
}

.tntech-wc-reviews-sidebar__body li.review .comment_container .tntech-wc-review-card .star-rating {
	font-size: 0.9375rem;
	color: #e6aa14 !important;
}

.tntech-wc-reviews-sidebar__body .tntech-wc-review-quote p,
.tntech-wc-reviews-sidebar__body .tntech-wc-review-quote .description p {
	font-size: 0.875rem;
	line-height: 1.55;
	font-style: italic;
	color: #4b5563;
	margin: 0;
}

.tntech-wc-reviews-sidebar #review_form .comment-form-tntech-region label {
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	color: #374151;
	margin-bottom: 0.35rem;
}

.tntech-wc-reviews-sidebar #review_form .comment-form-tntech-region input.input-text {
	width: 100%;
	box-sizing: border-box;
	padding: 0.45rem 0.65rem;
	border-radius: 0.5rem;
	border: 1px solid #e5e7eb;
	font-size: 0.875rem;
}

.tntech-wc-reviews-sidebar #review_form_wrapper {
	padding-top: 1.25rem;
	margin-top: 1.125rem;
	border-top: 1px solid #e5e7eb;
}

.tntech-wc-reviews-sidebar #reply-title,
.tntech-wc-reviews-sidebar .comment-reply-title {
	display: block;
	font-size: 1rem;
	font-weight: 700;
	color: #374151;
	margin: 0 0 1rem;
	border: none;
	padding: 0;
}

.tntech-wc-reviews-sidebar #review_form select#rating,
.tntech-wc-reviews-sidebar #review_form #rating {
	display: block;
	width: 100%;
	max-width: 100%;
	margin-top: 0.35rem;
	padding: 0.45rem 0.65rem;
	font-size: 0.875rem;
	border-radius: 0.5rem;
	border: 1px solid #e5e7eb;
	background-color: #fff;
	box-sizing: border-box;
}

.tntech-wc-reviews-sidebar .comment-form-rating label,
.tntech-wc-reviews-sidebar .comment-form-comment label {
	display: block;
	font-size: 0.875rem;
	font-weight: 700;
	color: #374151;
	margin-bottom: 0.35rem;
}

.tntech-wc-reviews-sidebar .comment-form-rating .required,
.tntech-wc-reviews-sidebar .comment-form-comment .required {
	color: #b45309;
}

.tntech-wc-reviews-sidebar #commentform .comment-form-rating {
	margin-bottom: 1rem;
}

.tntech-wc-reviews-sidebar #commentform .comment-form-comment {
	margin-bottom: 0;
}

.tntech-wc-reviews-sidebar #commentform textarea {
	width: 100%;
	box-sizing: border-box;
	min-height: 8rem;
	border-radius: 0.5rem;
	border: 1px solid #e5e7eb;
	padding: 0.65rem 0.85rem;
	font-size: 0.875rem;
	line-height: 1.55;
	resize: vertical;
}

.tntech-wc-reviews-sidebar #commentform input#submit {
	width: 100%;
	background-color: #782e01;
	color: #fff;
	font-weight: 700;
	font-size: 0.875rem;
	padding: 0.65rem 1rem;
	border: none;
	border-radius: 0.5rem;
	cursor: pointer;
	margin-top: 0.875rem;
	box-shadow: 0 8px 12px rgb(120 46 1 / 0.15);
	transition: filter 150ms ease, background-color 150ms ease;
}

.tntech-wc-reviews-sidebar #commentform input#submit:hover {
	background-color: #5d2301;
	filter: brightness(1.06);
}

.tntech-wc-reviews-sidebar #review_form .logged-in-as,
.tntech-wc-reviews-sidebar #review_form .must-log-in {
	font-size: 0.8125rem;
	color: #6b7280;
	margin-bottom: 0.75rem;
}

.tntech-wc-single .woocommerce .star-rating {
	color: #facc15;
}

.tntech-wc-archive .woocommerce-result-count,
.tntech-wc-archive .woocommerce-ordering {
	display: none !important;
}

/**
 * Breadcrumb trail: gray links + "/" + brown bold uppercase current (shop archive + single).
 */
.tntech-wc-breadcrumb-trail,
.tntech-wc-breadcrumb-trail .woocommerce-breadcrumb {
	font-size: 0.875rem;
	line-height: 1.6;
	color: #6b4310;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.tntech-wc-breadcrumb-trail a,
.tntech-wc-breadcrumb-trail .woocommerce-breadcrumb a {
	font-weight: 400;
	text-transform: none;
	color: #666666;
	text-decoration: none;
}

.tntech-wc-breadcrumb-trail a:hover,
.tntech-wc-breadcrumb-trail .woocommerce-breadcrumb a:hover {
	color: #782e01;
	text-decoration: underline;
}

.tntech-wc-breadcrumb-trail .breadcrumb-sep {
	display: inline-block;
	margin: 0 0.4rem;
	color: #666666;
	font-weight: 400;
	text-transform: none;
}

/* Same trail rules on shop hero (earth): recessed links vs bright current — mirrors light-page contrast. */
.tntech-wc-breadcrumb-trail--earth .woocommerce-breadcrumb {
	color: #fff;
}

.tntech-wc-breadcrumb-trail--earth a,
.tntech-wc-breadcrumb-trail--earth .woocommerce-breadcrumb a {
	color: rgba(255, 235, 214, 0.72);
}

.tntech-wc-breadcrumb-trail--earth a:hover,
.tntech-wc-breadcrumb-trail--earth .woocommerce-breadcrumb a:hover {
	color: #fff;
	text-decoration: underline;
}

.tntech-wc-breadcrumb-trail--earth .breadcrumb-sep {
	color: rgba(255, 255, 255, 0.42);
}

.tntech-wc-archive .onsale-badge {
	z-index: 2;
}

.tntech-wc-archive ul.products {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tntech-wc-archive ul.products::before,
.tntech-wc-archive ul.products::after {
	display: none;
}

.tntech-wc-loop-card {
	width: 100%;
	float: none !important;
	margin: 0 !important;
}

/* Override WC column % widths so CSS grid children fill the column. */
.woocommerce ul.products.columns-3 li.product,
.woocommerce-page ul.products.columns-3 li.product {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	float: none !important;
}

/* Loop column grid (Woo adds .columns-3 + inline widths on some releases). */
.tntech-wc-archive ul.products.columns-3 {
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 1.5rem;
}

@media (min-width: 640px) {
	.tntech-wc-archive ul.products.columns-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.tntech-wc-archive ul.products.columns-3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.tntech-wc-archive ul.products.columns-3 {
	gap: 2rem;
}

.tntech-wc-archive .woocommerce-pagination {
	margin-top: 2.5rem;
}

.tntech-wc-archive .woocommerce-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.375rem;
	justify-content: center;
	list-style: none;
	margin: 0;
	padding: 0;
}

.tntech-wc-archive .woocommerce-pagination ul li a,
.tntech-wc-archive .woocommerce-pagination ul li span {
	display: inline-flex;
	min-width: 2.25rem;
	align-items: center;
	justify-content: center;
	padding: 0.35rem 0.65rem;
	border-radius: 0.5rem;
	border: 1px solid #e5e7eb;
	background: #fff;
	color: #374151;
	text-decoration: none;
	font-size: 0.875rem;
	font-weight: 600;
}

.tntech-wc-archive .woocommerce-pagination ul li a:hover {
	border-color: #d78131;
	color: #782e01;
}

.tntech-wc-archive .woocommerce-pagination ul li span.current {
	background: #782e01;
	border-color: #782e01;
	color: #fff;
}

.tntech-wc-loop-card .attachment-woocommerce_thumbnail,
.tntech-wc-loop-card img.woocommerce-placeholder {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── Related products (single) — không nằm trong .tntech-wc-archive nên cần lưới riêng. */
.tntech-wc-single section.related.products,
.tntech-wc-single .related.products {
	clear: both;
	margin-top: 2.75rem;
	padding-top: 2rem;
	border-top: 1px solid #e5e7eb;
	max-width: 100%;
	box-sizing: border-box;
}

.tntech-wc-single .related.products > h2 {
	font-size: 1.375rem;
	line-height: 1.35;
	font-weight: 700;
	color: #782e01;
	margin: 0 0 1.5rem;
	text-align: left;
	letter-spacing: -0.01em;
}

.tntech-wc-single .related.products ul.products {
	margin: 0;
	padding: 0;
	list-style: none;
	float: none;
	width: 100%;
	display: grid;
	grid-template-columns: repeat(1, minmax(0, 1fr));
	gap: 2rem;
}

.tntech-wc-single .related.products ul.products::before,
.tntech-wc-single .related.products ul.products::after {
	display: none;
}

@media (min-width: 640px) {
	.tntech-wc-single .related.products ul.products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.tntech-wc-single .related.products ul.products {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.tntech-wc-single .related.products ul.products li.product {
	width: 100% !important;
	max-width: 100%;
	min-width: 0;
	float: none !important;
	margin: 0 !important;
	clear: none !important;
}
