/**
 * Reconco — cartões de documento descarregável nas tabs de produto.
 */

.rcn-doc {
	--rcn-doc-color: #6d6d6d;

	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 16px;
	margin: 0 0 8px;
	max-width: 520px;
	border: 1px solid var(--brdcolor-gray-300, rgba(0, 0, 0, 0.12));
	border-radius: 6px;
	background: #fff;
	color: inherit !important;
	text-decoration: none !important;
	box-shadow: none;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.rcn-doc:hover,
.rcn-doc:focus-visible {
	border-color: var(--rcn-doc-color);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
}

.rcn-doc:focus-visible {
	outline: 2px solid var(--wd-primary-color, #2271b1);
	outline-offset: 2px;
}

/* Cor por tipo de ficheiro */
.rcn-doc--pdf { --rcn-doc-color: #d93025; }
.rcn-doc--doc { --rcn-doc-color: #2b579a; }
.rcn-doc--xls { --rcn-doc-color: #1d6f42; }
.rcn-doc--ppt { --rcn-doc-color: #c0504d; }
.rcn-doc--zip { --rcn-doc-color: #8a6d3b; }
.rcn-doc--cad { --rcn-doc-color: #6b46c1; }
.rcn-doc--txt { --rcn-doc-color: #5f6368; }

.rcn-doc__icon {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 5px;
	color: var(--rcn-doc-color);
	background: color-mix(in srgb, var(--rcn-doc-color) 10%, transparent);
}

/* Alternativa para browsers sem color-mix() */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
	.rcn-doc__icon {
		background: rgba(0, 0, 0, .05);
	}
}

.rcn-doc__icon svg {
	display: block;
}

.rcn-doc__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rcn-doc__name {
	font-weight: 600;
	line-height: 1.35;
	word-break: break-word;
}

.rcn-doc__meta {
	font-size: 12px;
	line-height: 1.3;
	color: var(--color-gray-500, #767676);
	text-transform: uppercase;
	letter-spacing: .03em;
}

.rcn-doc__arrow {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	color: var(--rcn-doc-color);
	background: color-mix(in srgb, var(--rcn-doc-color) 10%, transparent);
	transition: transform .2s ease, background-color .2s ease, color .2s ease;
}

@supports not (background: color-mix(in srgb, red 10%, transparent)) {
	.rcn-doc__arrow {
		background: rgba(0, 0, 0, .05);
	}
}

.rcn-doc:hover .rcn-doc__arrow,
.rcn-doc:focus-visible .rcn-doc__arrow {
	color: #fff;
	background: var(--rcn-doc-color);
}

/* Abre numa nova janela: a seta sai ligeiramente para fora, em diagonal. */
.rcn-doc--open:hover .rcn-doc__arrow,
.rcn-doc--open:focus-visible .rcn-doc__arrow {
	transform: translate(2px, -2px);
}

/* Descarregar: a seta desce. */
.rcn-doc--download:hover .rcn-doc__arrow,
.rcn-doc--download:focus-visible .rcn-doc__arrow {
	transform: translateY(2px);
}

.rcn-doc__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* O editor envolve cada ligação num <p> — colar os cartões uns aos outros. */
.woocommerce-Tabs-panel p:has(> .rcn-doc) {
	margin: 0 0 8px;
}

.woocommerce-Tabs-panel p:has(> .rcn-doc):last-child {
	margin-bottom: 0;
}

@media (max-width: 480px) {
	.rcn-doc {
		gap: 10px;
		padding: 10px 12px;
	}

	.rcn-doc__icon {
		width: 34px;
		height: 34px;
	}

	.rcn-doc__icon svg {
		width: 20px;
		height: 20px;
	}
}
