/* FoxTech Product Manager — frontend styles
   Every selector is prefixed .fpm- to avoid clashing with the theme.
   Colors are exposed as CSS variables so a theme/child-theme can
   override them without editing this file. */

:root {
	--fpm-accent: #1f5fa8;
	--fpm-text: #1d2327;
	--fpm-muted: #646970;
	--fpm-border: #e2e4e7;
	--fpm-bg-soft: #f6f7f8;
	--fpm-radius: 10px;
}

.fpm-page * {
	box-sizing: border-box;
}

.fpm-container {
	max-width: 80%;
	margin: 0 auto;
	padding: 0 20px;
}

.fpm-single-product-page .fpm-container {
	max-width: 100%;
}

/* ---------- Page hero ---------- */

.fpm-page-hero {
	position: relative;
	background-color: #5b6470;
	background-size: cover;
	background-position: center;
	color: #fff;
	padding: 48px 20px;
	text-align: center;
	overflow: hidden;
	/* Full-width bleed: breaks the hero out of the theme's normal content
	   container (which usually has a max-width), regardless of how deep
	   that container is nested, without needing to touch the theme. */
	width: 100vw;
	max-width: 100vw;
	margin-left: calc( 50% - 50vw );
	margin-right: calc( 50% - 50vw );
	box-sizing: border-box;
}

/* Only add the darkening scrim when a custom breadcrumb image is set
   (category/shop settings) — the plain color background is already
   readable on its own. */
.fpm-page-hero-image::before {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(15, 30, 50, 0.55);
}

.fpm-page-hero-inner {
	position: relative;
	z-index: 1;
}

.fpm-page-title {
	font-size: 2rem;
	margin: 0 0 8px;
	color: #fff;
}

.fpm-page-hero .woocommerce-breadcrumb {
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.9rem;
}

/* ---------- Layout ---------- */

.fpm-layout-with-sidebar {
	display: flex;
	align-items: flex-start;
	gap: 32px;
	padding: 32px 20px 60px;
}

.fpm-sidebar-col {
	flex: 0 0 260px;
}

.fpm-main-col {
	flex: 1 1 0;
	min-width: 0;
}

@media ( max-width: 782px ) {
	.fpm-layout-with-sidebar {
		flex-direction: column;
	}

	.fpm-sidebar-col {
		flex-basis: auto;
		width: 100%;
	}
}

/* ---------- Sidebar accordion ---------- */

.fpm-sidebar {
	background: #fff;
	border: 1px solid var(--fpm-border);
	border-radius: var(--fpm-radius);
	overflow: hidden;
}

.fpm-sidebar-heading {
	font-weight: 700;
	padding: 14px 16px;
	border-bottom: 1px solid var(--fpm-border);
	display: flex;
	align-items: center;
	gap: 8px;
}

.fpm-sidebar-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fpm-sidebar-sub {
	padding-left: 14px;
	background: var(--fpm-bg-soft);
}

.fpm-sidebar-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.fpm-sidebar-link {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	padding: 10px 16px;
	color: var(--fpm-text);
	text-decoration: none;
	font-size: 0.94rem;
}

.fpm-sidebar-icon {
	width: 20px;
	height: 20px;
	object-fit: contain;
	flex-shrink: 0;
}

.fpm-sidebar-item.is-active > .fpm-sidebar-row > .fpm-sidebar-link {
	color: var(--fpm-accent);
	font-weight: 700;
}

.fpm-sidebar-toggle {
	background: var(--fpm-bg-soft);
	border: 1px solid var(--fpm-border);
	border-radius: 50%;
	width: 24px;
	height: 24px;
	min-width: 24px;
	margin-right: 10px;
	cursor: pointer;
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.fpm-sidebar-toggle::before {
	content: "\25BE"; /* ▾ down chevron */
	display: block;
	font-size: 12px;
	line-height: 1;
	color: var(--fpm-muted);
	transform: rotate( 0deg );
	transition: transform 0.15s ease;
}

.fpm-sidebar-item.is-open > .fpm-sidebar-row > .fpm-sidebar-toggle::before {
	transform: rotate( 180deg );
}

.fpm-sidebar-item + .fpm-sidebar-item {
	border-top: 1px solid var(--fpm-border);
}

/* Desktop (default): subcategories start expanded — click the chevron
   to collapse a branch if you want to. */
.fpm-sidebar-sub {
	display: block;
}

/* Mobile: parents collapse by default; tapping the chevron (or landing
   on the page inside a given category) expands that branch. */
@media ( max-width: 782px ) {
	.fpm-sidebar-sub {
		display: none;
	}

	.fpm-sidebar-item.is-open > .fpm-sidebar-sub {
		display: block;
	}
}

/* Manual overrides set by JS when the chevron is clicked — always win,
   on any screen size, over whichever default applies above. */
.fpm-sidebar-item.fpm-force-closed > .fpm-sidebar-sub {
	display: none !important;
}

.fpm-sidebar-item.fpm-force-open > .fpm-sidebar-sub {
	display: block !important;
}

/* ---------- Category grid (subcategory cards) ---------- */

.fpm-category-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 200px, 1fr ) );
	gap: 20px;
}

