/*
 * Single product page. Shared pieces: page bar, chips, section title (pages.css),
 * related slider (single-post.css), quote modal (pages.css .tipa-contact-modal).
 */

.tipa-product .tipa-page-bar-section {
	border-bottom: 1px solid var(--tipa-green-100);
}

/* Hero: gallery left, summary right */
.tipa-product__hero {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	gap: 56px;
	align-items: start;
	padding-top: 48px;
	padding-bottom: 72px;
}

.tipa-product__hero::before,
.tipa-product__hero::after {
	display: none;
}

/* Gallery */
.tipa-product-gallery__main {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	border: 1px solid var(--tipa-green-100);
	border-radius: 16px;
	background: var(--tipa-green-50);
}

.tipa-product-gallery__slide {
	position: absolute;
	inset: 0;
	display: block;
	cursor: zoom-in;
}

.tipa-product-gallery__slide[hidden] {
	display: none;
}

.tipa-product-gallery__slide.is-video {
	cursor: pointer;
}

.tipa-product-gallery__slide img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tipa-product-gallery__play {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 80px;
	height: 80px;
	border-radius: 50%;
	background: var(--tipa-green);
	box-shadow: 0 0 0 10px rgba(255, 255, 255, .25);
	transform: translate(-50%, -50%);
	transition: background-color .2s ease, transform .2s ease;
}

.tipa-product-gallery__play::before {
	content: "";
	position: absolute;
	left: 52%;
	top: 50%;
	border-top: 12px solid transparent;
	border-bottom: 12px solid transparent;
	border-left: 18px solid var(--tipa-white);
	transform: translate(-50%, -50%);
}

.tipa-product-gallery__slide.is-video:hover .tipa-product-gallery__play {
	background: var(--tipa-green-700);
	transform: translate(-50%, -50%) scale(1.05);
}

.tipa-product-gallery__thumbs {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 12px;
	margin-top: 12px;
}

.tipa-product-gallery__thumb {
	position: relative;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 10px;
	background: var(--tipa-green-50);
	cursor: pointer;
	opacity: .7;
	transition: border-color .2s ease, opacity .2s ease;
}

.tipa-product-gallery__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tipa-product-gallery__thumb:hover,
.tipa-product-gallery__thumb.is-active {
	opacity: 1;
}

.tipa-product-gallery__thumb.is-active {
	border-color: var(--tipa-green);
}

.tipa-product-gallery__thumb.is-video::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 50%;
	border-top: 8px solid transparent;
	border-bottom: 8px solid transparent;
	border-left: 13px solid var(--tipa-white);
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .5));
	transform: translate(-40%, -50%);
}

/* Summary */
.tipa-product__summary {
	position: sticky;
	top: 110px;
}

.tipa-ui .tipa-product__title {
	margin: 0 0 16px;
	color: var(--tipa-ink);
	font-size: 38px;
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -.03em;
}

.tipa-product__excerpt {
	color: var(--tipa-text);
	font-size: 17px;
	line-height: 1.7;
}

.tipa-product__excerpt p:last-child {
	margin-bottom: 0;
}

.tipa-ui .tipa-product__quote.button.primary {
	margin: 28px 0 0;
	padding: 0 32px;
	min-height: 50px;
	border-radius: 99px;
	font-size: 16px;
	font-weight: 600;
	line-height: 50px;
}

.tipa-ui .tipa-product__quote.button.primary:hover {
	background: var(--tipa-green-700) !important;
}

.tipa-product__cats {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid var(--tipa-green-100);
}

.tipa-product__cats-label {
	margin: 0 0 12px;
	color: var(--tipa-gray);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.tipa-product__cats .tipa-cat-links {
	justify-content: flex-start;
	margin: 0;
}

.tipa-product__cats .tipa-chip {
	min-height: 36px;
	padding: 0 16px;
	font-size: 14px;
}

/* Tabs */
.tipa-product-tabs {
	padding: 72px 0;
	background: var(--tipa-green-50);
}

.tipa-product-tabs__nav {
	display: flex;
	gap: 8px;
	margin-bottom: 32px;
	border-bottom: 1px solid var(--tipa-green-100);
	overflow-x: auto;
}

.tipa-product-tabs__tab {
	position: relative;
	margin: 0;
	padding: 14px 20px;
	min-height: 0;
	border: 0;
	background: transparent;
	color: var(--tipa-text);
	font-size: 17px;
	font-weight: 600;
	letter-spacing: 0;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color .2s ease;
}

.tipa-product-tabs__tab::after {
	content: "";
	position: absolute;
	left: 20px;
	right: 20px;
	bottom: -1px;
	height: 2px;
	border-radius: 2px;
	background: var(--tipa-green);
	transform: scaleX(0);
	transition: transform .2s ease;
}

.tipa-product-tabs__tab:hover,
.tipa-product-tabs__tab.is-active {
	color: var(--tipa-green);
}

.tipa-product-tabs__tab.is-active::after {
	transform: scaleX(1);
}

.tipa-product-tabs__panel {
	padding: 40px;
	border-radius: 16px;
	background: var(--tipa-white);
	color: var(--tipa-text);
	font-size: 16px;
	line-height: 1.75;
}

.tipa-product-tabs__panel[hidden] {
	display: none;
}

.tipa-ui .tipa-product-tabs__panel h2,
.tipa-ui .tipa-product-tabs__panel h3 {
	margin: 28px 0 12px;
	color: var(--tipa-ink);
	font-size: 21px;
	font-weight: 600;
}

.tipa-product-tabs__panel > :first-child {
	margin-top: 0;
}

.tipa-product-tabs__panel > :last-child {
	margin-bottom: 0;
}

/* Spec tables inside the editor content */
.tipa-product-tabs__panel table {
	width: 100%;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--tipa-green-100);
	border-collapse: separate;
	border-spacing: 0;
	border-radius: 12px;
}

