/**
 * Product Tabs — common widget CSS (layout + WooCommerce content reset).
 *
 * @package captain-widgets-kit
 * @since   1.4.0
 */

.captwiki-ptabs {
	display: block;
}

.captwiki-ptabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.captwiki-ptabs__nav-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.captwiki-ptabs__tab {
	display: inline-block;
	margin: 0;
	padding: 12px 18px;
	border: none;
	background: transparent;
	color: #4b5563;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	cursor: pointer;
	transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.captwiki-ptabs__panel {
	padding: 22px 0;
}

.captwiki-ptabs__panel[hidden] {
	display: none;
}

/* Vertical layout. */
.captwiki-ptabs--vertical {
	display: flex;
	align-items: flex-start;
	gap: 24px;
}

.captwiki-ptabs--vertical .captwiki-ptabs__nav {
	flex-direction: column;
	flex: 0 0 220px;
	gap: 4px;
}

.captwiki-ptabs--vertical .captwiki-ptabs__tab {
	width: 100%;
	text-align: left;
}

.captwiki-ptabs--vertical .captwiki-ptabs__panels {
	flex: 1 1 auto;
	min-width: 0;
}

/* Accordion layout. */
.captwiki-ptabs__item {
	border-bottom: 1px solid #e5e7eb;
}

.captwiki-ptabs__acc-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	margin: 0;
	padding: 16px 4px;
	border: none;
	background: transparent;
	color: #1f2937;
	font-size: 16px;
	font-weight: 600;
	text-align: left;
	cursor: pointer;
}

.captwiki-ptabs__acc-icon {
	position: relative;
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
}

.captwiki-ptabs__acc-icon::before,
.captwiki-ptabs__acc-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 2px;
	background: currentColor;
	transform: translate( -50%, -50% );
	transition: transform 0.25s ease;
}

.captwiki-ptabs__acc-icon::after {
	transform: translate( -50%, -50% ) rotate( 90deg );
}

.captwiki-ptabs__acc-header.is-active .captwiki-ptabs__acc-icon::after {
	transform: translate( -50%, -50% ) rotate( 0deg );
}

.captwiki-ptabs__acc-panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.3s ease;
}

.captwiki-ptabs__acc-panel.is-active {
	grid-template-rows: 1fr;
}

.captwiki-ptabs__acc-panel > .captwiki-ptabs__acc-panel-inner {
	overflow: hidden;
	min-height: 0;
}

.captwiki-ptabs__acc-panel-inner {
	padding: 4px 4px 20px;
}

/* WooCommerce content normalisation inside panels. */
.captwiki-ptabs__panel > h2:first-child,
.captwiki-ptabs__acc-panel-inner > h2:first-child {
	margin-top: 0;
}

.captwiki-ptabs__panel > :last-child,
.captwiki-ptabs__acc-panel-inner > :last-child {
	margin-bottom: 0;
}

.captwiki-ptabs .shop_attributes {
	width: 100%;
	border-collapse: collapse;
}

.captwiki-ptabs .shop_attributes th,
.captwiki-ptabs .shop_attributes td {
	padding: 8px 12px;
	border: 1px solid #e5e7eb;
	text-align: left;
	vertical-align: top;
}

.captwiki-ptabs .shop_attributes th {
	background: #f9fafb;
	width: 30%;
}

/* Editor notice. */
.captwiki-ptabs--notice {
	display: block;
	padding: 14px 16px;
	border: 1px dashed #c3c4c7;
	border-radius: 6px;
	background: #f6f7f7;
	color: #50575e;
	text-align: center;
	font-size: 13px;
}

.captwiki-ptabs--notice p {
	margin: 0;
}