@media ( max-width: 600px ) {
	.fpm-category-grid {
		grid-template-columns: repeat( 2, 1fr );
		gap: 12px;
	}

	.fpm-category-card {
		padding: 18px 10px;
	}
}

.fpm-category-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	text-align: center;
	background: #fff;
	border: 1px solid var(--fpm-border);
	border-radius: var(--fpm-radius);
	padding: 28px 16px;
	text-decoration: none;
	color: var(--fpm-text);
	font-weight: 600;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.fpm-category-card:hover {
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
	transform: translateY( -2px );
}

.fpm-category-card-icon {
	width: 64px;
	height: 64px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fpm-category-card-icon img {
	max-width: 100%;
	max-height: 100%;
}

.fpm-category-card-icon-placeholder {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--fpm-bg-soft);
	border: 2px solid var(--fpm-border);
	display: block;
}

/* ---------- Product grid ---------- */

.fpm-product-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 24px;
}

.fpm-product-grid.fpm-columns-2 { grid-template-columns: repeat( 2, 1fr ); }
.fpm-product-grid.fpm-columns-3 { grid-template-columns: repeat( 3, 1fr ); }
.fpm-product-grid.fpm-columns-4 { grid-template-columns: repeat( 4, 1fr ); }
.fpm-product-grid.fpm-columns-5 { grid-template-columns: repeat( 5, 1fr ); }

.fpm-product-card {
	background: #fff;
	border: 1px solid var(--fpm-border);
	border-radius: var(--fpm-radius);
	overflow: hidden;
	transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.fpm-product-card:hover {
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
	transform: translateY( -2px );
}

.fpm-product-card-link {
	display: block;
	padding: 18px;
	text-decoration: none;
	color: var(--fpm-text);
}

.fpm-product-card-image img {
	width: 100%;
	height: auto;
	display: block;
	margin-bottom: 12px;
}

.fpm-product-card-title {
	font-size: 1rem;
	margin: 0 0 4px;
	border-bottom: 2px solid var(--fpm-accent);
	display: inline-block;
	padding-bottom: 4px;
}

.fpm-product-card-meta {
	color: var(--fpm-muted);
	font-size: 0.85rem;
	margin: 4px 0;
}

.fpm-product-card-price {
	font-weight: 700;
	margin-top: 6px;
}

/* ---------- Single product ---------- */

.fpm-product-top {
	display: flex;
	gap: 40px;
	flex-wrap: wrap;
	margin-bottom: 40px;
}

.fpm-product-gallery-col {
	flex: 1 1 320px;
	max-width: 480px;
}

.fpm-product-summary-col {
	flex: 1 1 280px;
	min-width: 260px;
}

.fpm-product-breadcrumb-trail {
	color: var(--fpm-muted);
	font-size: 0.85rem;
	margin-bottom: 4px;
}

.fpm-product-title {
	margin: 0 0 12px;
	font-size: 1.9rem;
}

.fpm-bullet-features {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.fpm-bullet-features li {
	position: relative;
	padding-left: 20px;
	margin-bottom: 6px;
	color: var(--fpm-text);
}

.fpm-bullet-features li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 8px;
	width: 8px;
	height: 8px;
	background: var(--fpm-accent);
	border-radius: 50%;
}

.fpm-product-short-desc {
	margin-bottom: 20px;
	color: var(--fpm-text);
}

/* Gallery */

.fpm-gallery-main {
	position: relative;
	border: 1px solid var(--fpm-border);
	border-radius: var(--fpm-radius);
	overflow: hidden;
	background: #fff;
}

.fpm-gallery-slide {
	display: none;
}

.fpm-gallery-slide.is-active {
	display: block;
}

.fpm-gallery-image,
.fpm-gallery-slide img {
	width: 100%;
	height: auto;
	display: block;
}

.fpm-gallery-arrow {
	position: absolute;
	top: 50%;
	transform: translateY( -50% );
	background: rgba(255, 255, 255, 0.9);
	border: 1px solid var(--fpm-border);
	border-radius: 50%;
	width: 36px;
	height: 36px;
	cursor: pointer;
}

.fpm-gallery-prev { left: 12px; }
.fpm-gallery-next { right: 12px; }

.fpm-gallery-thumbs {
	display: flex;
	gap: 10px;
	margin-top: 10px;
	flex-wrap: wrap;
}

.fpm-gallery-thumb {
	padding: 0;
	border: 2px solid transparent;
	border-radius: 6px;
	overflow: hidden;
	background: none;
	cursor: pointer;
	width: 64px;
	height: 64px;
}

.fpm-gallery-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.fpm-gallery-thumb.is-active {
	border-color: var(--fpm-accent);
}

/* Feature icons */

.fpm-feature-icons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 16px 0;
}

