/* ==========================================================================
   LabDiamond — front-end styles (plugin)
   Covers: single-product Specificații table, Cele 4C explainer, certificate
   link, sticky mobile add-to-cart bar, and the cookie-consent banner.

   Palette: base #FAF9F7  contrast #1A1A1A  accent #C5A572
            platinum #E7E3DC  platinum-dark #9A958C  white #FFFFFF
   Where available, theme.json color/font tokens (--wp--preset--*) are used
   with literal fallbacks so the styles hold even if a token is unavailable.
   ========================================================================== */

/* ==========================================================================
   1. Specificații table
   ========================================================================== */

.ldd-specs {
	margin-block: 2.5rem;
}

.ldd-specs__title,
.ldd-4c__title {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem);
	font-weight: 600;
	color: #1A1A1A;
	margin: 0 0 1rem;
	letter-spacing: .01em;
}

.ldd-specs__table {
	width: 100%;
	border-collapse: collapse;
	font-family: "Inter", system-ui, sans-serif;
	font-size: .95rem;
}

.ldd-specs__row {
	border-bottom: 1px solid #E7E3DC;
}
.ldd-specs__row:last-child {
	border-bottom: 0;
}

.ldd-specs__label {
	text-align: left;
	font-weight: 500;
	color: #9A958C;
	padding: .7rem 1rem .7rem 0;
	width: 45%;
	white-space: nowrap;
	vertical-align: top;
}

.ldd-specs__value {
	color: #1A1A1A;
	padding: .7rem 0;
	vertical-align: top;
}

/* Certificate line */
.ldd-specs__cert {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: .5rem;
	margin-top: 1.25rem;
	font-family: "Inter", system-ui, sans-serif;
	font-size: .95rem;
}
.ldd-specs__cert-label {
	color: #9A958C;
}
.ldd-specs__cert-number {
	color: #1A1A1A;
	font-weight: 500;
}
.ldd-specs__cert-link {
	color: #C5A572;
	text-decoration: none;
	font-weight: 600;
	border-bottom: 1px solid currentColor;
	padding-bottom: 1px;
}
.ldd-specs__cert-link:hover,
.ldd-specs__cert-link:focus-visible {
	color: #1A1A1A;
}
.ldd-specs__cert-link:focus-visible {
	outline: 2px solid #C5A572;
	outline-offset: 3px;
}

/* ==========================================================================
   2. Cele 4C explainer
   ========================================================================== */

.ldd-4c {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid #E7E3DC;
}
.ldd-4c__intro {
	font-family: "Inter", system-ui, sans-serif;
	color: #1A1A1A;
	max-width: 60ch;
	margin: 0 0 1.5rem;
	line-height: 1.6;
}
.ldd-4c__list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.25rem;
	margin: 0;
}
@media (min-width: 600px) {
	.ldd-4c__list {
		grid-template-columns: 1fr 1fr;
	}
}
.ldd-4c__item {
	background: #FFFFFF;
	border: 1px solid #E7E3DC;
	border-radius: 6px;
	padding: 1.1rem 1.25rem;
}
.ldd-4c__term {
	font-family: "Cormorant Garamond", Georgia, serif;
	font-size: 1.2rem;
	font-weight: 600;
	color: #1A1A1A;
	margin: 0 0 .35rem;
}
.ldd-4c__desc {
	font-family: "Inter", system-ui, sans-serif;
	font-size: .9rem;
	line-height: 1.55;
	color: #9A958C;
	margin: 0;
}

/* Screen-reader-only utility (used by the cert "PDF, new tab" note). */
.ldd-specs .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   3. Sticky mobile add-to-cart bar
   Shown only <= 781px AND only once .is-visible is set by sticky-atc.js.
   ========================================================================== */

.ldd-sticky-atc {
	display: none;
}

