/* ==========================================================================
   Golden Catálogo — estilos del frontend
   Hereda tokens del kit Elementor con fallbacks de Golden Health
   ========================================================================== */

.g-cat-app {
	--g-primary:    var(--e-global-color-primary, #004AAD);
	--g-secondary:  var(--e-global-color-secondary, #EEBA2B);
	--g-ink:        var(--e-global-color-1397ccc, #000C1D);
	--g-muted:      var(--e-global-color-d49ac81, #868686);
	--g-border:     var(--e-global-color-4d462f5, #DCDCDE);
	--g-bg:         #ffffff;
	--g-bg-soft:    #F7F9FC;
	--g-success:    #1DB561;
	--g-quote:      #B35900;
	--g-ff-body:    var(--e-global-typography-text-font-family, inherit);
	--g-ff-head:    var(--e-global-typography-primary-font-family, var(--g-ff-body));

	max-width: 1600px;
	margin: 0 auto;
	padding: 1.5em;
	box-sizing: border-box;
	font-family: var(--g-ff-body);
	color: var(--g-ink);
}

/* Forzar 1600 sobre containers de Elementor */
body.page .e-con-boxed:has(.g-cat-app),
body.page .e-con-boxed:has(.g-cat-app) > .e-con-inner,
body.page .e-con:has(.g-cat-app),
body.page .e-con:has(.g-cat-app) > .e-con-inner {
	max-width: 1600px !important;
	width: 100% !important;
}

.g-cat-app *,
.g-cat-app *::before,
.g-cat-app *::after {
	box-sizing: border-box;
}

.g-cat-app a {
	text-decoration: none;
	color: inherit;
}

/* ─── HEADER ─────────────────────────────────────────────────────── */
.g-cat-head {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
	align-items: flex-end;
	justify-content: space-between;
	padding-bottom: 1em;
	margin-bottom: 1.5em;
	border-bottom: 2px solid var(--g-secondary);
}

.g-cat-head-text { flex: 1 1 320px; }

.g-cat-title {
	font-family: var(--g-ff-head);
	color: var(--g-primary);
	font-size: clamp(1.6em, 2.4vw, 2.2em);
	margin: 0 0 .25em;
	line-height: 1.15;
}

.g-cat-note {
	color: var(--g-muted);
	font-size: .92em;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	gap: .8em 1.2em;
	align-items: center;
}

.g-cat-counter {
	display: inline-block;
	background: var(--g-bg-soft);
	color: var(--g-ink);
	padding: 4px 10px;
	font-weight: 600;
	font-size: .9em;
	border-radius: 0;
	border: 1px solid var(--g-border);
}

.g-cat-head-actions {
	display: flex;
	gap: .6em;
	flex-wrap: wrap;
}

.g-cat-btn {
	display: inline-flex;
	align-items: center;
	gap: .55em;
	height: 46px;
	padding: 0 18px;
	font-family: var(--g-ff-head);
	font-weight: 700;
	font-size: .9em;
	letter-spacing: .2px;
	border: 0;
	border-radius: 0;
	box-sizing: border-box;
	cursor: pointer;
	transition: background .15s ease, opacity .15s ease, transform .1s ease;
}

.g-cat-btn--pdf  { background: var(--g-primary);   color: #fff !important; }
.g-cat-btn--cart { background: var(--g-secondary); color: var(--g-ink) !important; }
.g-cat-btn:hover { opacity: .9; }
.g-cat-btn:active { transform: translateY(1px); }
.g-cat-btn svg { flex: 0 0 auto; }

/* ─── LAYOUT 1 + 4 ───────────────────────────────────────────────── */
.g-cat-layout {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: 2em;
	align-items: start;
}

.g-cat-sidebar {
	position: sticky;
	top: 80px;
	max-height: calc(100vh - 100px);
	overflow-y: auto;
	overflow-x: hidden;
	padding-right: 6px;
	scrollbar-width: thin;
}

.g-cat-sidebar::-webkit-scrollbar      { width: 6px; }
.g-cat-sidebar::-webkit-scrollbar-thumb { background: var(--g-border); }

/* ─── SIDEBAR blocks ─────────────────────────────────────────────── */
.g-cat-block {
	padding: 14px 0;
	border-bottom: 1px solid var(--g-border);
}
.g-cat-block:first-child { padding-top: 0; }
.g-cat-block:last-of-type { border-bottom: 0; }

.g-cat-block-title {
	display: block;
	font-family: var(--g-ff-head);
	font-weight: 700;
	font-size: .78em;
	letter-spacing: .8px;
	text-transform: uppercase;
	color: var(--g-primary);
	margin-bottom: .65em;
}

.g-cat-search-wrap {
	position: relative;
}
.g-cat-search-wrap svg {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	color: var(--g-muted);
	pointer-events: none;
}
#g-cat-search {
	width: 100%;
	height: 46px;
	padding: 0 12px 0 34px;
	border: 1px solid var(--g-border);
	border-radius: 0;
	box-sizing: border-box;
	font-family: var(--g-ff-body);
	font-size: .92em;
	background: var(--g-bg);
}
#g-cat-search:focus {
	outline: 2px solid var(--g-primary);
	outline-offset: 1px;
	border-color: var(--g-primary);
}

.g-cat-select {
	width: 100%;
	height: 46px;
	padding: 0 12px;
	border: 1px solid var(--g-border);
	border-radius: 0;
	box-sizing: border-box;
	background: var(--g-bg);
	font-family: var(--g-ff-body);
	font-size: .92em;
	color: var(--g-ink);
	cursor: pointer;
}
.g-cat-select:focus { outline: 2px solid var(--g-primary); outline-offset: 1px; }

/* Toggle vista (segmented control) */
.g-cat-view-toggle {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	border: 1px solid var(--g-border);
}
.g-cat-view-toggle button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .4em;
	height: 46px;
	padding: 0 6px;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-sizing: border-box;
	font-family: var(--g-ff-body);
	font-size: .82em;
	color: var(--g-muted);
	cursor: pointer;
	transition: background .12s ease, color .12s ease;
}
.g-cat-view-toggle button + button { border-left: 1px solid var(--g-border); }
.g-cat-view-toggle button.is-active {
	background: var(--g-primary);
	color: #fff;
}

.g-cat-radio-group,
.g-cat-check {
	display: flex;
	flex-direction: column;
	gap: .5em;
	font-size: .9em;
	color: var(--g-ink);
}
.g-cat-radio-group label,
.g-cat-check {
	display: flex;
	align-items: center;
	gap: .55em;
	cursor: pointer;
}
.g-cat-radio-group input[type="radio"],
.g-cat-check input[type="checkbox"] {
	accent-color: var(--g-primary);
	margin: 0;
}

.g-cat-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.g-cat-chip {
	display: inline-flex;
	align-items: center;
	gap: .35em;
	height: 46px;
	padding: 0 14px;
	font-family: var(--g-ff-body);
	font-size: .82em;
	background: var(--g-bg);
	color: var(--g-ink);
	border: 1px solid var(--g-border);
	border-radius: 0;
	box-sizing: border-box;
	cursor: pointer;
	transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.g-cat-chip:hover { border-color: var(--g-primary); }
.g-cat-chip.is-active {
	background: var(--g-primary);
	color: #fff;
	border-color: var(--g-primary);
}
.g-cat-chip-count {
	font-weight: 600;
	font-size: .9em;
	opacity: .75;
}

/* Índice categorías */
.g-cat-index {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.g-cat-index a {
	display: flex;
	justify-content: space-between;
	align-items: center;
	height: 46px;
	padding: 0 10px;
	font-size: .88em;
	color: var(--g-ink);
	border-left: 3px solid transparent;
	box-sizing: border-box;
	transition: background .12s ease, border-color .12s ease, color .12s ease;
}
.g-cat-index a:hover {
	background: var(--g-bg-soft);
	border-left-color: var(--g-secondary);
}
.g-cat-index a.is-current {
	background: var(--g-bg-soft);
	border-left-color: var(--g-primary);
	color: var(--g-primary);
	font-weight: 600;
}
.g-cat-index-count {
	font-size: .82em;
	color: var(--g-muted);
	background: var(--g-bg);
	padding: 1px 6px;
	border: 1px solid var(--g-border);
}
.g-cat-index a.is-current .g-cat-index-count {
	border-color: var(--g-primary);
	color: var(--g-primary);
}

/* Reset button */
.g-cat-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 1em;
	height: 46px;
	padding: 0 14px;
	background: transparent;
	border: 1px solid var(--g-border);
	border-radius: 0;
	box-sizing: border-box;
	color: var(--g-muted);
	font-family: var(--g-ff-body);
	font-size: .85em;
	cursor: pointer;
	transition: all .12s ease;
}
.g-cat-reset:hover {
	background: var(--g-ink);
	color: #fff;
	border-color: var(--g-ink);
}
.g-cat-reset.is-active {
	border-color: var(--g-primary);
	color: var(--g-primary);
}

/* ─── MAIN ───────────────────────────────────────────────────────── */
.g-cat-status {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-bottom: 12px;
	margin-bottom: 18px;
	border-bottom: 1px solid var(--g-border);
	font-size: .9em;
	color: var(--g-muted);
}
.g-cat-result-count strong { color: var(--g-ink); }
.g-cat-no-results {
	padding: 60px 20px;
	text-align: center;
	font-size: 1.05em;
	color: var(--g-muted);
}

.g-cat-section {
	margin: 0 0 2.5em;
}
.g-cat-section.is-hidden { display: none; }

.g-cat-section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 1.2em;
	padding-bottom: .5em;
	border-bottom: 1px solid var(--g-border);
}
.g-cat-section-head h2 {
	font-family: var(--g-ff-head);
	color: var(--g-primary);
	font-size: clamp(1.15em, 1.8vw, 1.4em);
	margin: 0;
	line-height: 1.2;
	scroll-margin-top: 90px;
}
.g-cat-section-count {
	font-size: .85em;
	color: var(--g-muted);
}

/* ─── GRID ───────────────────────────────────────────────────────── */
.g-cat-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 18px;
}

/* ─── CARD (vista grid) ──────────────────────────────────────────── */
.g-cat-card {
	display: flex;
	flex-direction: column;
	background: var(--g-bg);
	border: 1px solid var(--g-border);
	transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
	overflow: hidden;
	position: relative;
}
.g-cat-card.is-hidden { display: none; }
.g-cat-card:hover {
	border-color: var(--g-primary);
	box-shadow: 0 6px 18px rgba(0,12,29,.08);
	transform: translateY(-2px);
}

.g-cat-card-media {
	display: block;
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	background: #ffffff;
	border-bottom: 1px solid var(--g-border);
	overflow: hidden;
}
.g-cat-card-media img {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 12px;
	transition: transform .25s ease;
}
.g-cat-card:hover .g-cat-card-media img { transform: scale(1.04); }

/* Badges */
.g-cat-badge {
	display: inline-flex;
	align-items: center;
	gap: .3em;
	font-family: var(--g-ff-head);
	font-size: .68em;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .6px;
	padding: 3px 8px;
	white-space: nowrap;
}
.g-cat-badge--invima {
	position: absolute;
	top: 8px;
	left: 8px;
	background: var(--g-success);
	color: #fff;
	z-index: 1;
}
.g-cat-badge--brand {
	background: transparent;
	color: var(--g-secondary);
	padding: 0;
	margin-bottom: 4px;
	font-size: .7em;
}

.g-cat-card-body {
	display: flex;
	flex-direction: column;
	padding: 14px;
	gap: 6px;
	flex: 1;
}

.g-cat-card-title {
	font-family: var(--g-ff-head);
	font-size: .98em;
	font-weight: 700;
	line-height: 1.25;
	margin: 0;
	color: var(--g-ink);
}
.g-cat-card-title a { color: inherit; }
.g-cat-card-title a:hover { color: var(--g-primary); }

.g-cat-card-modelo {
	font-size: .8em;
	color: var(--g-muted);
	margin: 0;
}
.g-cat-card-modelo span {
	font-weight: 700;
	color: var(--g-ink);
}

.g-cat-card-excerpt {
	font-size: .82em;
	color: var(--g-muted);
	line-height: 1.45;
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.g-cat-card-price {
	margin-top: auto;
	padding-top: 8px;
	font-size: 1.08em;
}
.g-cat-price-amount {
	display: inline-block;
	font-family: var(--g-ff-head);
	font-weight: 800;
	color: var(--g-primary);
}
.g-cat-price-amount .woocommerce-Price-amount,
.g-cat-price-amount bdi { color: var(--g-primary); }
.g-cat-price-quote {
	font-weight: 700;
	color: var(--g-quote);
	font-size: .92em;
}

.g-cat-card-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 6px;
	height: 46px;
	padding: 0 14px;
	text-align: center;
	font-family: var(--g-ff-head);
	font-weight: 700;
	font-size: .85em;
	letter-spacing: .3px;
	text-transform: uppercase;
	color: #fff !important;
	border-radius: 0;
	box-sizing: border-box;
	transition: opacity .15s ease, transform .1s ease;
}
.g-cat-card-cta:hover  { opacity: .9; }
.g-cat-card-cta:active { transform: translateY(1px); }
.g-cat-card-cta--buy   { background: var(--g-primary); }
.g-cat-card-cta--quote { background: var(--g-success); }

/* ─── VISTA LISTA ────────────────────────────────────────────────── */
.g-cat-app[data-view="list"] .g-cat-grid {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.g-cat-app[data-view="list"] .g-cat-card {
	display: grid;
	grid-template-columns: 160px 1fr auto;
	align-items: stretch;
	gap: 0;
}
.g-cat-app[data-view="list"] .g-cat-card-media {
	aspect-ratio: 1 / 1;
	height: 100%;
	width: 160px;
	border-bottom: 0;
	border-right: 1px solid var(--g-border);
}
.g-cat-app[data-view="list"] .g-cat-card-body {
	padding: 16px 20px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.g-cat-app[data-view="list"] .g-cat-card-excerpt {
	-webkit-line-clamp: 3;
}
.g-cat-app[data-view="list"] .g-cat-card-price {
	font-size: 1.2em;
}
.g-cat-app[data-view="list"] .g-cat-card-cta {
	align-self: center;
	min-width: 200px;
	height: 46px;
	margin: 16px 20px 16px 0;
}

/* ─── FLAT MODE (cuando hay filtro o sort no-default) ─────────────── */
.g-cat-app.is-flat .g-cat-section-head { display: none; }
.g-cat-app.is-flat .g-cat-section { margin-bottom: 0; }
.g-cat-app.is-flat .g-cat-grid {
	margin-bottom: 18px;
}

/* ─── BACK TO TOP ─────────────────────────────────────────────────── */
.g-cat-back-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	width: 46px;
	height: 46px;
	background: var(--g-primary);
	color: #fff;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0,12,29,.2);
	z-index: 50;
	transition: opacity .2s ease, transform .2s ease;
	opacity: 0;
	transform: translateY(8px);
}
.g-cat-back-top.is-visible {
	opacity: 1;
	transform: translateY(0);
}
.g-cat-back-top:hover { background: var(--g-ink); }

/* ─── TOAST ──────────────────────────────────────────────────────── */
.g-cat-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(12px);
	background: var(--g-ink);
	color: #fff;
	padding: 12px 18px;
	font-size: .92em;
	display: inline-flex;
	gap: 14px;
	align-items: center;
	box-shadow: 0 6px 18px rgba(0,12,29,.25);
	z-index: 60;
	opacity: 0;
	transition: opacity .25s ease, transform .25s ease;
}
.g-cat-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}
.g-cat-toast-cta {
	color: var(--g-secondary) !important;
	font-weight: 700;
	text-decoration: underline !important;
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 1200px) {
	.g-cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 980px) {
	.g-cat-layout {
		grid-template-columns: 1fr;
		gap: 1em;
	}
	.g-cat-sidebar {
		position: static;
		max-height: none;
		overflow: visible;
		padding: 1em;
		border: 1px solid var(--g-border);
		background: var(--g-bg-soft);
	}
	.g-cat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
	.g-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
	.g-cat-app[data-view="list"] .g-cat-card {
		grid-template-columns: 100px 1fr;
	}
	.g-cat-app[data-view="list"] .g-cat-card-media { width: 100px; }
	.g-cat-app[data-view="list"] .g-cat-card-cta {
		grid-column: 1 / -1;
		margin: 0 14px 14px;
	}
	.g-cat-head { flex-direction: column; align-items: stretch; }
	.g-cat-head-actions { width: 100%; }
	.g-cat-btn { flex: 1; justify-content: center; }
}
@media (max-width: 440px) {
	.g-cat-grid { grid-template-columns: 1fr; }
}
