/**
 * Product Accordion Styles
 * Figma-matched accordion for Description, Additional Info, Specs, Warranty.
 * Default WooCommerce tabs are removed via PHP — no CSS hiding needed.
 *
 * @package BlazeBlocksy
 */

/* Section container */
.bb-product-accordion {
	padding: 0;
	margin: 40px auto 0;
}

/* Individual accordion item */
.bb-accordion-item {
	border-top: 1px solid #e4e5e7;
}

.bb-accordion-item:last-child {
	border-bottom: 1px solid #e4e5e7;
}

/* Accordion header / trigger button */
.bb-accordion-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	min-height: 84px;
	padding: 16px 0;
	border: none;
	background: transparent;
	cursor: pointer;
	text-align: left;
}

/* Open state: extra bottom padding before content */
.bb-accordion-item.is-open .bb-accordion-header {
	padding-bottom: 30px;
}

.bb-accordion-header:focus-visible {
	outline: 2px solid var(--theme-palette-color-1, #1c6009);
	outline-offset: -2px;
}

/* Title text */
.bb-accordion-title {
	font-family: 'Playfair Display', serif;
	font-weight: 400;
	font-size: 20px;
	line-height: 1.4;
	color: #4a4a4a;
	transition: color 0.2s ease;
}

/* Open state: green heading */
.bb-accordion-item.is-open .bb-accordion-title {
	color: #1c6009;
}

/* Toggle icon (+/-) — SVG icons matching Figma */
.bb-accordion-icon {
	width: 24px;
	height: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #4a4a4a;
	transition: color 0.2s ease;
}

/* Show plus, hide minus by default (collapsed) */
.bb-accordion-icon .bb-icon-plus {
	display: block;
}

.bb-accordion-icon .bb-icon-minus {
	display: none;
}

/* Open state: show minus, hide plus */
.bb-accordion-item.is-open .bb-accordion-icon .bb-icon-plus {
	display: none;
}

.bb-accordion-item.is-open .bb-accordion-icon .bb-icon-minus {
	display: block;
}

.bb-accordion-item.is-open .bb-accordion-icon {
	color: #1c6009;
}

/* Panel content area — animated with max-height */
.bb-accordion-panel {
	overflow: hidden;
	max-height: 0;
	transition: max-height 300ms ease;
}

.bb-accordion-item.is-open .bb-accordion-panel {
	max-height: 2000px; /* large enough to fit content; transition handles the animation */
}

.bb-accordion-content {
	padding: 0 0 24px;
	font-family: 'Barlow', sans-serif;
	font-weight: 400;
	font-size: 16px;
	line-height: 24px;
	color: #4a4a4a;
	max-width: max-content;
}

.bb-accordion-content p {
	margin: 0 0 12px;
}

.bb-accordion-content p:last-child {
	margin-bottom: 0;
}

/* Additional info table styles */
.bb-accordion-content table.shop_attributes {
	width: 100%;
	border-collapse: collapse;
}

.bb-accordion-content table.shop_attributes th,
.bb-accordion-content table.shop_attributes td {
	padding: 12px 16px;
	border-bottom: 1px solid #e4e5e7;
	font-size: 16px;
	text-align: left;
}

.bb-accordion-content table.shop_attributes th {
	font-weight: 600;
	width: 30%;
}

/* Expandable description "Read More" */
.bb-description-expandable {
	position: relative;
}

.bb-description-text {
	max-height: 200px;
	overflow: hidden;
	transition: max-height 0.4s ease;
}

.bb-description-expandable.is-expanded .bb-description-text {
	max-height: none;
}

/* Gradient fade when truncated */
.bb-description-expandable:not(.is-expanded) .bb-description-text::after {
	content: '';
	position: absolute;
	bottom: 40px;
	left: 0;
	width: 100%;
	height: 60px;
	background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 1));
	pointer-events: none;
}

/* Toggle button — simple underlined text link per Figma */
.bb-description-toggle {
	display: none;
	margin-top: 12px;
	padding: 0;
	background: transparent;
	border: none;
	font-family: 'Barlow', sans-serif;
	font-size: 16px;
	font-weight: 400;
	color: #4a4a4a;
	text-decoration: underline;
	cursor: pointer;
	text-align: left;
}

.bb-description-toggle:hover {
	opacity: 0.8;
}

/* Show toggle only when content is truncatable */
.bb-description-expandable.is-truncatable .bb-description-toggle {
	display: block;
}

/* Toggle text visibility */
.bb-toggle-less {
	display: none;
}

.bb-description-expandable.is-expanded .bb-toggle-more {
	display: none;
}

.bb-description-expandable.is-expanded .bb-toggle-less {
	display: inline;
}

/* Responsive — Figma mobile uses same fonts/sizes as desktop */
@media (max-width: 767px) {
	.bb-description-text {
		max-height: 160px;
	}
}
