/**
 * Manum Shortcodes — Woodmart-compatible styles.
 *
 * All colors and visual tokens use Woodmart CSS custom properties
 * with safe fallbacks so these shortcodes blend perfectly into
 * the active Woodmart configuration.
 *
 * @since 1.1.0
 */

/* =================================================================
   SHARED / BASE
   ================================================================= */

.manum-shortcode {
	font-family: inherit;
	line-height: 1.6;
	color: var(--wd-text-color, #333);
}

.manum-shortcode-empty {
	padding: 20px;
	text-align: center;
	background: var(--wd-bg-color-light, #f7f7f7);
	border-radius: var(--wd-radius, 4px);
	color: var(--wd-text-color-light, #777);
}

/* Section headings */
.manum-section-title {
	font-size: 22px;
	margin: 0 0 20px;
	padding-left: 15px;
	border-left: 4px solid var(--wd-primary-color, #83b735);
	color: var(--wd-header-color, #333);
}

.manum-section-icon {
	margin-right: 8px;
	vertical-align: middle;
	color: var(--wd-primary-color, #83b735);
}

/* Buttons */
.manum-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border-radius: var(--wd-radius, 4px);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	border: none;
	transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.manum-btn-primary {
	background-color: var(--wd-primary-color, #83b735);
	color: #fff;
}

.manum-btn-primary:hover {
	background-color: var(--wd-btn-color-hover, #6a9a2a);
	color: #fff;
}

.manum-btn-secondary {
	background-color: var(--wd-bg-color-light, #f7f7f7);
	color: var(--wd-link-color, #333);
	border: 1px solid var(--wd-bordered-color, #e0e0e0);
}

.manum-btn-secondary:hover {
	background-color: var(--wd-primary-color, #83b735);
	color: #fff;
	border-color: var(--wd-primary-color, #83b735);
}

/* Search input */
.manum-search-input {
	width: 100%;
	max-width: 400px;
	padding: 10px 15px;
	border: 1px solid var(--wd-form-brd-color, #ddd);
	border-radius: var(--wd-radius, 4px);
	font-size: 14px;
	color: var(--wd-text-color, #333);
	background: var(--wd-bg-color, #fff);
	transition: border-color 0.25s ease;
}

.manum-search-input:focus {
	outline: none;
	border-color: var(--wd-primary-color, #83b735);
	box-shadow: 0 0 0 2px rgba(131, 183, 53, 0.15);
}

/* Count badges */
.manum-errores-count,
.manum-averias-count,
.manum-recambios-count {
	font-size: 13px;
	color: var(--wd-text-color-light, #777);
	margin-bottom: 15px;
}

/* =================================================================
   FICHA CARD
   ================================================================= */

.manum-modelo-ficha-card {
	display: flex;
	flex-direction: column;
	background: var(--wd-bg-color, #fff);
	border: 1px solid var(--wd-bordered-color, #e0e0e0);
	border-radius: var(--wd-radius, 4px);
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.manum-modelo-ficha-card:hover {
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.manum-ficha-thumbnail {
	overflow: hidden;
	background: var(--wd-bg-color-light, #f7f7f7);
}

.manum-ficha-thumbnail img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.manum-modelo-ficha-card:hover .manum-ficha-thumbnail img {
	transform: scale(1.03);
}

.manum-ficha-content {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.manum-ficha-title {
	font-size: 18px;
	margin: 0 0 12px;
	color: var(--wd-header-color, #333);
}

.manum-ficha-title a {
	color: var(--wd-link-color, #333);
	text-decoration: none;
	transition: color 0.2s ease;
}

.manum-ficha-title a:hover {
	color: var(--wd-link-color-hover, var(--wd-primary-color, #83b735));
}

.manum-ficha-meta {
	margin-bottom: 12px;
	font-size: 13px;
	color: var(--wd-text-color-light, #777);
}

.manum-ficha-meta span {
	display: inline-block;
	margin-right: 15px;
	margin-bottom: 4px;
}

.manum-ficha-meta strong {
	color: var(--wd-text-color, #333);
}

.manum-ficha-desc {
	font-size: 14px;
	color: var(--wd-text-color-light, #666);
	margin-bottom: 15px;
	flex: 1;
}

.manum-ficha-actions {
	margin-top: auto;
	padding-top: 10px;
}

/* =================================================================
   SPECS TABLE
   ================================================================= */

.manum-specs-group-title {
	font-size: 16px;
	font-weight: 600;
	color: var(--wd-header-color, #333);
	margin: 20px 0 12px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--wd-bordered-color, #e0e0e0);
}

.manum-specs-group-title:first-child {
	margin-top: 0;
}

.manum-tech-specs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 15px;
	margin-bottom: 20px;
}

.manum-tech-spec {
	padding: 15px;
	background: var(--wd-bg-color-light, #f7f7f7);
	border-radius: var(--wd-radius-s, 3px);
	border-left: 3px solid var(--wd-primary-color, #83b735);
}

.manum-tech-spec dt {
	font-weight: 600;
	color: var(--wd-header-color, #333);
	margin-bottom: 4px;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.manum-tech-spec dd {
	color: var(--wd-text-color, #555);
	margin: 0;
	font-size: 15px;
	font-weight: 500;
}

.manum-specs-obs-content {
	padding: 15px;
	background: var(--wd-bg-color-light, #f7f7f7);
	border-radius: var(--wd-radius-s, 3px);
	color: var(--wd-text-color, #555);
	font-size: 14px;
}

/* =================================================================
   MANUALES
   ================================================================= */

.manum-manuals-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.manum-manual-item {
	padding: 18px;
	background: var(--wd-bg-color-light, #f7f7f7);
	border-radius: var(--wd-radius, 4px);
	margin-bottom: 12px;
	display: flex;
	align-items: center;
	gap: 15px;
	transition: background-color 0.2s ease;
}

.manum-manual-item:hover {
	background: var(--wd-bg-color, #fff);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.manum-manual-icon svg {
	display: block;
}

.manum-manual-info {
	flex: 1;
}

.manum-manual-info h4 {
	margin: 0 0 4px;
	font-size: 15px;
	color: var(--wd-header-color, #333);
}

.manum-manual-langs {
	margin: 0 0 2px;
	color: var(--wd-text-color-light, #777);
	font-size: 13px;
}

.manum-manual-filename {
	margin: 0;
	color: var(--wd-text-color-light, #999);
	font-size: 12px;
	font-family: monospace;
}

.manum-manual-download {
	flex-shrink: 0;
}

/* =================================================================
   ERROR CODES
   ================================================================= */

.manum-errores-search {
	margin-bottom: 20px;
}

.manum-error-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.manum-error-item {
	padding: 20px;
	background: #fff5f5;
	border-left: 4px solid var(--wd-primary-color, #d63638);
	border-radius: var(--wd-radius-s, 3px);
	margin-bottom: 15px;
	transition: opacity 0.2s ease;
}

.manum-error-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 10px;
}

.manum-error-code {
	font-weight: 700;
	font-size: 18px;
	color: #d63638;
	font-family: monospace;
}

.manum-error-unidad {
	display: inline-block;
	padding: 2px 10px;
	background: var(--wd-bg-color-light, #f0f0f0);
	border-radius: var(--wd-radius-s, 3px);
	font-size: 12px;
	color: var(--wd-text-color-light, #666);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.manum-error-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--wd-header-color, #333);
	margin-bottom: 8px;
}

.manum-error-detail {
	color: var(--wd-text-color-light, #666);
	font-size: 14px;
	margin-bottom: 12px;
}

.manum-error-leds {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.manum-leds-label {
	font-size: 12px;
	font-weight: 600;
	color: var(--wd-text-color-light, #777);
	text-transform: uppercase;
}

.manum-led-indicator {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 10px;
	background: var(--wd-bg-color, #fff);
	border: 1px solid var(--wd-bordered-color, #e0e0e0);
	border-radius: var(--wd-radius-s, 3px);
	font-size: 12px;
}

.manum-led-color {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	display: inline-block;
	flex-shrink: 0;
}

.manum-led-color.rojo     { background: #d63638; }
.manum-led-color.verde    { background: #00a32a; }
.manum-led-color.naranja  { background: #f0860a; }
.manum-led-color.amarillo { background: #dba617; }
.manum-led-color.azul     { background: #2271b1; }

.manum-led-text {
	color: var(--wd-text-color, #555);
}

.manum-errores-no-results {
	text-align: center;
	color: var(--wd-text-color-light, #777);
	padding: 20px;
}

/* Hide filtered-out errors */
.manum-error-item.manum-hidden {
	display: none;
}

/* =================================================================
   AVERIAS (FAILURES)
   ================================================================= */

.manum-failure-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.manum-failure-item {
	padding: 20px;
	background: var(--wd-bg-color-light, #f7f7f7);
	border-radius: var(--wd-radius, 4px);
	margin-bottom: 15px;
	position: relative;
}

.manum-failure-number {
	position: absolute;
	top: 15px;
	right: 15px;
	font-size: 12px;
	font-weight: 700;
	color: var(--wd-text-color-light, #aaa);
	background: var(--wd-bg-color, #fff);
	padding: 2px 8px;
	border-radius: var(--wd-radius-s, 3px);
}

.manum-failure-symptoms h4 {
	font-size: 14px;
	font-weight: 600;
	color: #d63638;
	margin: 0 0 6px;
}

.manum-failure-cause h4,
.manum-failure-recommendations h4 {
	font-size: 14px;
	font-weight: 600;
	color: var(--wd-header-color, #333);
	margin: 12px 0 6px;
}

.manum-failure-symptoms p,
.manum-failure-cause p,
.manum-failure-recommendations p {
	margin: 0;
	font-size: 14px;
	color: var(--wd-text-color, #555);
}

.manum-failure-related-errors {
	margin-top: 12px;
}

.manum-failure-related-errors h4 {
	font-size: 13px;
	font-weight: 600;
	color: var(--wd-header-color, #333);
	margin: 0 0 6px;
}

.manum-related-error-tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.manum-error-tag {
	display: inline-block;
	padding: 3px 10px;
	background: #ffe4e4;
	color: #d63638;
	border-radius: var(--wd-radius-s, 3px);
	font-size: 12px;
	font-weight: 600;
	font-family: monospace;
}

/* =================================================================
   RECAMBIOS (SPARE PARTS) — Flat list + products panel
   ================================================================= */

/* Hint text */
.manum-recambios-hint {
	font-size: 12px;
	color: var(--wd-text-color-light, #999);
	font-style: italic;
}

/* --- Scrollable list --- */
.manum-recambios-list {
	overflow-y: auto;
	margin-bottom: 0;
	border-top: 1px solid var(--wd-bordered-color, #e0e0e0);
	scrollbar-width: thin;
	scrollbar-color: var(--wd-primary-color, #83b735) transparent;
}

.manum-recambios-list::-webkit-scrollbar {
	width: 4px;
}
.manum-recambios-list::-webkit-scrollbar-track {
	background: transparent;
}
.manum-recambios-list::-webkit-scrollbar-thumb {
	background-color: var(--wd-primary-color, #83b735);
	border-radius: 2px;
}

/* --- Single recambio row: flat line, everything inline --- */
.manum-recambio-row {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 4px;
	cursor: pointer;
	border-bottom: 1px solid var(--wd-bordered-color, #e0e0e0);
	user-select: none;
	flex-wrap: nowrap;
	overflow: hidden;
}

.manum-recambio-row:hover .manum-recambio-name {
	color: var(--wd-primary-color, #83b735);
}

/* Active = only the title text stands out */
.manum-recambio-row.is-active .manum-recambio-name {
	color: var(--wd-primary-color, #83b735);
	font-weight: 700;
}

.manum-recambio-row:focus-visible {
	outline: 2px solid var(--wd-primary-color, #83b735);
	outline-offset: -2px;
}

/* Title */
.manum-recambio-name {
	font-weight: 600;
	font-size: 16px;
	color: var(--wd-header-color, #333);
	white-space: nowrap;
	flex-shrink: 0;
	transition: color 0.15s ease;
}

/* Cart icon */
.manum-recambio-has-products {
	font-size: 13px;
	flex-shrink: 0;
	opacity: 0.4;
	margin-left: auto;
}

.manum-recambio-row.is-active .manum-recambio-has-products {
	opacity: 1;
}

/* --- Products area below the list --- */
.manum-recambios-products-area {
	margin-top: 35px;
	padding-top: 25px;
	border-top: 1px solid var(--wd-bordered-color, #e0e0e0);
	min-height: 40px;
}

.manum-recambio-panel {
	display: none;
	animation: manumFadeIn 0.2s ease;
}

.manum-recambio-panel.is-visible {
	display: block;
}

@keyframes manumFadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.manum-recambio-panel-header {
	margin-bottom: 20px;
}

.manum-recambio-panel-label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--wd-text-color-light, #999);
	margin-bottom: 4px;
}

.manum-recambio-panel-title {
	margin: 0 0 8px;
	font-size: 20px;
	font-weight: 700;
	color: var(--wd-header-color, #333);
	line-height: 1.3;
}

.manum-recambio-panel-title .manum-part-type {
	vertical-align: middle;
	margin-left: 8px;
	position: relative;
	top: -1px;
}

.manum-recambio-panel-refs {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

/* Type badge (shared) */
.manum-part-type {
	display: inline-block;
	padding: 2px 8px;
	background: rgba(131, 183, 53, 0.12);
	color: var(--wd-primary-color, #83b735);
	border-radius: var(--wd-radius-s, 3px);
	font-size: 11px;
	font-weight: 600;
	white-space: nowrap;
	flex-shrink: 0;
}

/* Ref codes (shared, inline) */
.manum-ref-code {
	display: inline-block;
	padding: 1px 6px;
	background: none;
	border: 1px solid var(--wd-bordered-color, #ddd);
	border-radius: var(--wd-radius-s, 3px);
	font-family: monospace;
	font-size: 11px;
	color: var(--wd-text-color-light, #777);
	white-space: nowrap;
	flex-shrink: 0;
}

.manum-part-no-refs {
	color: var(--wd-text-color-light, #999);
	font-size: 13px;
	font-style: italic;
	margin: 0;
}

/* =================================================================
   GRID
   ================================================================= */

.manum-modelo-grid-wrapper .manum-grid-title {
	font-size: 24px;
	margin-bottom: 20px;
	color: var(--wd-header-color, #333);
}

.manum-grid-search {
	margin-bottom: 25px;
}

.manum-grid-search-form {
	display: flex;
	gap: 10px;
	align-items: center;
}

.manum-models-grid {
	display: grid;
	grid-template-columns: repeat(var(--manum-grid-cols, 3), 1fr);
	gap: 25px;
	margin-bottom: 30px;
}

.manum-grid-item .manum-ficha-thumbnail img {
	aspect-ratio: 4/3;
	object-fit: cover;
}

.manum-grid-pagination {
	text-align: center;
	padding: 20px 0;
}

.manum-grid-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	margin: 0 3px;
	border: 1px solid var(--wd-bordered-color, #e0e0e0);
	border-radius: var(--wd-radius-s, 3px);
	background: var(--wd-bg-color, #fff);
	color: var(--wd-text-color, #333);
	text-decoration: none;
	font-size: 14px;
	transition: all 0.2s ease;
}

.manum-grid-pagination .page-numbers:hover {
	background: var(--wd-primary-color, #83b735);
	border-color: var(--wd-primary-color, #83b735);
	color: #fff;
}

.manum-grid-pagination .page-numbers.current {
	background: var(--wd-primary-color, #83b735);
	border-color: var(--wd-primary-color, #83b735);
	color: #fff;
	font-weight: 600;
}

/* =================================================================
   SINGLE (PRODUCT-LIKE LAYOUT)
   Top: Image (left) + Summary (right)
   Bottom: Woodmart native tabs
   ================================================================= */

.manum-single-product-layout {
	padding-top: 30px;
	padding-bottom: 30px;
}

/* --- Product image --- */
.manum-product-image-wrapper {
	position: relative;
	overflow: hidden;
	border-radius: var(--wd-radius, 4px);
	border: 1px solid var(--wd-bordered-color, #e0e0e0);
	background: var(--wd-bg-color, #fff);
}

.manum-product-main-image {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

/* --- Summary --- */
.manum-summary-inner {
	padding-top: 5px;
}

.manum-product-title {
	font-size: 28px;
	line-height: 1.3;
	margin-bottom: 15px;
	color: var(--wd-header-color, #333);
}

/* Meta rows */
.manum-product-meta {
	margin-bottom: 20px;
	padding: 15px 0;
	border-top: 1px solid var(--wd-bordered-color, #e0e0e0);
	border-bottom: 1px solid var(--wd-bordered-color, #e0e0e0);
}

.manum-meta-row {
	display: flex;
	align-items: baseline;
	padding: 6px 0;
}

.manum-meta-label {
	flex: 0 0 100px;
	font-size: 13px;
	font-weight: 600;
	color: var(--wd-text-color-light, #777);
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.manum-meta-value {
	flex: 1;
	font-size: 15px;
	color: var(--wd-header-color, #333);
	font-weight: 500;
}

.manum-meta-value small {
	color: var(--wd-text-color-light, #999);
	font-weight: 400;
}

/* Description */
.manum-product-description {
	margin-bottom: 20px;
	font-size: 14px;
	line-height: 1.7;
	color: var(--wd-text-color, #555);
}

.manum-read-more-link {
	display: inline-block;
	margin-top: 4px;
	font-size: 13px;
	font-weight: 600;
	color: var(--wd-primary-color, #83b735);
	text-decoration: none;
	cursor: pointer;
	transition: color 0.2s ease;
}

.manum-read-more-link:hover {
	color: var(--wd-link-color-hover, #6a9a2a);
	text-decoration: underline;
}

/* Count badges */
.manum-product-counts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.manum-count-badge {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 6px 14px;
	background: var(--wd-bg-color-light, #f7f7f7);
	border: 1px solid var(--wd-bordered-color, #e0e0e0);
	border-radius: 20px;
	font-size: 13px;
	color: var(--wd-text-color-light, #666);
}

.manum-count-badge strong {
	color: var(--wd-primary-color, #83b735);
	font-size: 14px;
}

/* --- Tabs (Woodmart native structure handles styling) --- */
.manum-product-tabs {
	margin-top: 40px;
	clear: both;
}

/* Ensure our tab panels get proper padding like Woodmart product tabs */
.manum-product-tabs .wc-tab-inner {
	padding-top: 20px;
}

/* Make sure shortcodes inside tabs have no extra margins */
.manum-product-tabs .wc-tab-inner > .manum-shortcode {
	margin: 0;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media screen and (max-width: 1024px) {
	.manum-models-grid {
		grid-template-columns: repeat(var(--manum-grid-cols-tablet, 2), 1fr);
	}
}

@media screen and (max-width: 768px) {
	.manum-models-grid {
		grid-template-columns: repeat(var(--manum-grid-cols-mobile, 1), 1fr);
	}

	.manum-tech-specs {
		grid-template-columns: 1fr;
	}

	.manum-section-title {
		font-size: 18px;
	}

	.manum-manual-item {
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
	}

	.manum-manual-download {
		width: 100%;
	}

	.manum-manual-download .manum-btn {
		width: 100%;
		justify-content: center;
	}

	.manum-grid-search-form {
		flex-direction: column;
	}

	.manum-search-input {
		max-width: 100%;
	}

	.manum-error-header {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	/* Single layout mobile */
	.manum-product-title {
		font-size: 22px;
	}


	.manum-product-counts {
		gap: 6px;
	}

	.manum-count-badge {
		font-size: 12px;
		padding: 5px 10px;
	}
}

@media screen and (max-width: 480px) {
	.manum-modelo-ficha-card {
		border-radius: var(--wd-radius-s, 3px);
	}

	.manum-ficha-content {
		padding: 15px;
	}

	.manum-failure-item,
	.manum-recambio-row,
	.manum-error-item {
		padding: 15px;
	}

	.manum-meta-label {
		flex: 0 0 80px;
		font-size: 12px;
	}

	/* Recambios mobile */
	.manum-recambios-hint {
		display: none;
	}

	.manum-recambio-name {
		font-size: 13px;
	}

	.manum-recambio-panel-header {
		flex-wrap: wrap;
	}

	.manum-recambio-panel-title {
		font-size: 14px;
	}
}