.tipa-product-tabs__panel th,
.tipa-product-tabs__panel td,
.tipa-product-tabs__panel th:first-child,
.tipa-product-tabs__panel td:first-child {
	padding: 14px 20px;
	border: 0;
	border-top: 1px solid var(--tipa-green-100);
	text-align: left;
}

.tipa-product-tabs__panel tr:first-child th,
.tipa-product-tabs__panel tr:first-child td {
	border-top: 0;
}

.tipa-product-tabs__panel tr:nth-child(even) td {
	background: var(--tipa-green-50);
}

.tipa-product-tabs__panel td:first-child,
.tipa-product-tabs__panel th {
	width: 40%;
	color: var(--tipa-ink);
	font-weight: 600;
}

/* Model list: several columns, scrolls sideways on small screens */
.tipa-table-scroll {
	margin-top: 16px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.tipa-product-tabs__panel .tipa-table-scroll table {
	min-width: 640px;
}

.tipa-product-tabs__panel .tipa-spec-models th,
.tipa-product-tabs__panel .tipa-spec-models td:first-child {
	width: auto;
	white-space: nowrap;
}

.tipa-product-tabs__panel .tipa-spec-models th {
	background: var(--tipa-green);
	color: var(--tipa-white);
}

.tipa-ui .tipa-product-tabs__panel table + h3,
.tipa-ui .tipa-product-tabs__panel .tipa-table-scroll + h3 {
	margin-top: 40px;
}

/* Practical applications */
.tipa-product-apps {
	padding: 80px 0;
}

.tipa-ui .tipa-product-apps .tipa-section-title {
	margin-bottom: 32px;
}

.tipa-product-apps__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
}

.tipa-app-card {
	overflow: hidden;
	border: 1px solid var(--tipa-green-100);
	border-radius: 16px;
	background: var(--tipa-white);
	transition: box-shadow .3s ease, transform .3s ease;
}

.tipa-app-card:hover {
	box-shadow: 0 18px 40px rgba(15, 43, 12, .10);
	transform: translateY(-4px);
}

.tipa-app-card__media {
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.tipa-app-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.tipa-app-card__body {
	padding: 24px 28px 28px;
}

.tipa-ui .tipa-app-card__title {
	margin: 0 0 8px;
	color: var(--tipa-ink);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.35;
}

.tipa-app-card__text {
	margin: 0;
	color: var(--tipa-text);
	font-size: 15px;
	line-height: 1.65;
}

/* Related products slider: 4 visible */
.tipa-product-related .tipa-product-related__track {
	grid-auto-columns: calc((100% - 90px) / 4);
}

.tipa-product-related .tipa-product-card {
	height: 100%;
}

/* Tablet */
@media (max-width: 849px) {
	.tipa-product__hero { grid-template-columns: 1fr; gap: 32px; padding-top: 32px; padding-bottom: 56px; }
	.tipa-product__summary { position: static; }
	.tipa-ui .tipa-product__title { font-size: 30px; }
	.tipa-product-tabs,
	.tipa-product-apps { padding: 56px 0; }
	.tipa-product-tabs__panel { padding: 28px; }
	.tipa-product-apps__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
	.tipa-product-related .tipa-product-related__track { grid-auto-columns: calc((100% - 30px) / 2.3); }
}

/* Mobile */
@media (max-width: 549px) {
	.tipa-ui .tipa-product__title { font-size: 26px; }
	.tipa-product-gallery__thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
	.tipa-product-tabs__panel { padding: 20px; font-size: 15px; }
	.tipa-product-tabs__tab { padding: 12px 14px; font-size: 15px; }
	.tipa-product-apps__grid { grid-template-columns: 1fr; }
	.tipa-product-related .tipa-product-related__track { grid-auto-columns: 78%; }
	.tipa-product-tabs__panel td:first-child,
	.tipa-product-tabs__panel th { width: auto; }
}