.fpm-feature-icon {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	width: 88px;
	padding: 10px 6px;
	border: 1px solid var(--fpm-border);
	border-radius: 8px;
	background: var(--fpm-bg-soft);
	font-size: 0.75rem;
	font-weight: 600;
	gap: 6px;
}

.fpm-feature-icon-image img {
	max-width: 32px;
	max-height: 32px;
}

/* ---------- Tabs ---------- */

.fpm-tabs {
	margin-top: 20px;
}

.fpm-tabs-nav {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin: 0;
	padding: 0;
	border-bottom: 1px solid var(--fpm-border);
}

.fpm-tabs-nav li a {
	display: block;
	padding: 12px 20px;
	text-decoration: none;
	color: var(--fpm-text);
	font-weight: 600;
}

.fpm-tabs-nav li.is-active a {
	background: var(--fpm-accent);
	color: #fff;
}

.fpm-tab-panel {
	display: none;
	padding: 24px 4px;
}

.fpm-tab-panel.is-active {
	display: block;
}

/* Technical data table */

.fpm-tech-data-search {
	display: flex;
	align-items: center;
	gap: 8px;
	justify-content: flex-end;
	margin-bottom: 12px;
}

.fpm-tech-data-table {
	width: 100%;
	border-collapse: collapse;
}

.fpm-tech-data-table th,
.fpm-tech-data-table td {
	text-align: left;
	padding: 10px 14px;
	border: 1px solid var(--fpm-border);
}

.fpm-tech-data-table tr.is-even {
	background: var(--fpm-bg-soft);
}

/* Accessories */

.fpm-accessories-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 160px, 1fr ) );
	gap: 20px;
}

.fpm-accessory-card {
	text-align: center;
}

.fpm-accessory-card a {
	text-decoration: none;
	color: var(--fpm-text);
}

.fpm-accessory-image img {
	max-width: 100%;
	height: auto;
}

.fpm-accessory-title {
	font-weight: 600;
	margin-top: 8px;
}

.fpm-accessory-desc {
	color: var(--fpm-muted);
	font-size: 0.85rem;
}

/* Video */

.fpm-videos {
	display: grid;
	grid-template-columns: repeat( 2, 1fr );
	gap: 32px 24px;
}

@media ( max-width: 782px ) {
	.fpm-videos {
		grid-template-columns: 1fr;
	}
}

.fpm-video-wrap {
	position: relative;
}

.fpm-video-frame {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
}

.fpm-video-title {
	margin: 10px 0 0;
	font-weight: 600;
	text-align: center;
}

/* Downloads */

.fpm-downloads {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
}

.fpm-download-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 18px;
	background: linear-gradient( 180deg, #6b7280, #4b5563 );
	color: #fff;
	border-radius: 6px;
	text-decoration: none;
	font-weight: 700;
	letter-spacing: 0.02em;
}

.fpm-download-ext {
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	padding: 2px 6px;
	font-size: 0.7rem;
}

/* Related products */

.fpm-related-products {
	margin-top: 48px;
}

.fpm-section-title {
	margin-bottom: 20px;
}

.fpm-no-products {
	color: var(--fpm-muted);
}