@media (max-width: 781px) {
	.ldd-sticky-atc {
		display: flex;
		align-items: center;
		gap: .75rem;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9000;
		padding: .65rem 1rem calc(.65rem + env(safe-area-inset-bottom, 0px));
		background: #FFFFFF;
		border-top: 1px solid #E7E3DC;
		box-shadow: 0 -4px 16px rgba(26, 26, 26, .08);

		/* Hidden until revealed: slide down + non-interactive. */
		transform: translateY(110%);
		opacity: 0;
		visibility: hidden;
		transition: transform .25s ease, opacity .25s ease, visibility .25s ease;
	}

	.ldd-sticky-atc.is-visible {
		transform: translateY(0);
		opacity: 1;
		visibility: visible;
	}

	.ldd-sticky-atc__info {
		display: flex;
		flex-direction: column;
		min-width: 0;
		flex: 1 1 auto;
		line-height: 1.2;
	}

	.ldd-sticky-atc__title {
		font-family: "Inter", system-ui, sans-serif;
		font-size: .85rem;
		color: #1A1A1A;
		font-weight: 500;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.ldd-sticky-atc__price {
		font-family: "Inter", system-ui, sans-serif;
		font-size: .8rem;
		color: #9A958C;
	}
	.ldd-sticky-atc__price del {
		opacity: .6;
		margin-right: .25rem;
	}

	.ldd-sticky-atc__button {
		flex: 0 0 auto;
		appearance: none;
		border: 0;
		border-radius: 4px;
		background: #C5A572;
		color: #1A1A1A;
		font-family: "Inter", system-ui, sans-serif;
		font-weight: 600;
		font-size: .95rem;
		padding: .7rem 1.25rem;
		min-height: 44px; /* WCAG target size. */
		cursor: pointer;
	}

	.ldd-sticky-atc__button:hover {
		background: #b8965f;
	}

	.ldd-sticky-atc__button:focus-visible {
		outline: 2px solid #1A1A1A;
		outline-offset: 2px;
	}

	.ldd-sticky-atc.is-disabled .ldd-sticky-atc__button,
	.ldd-sticky-atc__button:disabled {
		background: #E7E3DC;
		color: #9A958C;
		cursor: not-allowed;
	}
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.ldd-sticky-atc {
		transition: none;
	}
}

/* ==========================================================================
   4. Cookie-consent banner
   Self-contained, accessible, brand-tokened. Hidden until revealed by JS.
   ========================================================================== */

.lddc-consent {
	position: fixed;
	inset-inline: 0;
	inset-block-end: 0;
	z-index: 9999;
	background: var(--wp--preset--color--contrast, #1A1A1A);
	color: var(--wp--preset--color--base, #FAF9F7);
	box-shadow: 0 -2px 24px rgba(0, 0, 0, 0.25);
	font-family: var(--wp--preset--font-family--body, "Inter", sans-serif);
}

.lddc-consent[hidden] {
	display: none;
}

.lddc-consent__inner {
	max-width: 1280px;
	margin-inline: auto;
	padding: 1rem 1.25rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.lddc-consent__text {
	flex: 1 1 24rem;
	min-width: 0;
}

.lddc-consent__title {
	margin: 0 0 0.25rem;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.3;
}

.lddc-consent__desc {
	margin: 0;
	font-size: 0.875rem;
	line-height: 1.5;
	color: var(--wp--preset--color--platinum, #E7E3DC);
}

.lddc-consent__link {
	color: var(--wp--preset--color--accent, #C5A572);
	text-decoration: underline;
	margin-inline-start: 0.25rem;
}

.lddc-consent__actions {
	display: flex;
	gap: 0.5rem;
	flex: 0 0 auto;
}

.lddc-consent__btn {
	font: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	padding: 0.6rem 1.1rem;
	border-radius: 2px;
	cursor: pointer;
	border: 1px solid transparent;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.lddc-consent__btn--accept {
	background: var(--wp--preset--color--accent, #C5A572);
	color: var(--wp--preset--color--contrast, #1A1A1A);
}

.lddc-consent__btn--accept:hover {
	background: #b3915f;
}

.lddc-consent__btn--ghost {
	background: transparent;
	color: var(--wp--preset--color--base, #FAF9F7);
	border-color: var(--wp--preset--color--platinum-dark, #9A958C);
}

.lddc-consent__btn--ghost:hover {
	background: rgba(255, 255, 255, 0.08);
}

.lddc-consent__btn:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #C5A572);
	outline-offset: 2px;
}

@media (max-width: 600px) {
	.lddc-consent__inner {
		flex-direction: column;
		align-items: stretch;
	}
	.lddc-consent__actions {
		justify-content: stretch;
	}
	.lddc-consent__btn {
		flex: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.lddc-consent__btn {
		transition: none;
	}
}
