/**
 * WooCommerce Product Info Tabs — frontend styles.
 *
 * Design tokens taken from the reference screens:
 *   gold #FFB300 · surface #000000 · icon-on-gold #3F2C00
 *   ~square cards, ~15px radius on a 100px card, icon only.
 *
 * All colours are CSS custom properties so a theme can re-skin the
 * block by overriding the .wc-pitabs scope.
 */

.wc-pitabs {
	--pitabs-gold: #ffb300;
	--pitabs-gold-soft: rgba( 255, 179, 0, 0.16 );
	--pitabs-surface: #000000;
	--pitabs-surface-2: #141414;
	--pitabs-ink: #ffffff;
	--pitabs-icon-on-gold: #3f2c00;
	--pitabs-radius: 16px;
	--pitabs-radius-sm: 12px;
	--pitabs-border: 2px;
	--pitabs-gap: 12px;
	--pitabs-card-size: 88px;
	--pitabs-font: inherit;

	direction: ltr;
	margin: 24px 0;
	font-family: var( --pitabs-font );
	color: var( --pitabs-ink );
}

.wc-pitabs.is-rtl {
	direction: rtl;
}

/* ------------------------------------------------------------------ *
 * Tab bar — horizontal, horizontal-scroll on small screens.
 * ------------------------------------------------------------------ */
.wc-pitabs__nav {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	gap: var( --pitabs-gap );
	overflow-x: auto;
	overflow-y: hidden;
	padding: 4px 2px 10px;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
	-webkit-overflow-scrolling: touch;
}

.wc-pitabs__nav::-webkit-scrollbar {
	height: 6px;
}
.wc-pitabs__nav::-webkit-scrollbar-thumb {
	background: var( --pitabs-gold-soft );
	border-radius: 99px;
}
.wc-pitabs__nav::-webkit-scrollbar-track {
	background: transparent;
}

/* The tab card: icon only. */
.wc-pitabs__tab {
	flex: 0 0 auto;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var( --pitabs-card-size );
	aspect-ratio: 1 / 1;
	padding: 0;
	border: var( --pitabs-border ) solid var( --pitabs-gold );
	border-radius: var( --pitabs-radius );
	background: var( --pitabs-surface );
	color: var( --pitabs-gold );
	cursor: pointer;
	scroll-snap-align: start;
	transition: background-color 0.18s ease, color 0.18s ease,
		transform 0.18s ease, box-shadow 0.18s ease;
}

.wc-pitabs__tab:hover {
	transform: translateY( -2px );
	box-shadow: 0 6px 18px -8px rgba( 255, 179, 0, 0.65 );
}

.wc-pitabs__tab:focus-visible {
	outline: 2px solid var( --pitabs-gold );
	outline-offset: 3px;
}

/* Active tab: gold card, dark icon — per the reference. */
.wc-pitabs__tab.is-active {
	background: var( --pitabs-gold );
	color: var( --pitabs-icon-on-gold );
	cursor: default;
	box-shadow: 0 8px 22px -10px rgba( 255, 179, 0, 0.8 );
}

.wc-pitabs__tab.is-active:hover {
	transform: none;
}

.wc-pitabs__tab svg {
	width: 50%;
	height: 50%;
	max-width: 40px;
	max-height: 40px;
	flex: none;
	pointer-events: none;
}

/* ------------------------------------------------------------------ *
 * Content container — gold border, rounded, title lives inside.
 * ------------------------------------------------------------------ */
.wc-pitabs__panel {
	margin-top: calc( var( --pitabs-gap ) + 2px );
	padding: 20px;
	border: var( --pitabs-border ) solid var( --pitabs-gold );
	border-radius: var( --pitabs-radius );
	background: var( --pitabs-surface );
}

.wc-pitabs__panel[hidden] {
	display: none;
}

.wc-pitabs__title {
	margin: 0 0 16px;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.4;
	color: var( --pitabs-gold );
}

.wc-pitabs__content > :last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ *
 * Tab 1 — podcast: full-width audio player.
 * ------------------------------------------------------------------ */
.wc-pitabs-podcast {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wc-pitabs-podcast__player {
	width: 100%;
	min-width: 0;
}

.wc-pitabs-podcast__download {
	align-self: flex-start;
	padding: 8px 16px;
	border: 1px solid var( --pitabs-gold );
	border-radius: var( --pitabs-radius-sm );
	color: var( --pitabs-gold );
	font-size: 0.85rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.wc-pitabs-podcast__download:hover {
	background: var( --pitabs-gold );
	color: var( --pitabs-icon-on-gold );
}

/* ------------------------------------------------------------------ *
 * Tab 2 — indicator cards: auto-fit grid (count = filled fields).
 * ------------------------------------------------------------------ */
.wc-pitabs-cards {
	display: grid;
	grid-template-columns: repeat( auto-fit, minmax( 140px, 1fr ) );
	gap: 12px;
}

.wc-pitabs-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 16px 10px;
	border: 1px solid var( --pitabs-gold-soft );
	border-radius: var( --pitabs-radius-sm );
	background: var( --pitabs-surface-2 );
	text-align: center;
}

.wc-pitabs-card__icon {
	display: flex;
	color: var( --pitabs-gold );
	line-height: 0;
}

.wc-pitabs-card__label {
	font-size: 0.78rem;
	color: #b9b9b9;
}

.wc-pitabs-card__value {
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.2;
	color: var( --pitabs-ink );
}

.wc-pitabs-card__unit {
	font-size: 0.75rem;
	font-weight: 600;
	color: var( --pitabs-gold );
}

/* ------------------------------------------------------------------ *
 * Tab 3 — guide cards: one row on desktop, stacked on mobile.
 * ------------------------------------------------------------------ */
.wc-pitabs-guides {
	display: grid;
	grid-template-columns: repeat( 3, minmax( 0, 1fr ) );
	gap: 12px;
}

.wc-pitabs-guide {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	padding: 18px 12px;
	border: 1px solid var( --pitabs-gold-soft );
	border-radius: var( --pitabs-radius-sm );
	background: var( --pitabs-surface-2 );
	color: var( --pitabs-ink );
	text-decoration: none;
	transition: border-color 0.18s ease, transform 0.18s ease,
		background-color 0.18s ease;
}

.wc-pitabs-guide:hover {
	transform: translateY( -2px );
	border-color: var( --pitabs-gold );
	background: var( --pitabs-gold-soft );
}

.wc-pitabs-guide__icon {
	display: flex;
	color: var( --pitabs-gold );
	line-height: 0;
}

.wc-pitabs-guide__label {
	font-size: 0.9rem;
	font-weight: 700;
	text-align: center;
}

.wc-pitabs-guide__action {
	font-size: 0.75rem;
	font-weight: 600;
	color: var( --pitabs-gold );
}

/* ------------------------------------------------------------------ *
 * Responsive.
 * ------------------------------------------------------------------ */
@media ( max-width: 768px ) {
	.wc-pitabs-guides {
		grid-template-columns: 1fr;
	}

	.wc-pitabs-cards {
		grid-template-columns: repeat( auto-fit, minmax( 120px, 1fr ) );
	}

	.wc-pitabs__panel {
		padding: 16px;
	}
}

/* ------------------------------------------------------------------ *
 * Custom (Elementor) tab content — let Elementor styles breathe.
 * ------------------------------------------------------------------ */
.wc-pitabs__content .elementor {
	/* Elementor prints its own section widths; keep them inside. */
	max-width: 100%;
}
