/* ==========================================================================
   Atlas Premium — Componentes
   Todo vive bajo .atlas para no interferir con WoodMart.
   ========================================================================== */

.atlas {
	font-family: var(--atlas-font);
	font-stretch: 100%;
	color: var(--atlas-ink);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

.atlas *,
.atlas *::before,
.atlas *::after {
	box-sizing: border-box;
}

.atlas :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure) {
	margin: 0;
	padding: 0;
}

.atlas :where(ul, ol) {
	list-style: none;
}

.atlas :where(h1, h2, h3, h4) {
	font-family: var(--atlas-font);
	color: var(--atlas-ink);
	text-transform: none;
	letter-spacing: 0;
}

.atlas img {
	display: block;
	max-width: 100%;
	height: auto;
}

.atlas a {
	color: inherit;
	text-decoration: none;
}

/* Precios: WoodMart colorea .amount con el color primario; en Atlas heredan. */
.atlas .amount,
.atlas .woocommerce-Price-amount,
.atlas .price {
	color: inherit;
	font-weight: inherit;
	font-size: inherit;
}

/* Texto solo para lectores de pantalla (precios "Precio original…"). */
.atlas .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;
}

.atlas :focus-visible {
	outline: 2px solid var(--atlas-focus);
	outline-offset: 3px;
}

.atlas-container {
	width: 100%;
	max-width: calc(var(--atlas-maxw) + 2 * var(--atlas-gutter));
	margin-inline: auto;
	padding-inline: var(--atlas-gutter);
}

.atlas-section {
	position: relative;
	padding-block: var(--atlas-section);
	background: var(--atlas-surface);
	color: var(--atlas-ink);
}

/* --- Encabezado de sección ---------------------------------------------- */

.atlas-head {
	display: grid;
	grid-template-columns: repeat(12, minmax(0, 1fr));
	column-gap: var(--atlas-col-gap);
	row-gap: var(--atlas-s-5);
	align-items: end;
	margin-bottom: clamp(40px, 5vw, 80px);
}

.atlas-head > .atlas-head__title {
	grid-column: 1 / span 8;
}

.atlas-head__title,
.atlas .atlas-head__title {
	font-size: var(--atlas-fs-2xl);
	font-stretch: var(--atlas-condensed);
	font-weight: 700;
	line-height: var(--atlas-lh-head);
	letter-spacing: -0.005em;
	text-transform: uppercase;
	text-wrap: balance;
}

.atlas-head__side {
	grid-column: 9 / span 4;
	display: grid;
	gap: var(--atlas-s-4);
	justify-items: start;
	padding-bottom: 0.4em;
}

.atlas-head__intro {
	font-size: var(--atlas-fs-md);
	line-height: var(--atlas-lh-body);
	color: var(--atlas-ink-2);
	max-width: 36ch;
}

@media (max-width: 900px) {
	.atlas-head > .atlas-head__title,
	.atlas-head__side {
		grid-column: 1 / -1;
	}
}

/* --- Botones -------------------------------------------------------------- */

.atlas-btn,
.atlas .atlas-btn {
	--btn-bg: var(--atlas-ink);
	--btn-fg: var(--atlas-surface);
	--btn-bd: var(--atlas-ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: var(--atlas-btn-h);
	padding: 0 26px;
	border: 1px solid var(--btn-bd);
	border-radius: var(--atlas-radius);
	background: var(--btn-bg);
	color: var(--btn-fg);
	font-family: var(--atlas-font);
	font-size: var(--atlas-fs-xs);
	font-stretch: 100%;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: none;
	transition: background-color var(--atlas-dur-fast) linear, color var(--atlas-dur-fast) linear, border-color var(--atlas-dur-fast) linear;
}

.atlas-btn:hover,
.atlas .atlas-btn:hover {
	--btn-bg: var(--atlas-emerald);
	--btn-bd: var(--atlas-emerald);
	--btn-fg: var(--atlas-white);
	color: var(--btn-fg);
}

.atlas-btn--secondary,
.atlas .atlas-btn--secondary,
.atlas-btn--whatsapp,
.atlas .atlas-btn--whatsapp {
	--btn-bg: transparent;
	--btn-fg: var(--atlas-ink);
	--btn-bd: var(--atlas-line-strong);
}

.atlas-btn--secondary:hover,
.atlas .atlas-btn--secondary:hover,
.atlas-btn--whatsapp:hover,
.atlas .atlas-btn--whatsapp:hover {
	--btn-bg: var(--atlas-ink);
	--btn-fg: var(--atlas-surface);
	--btn-bd: var(--atlas-ink);
}

.atlas-btn--ghost,
.atlas .atlas-btn--ghost {
	--btn-bg: transparent;
	--btn-fg: var(--atlas-ink);
	--btn-bd: transparent;
	padding-inline: 12px;
}

.atlas-btn--ghost:hover,
.atlas .atlas-btn--ghost:hover {
	--btn-bg: transparent;
	--btn-fg: var(--atlas-emerald);
	--btn-bd: transparent;
}

.atlas-btn--light,
.atlas .atlas-btn--light {
	--btn-bg: var(--atlas-white);
	--btn-fg: var(--atlas-black);
	--btn-bd: var(--atlas-white);
}

.atlas-btn--light:hover,
.atlas .atlas-btn--light:hover {
	--btn-bg: var(--atlas-metal);
	--btn-bd: var(--atlas-metal);
	--btn-fg: var(--atlas-black);
}

.atlas-btn--ghost-light,
.atlas .atlas-btn--ghost-light {
	--btn-bg: transparent;
	--btn-fg: var(--atlas-white);
	--btn-bd: rgba(245, 243, 238, 0.45);
}

.atlas-btn--ghost-light:hover,
.atlas .atlas-btn--ghost-light:hover {
	--btn-bg: var(--atlas-white);
	--btn-fg: var(--atlas-black);
	--btn-bd: var(--atlas-white);
}

.atlas-btn--sm,
.atlas .atlas-btn--sm {
	min-height: var(--atlas-btn-h-sm);
	padding: 0 16px;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
}

.atlas-btn .atlas-wa-icon {
	flex: none;
}

.atlas-btn[hidden] {
	display: none !important;
}

.atlas-btn:disabled,
.atlas .atlas-btn:disabled {
	opacity: 0.32;
	cursor: not-allowed;
	pointer-events: none;
}

/* --- Enlaces -------------------------------------------------------------- */

.atlas-link,
.atlas .atlas-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: var(--atlas-fs-sm);
	font-weight: 500;
	color: var(--atlas-ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
	text-decoration-color: var(--atlas-line-strong);
	transition: text-decoration-color var(--atlas-dur-fast) linear, color var(--atlas-dur-fast) linear;
}

.atlas-link:hover,
.atlas .atlas-link:hover {
	color: var(--atlas-ink);
	text-decoration-color: currentColor;
}

.atlas-link--arrow {
	text-decoration: none;
	font-weight: 600;
}

.atlas-link--arrow .atlas-arrow {
	transition: transform var(--atlas-dur) var(--atlas-ease);
}

.atlas-link--arrow:hover .atlas-arrow {
	transform: translateX(4px);
}

/* --- Tarjeta de producto -------------------------------------------------- */

.atlas-grid--products {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(28px, 3vw, 48px) var(--atlas-col-gap);
}

.atlas-card {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.atlas-card__media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 5;
	background: var(--atlas-well);
	overflow: hidden;
}

.atlas-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--atlas-dur-slow) var(--atlas-ease);
}

.atlas-card:hover .atlas-card__media img {
	transform: scale(1.04);
}

.atlas-card__flag {
	position: absolute;
	top: 12px;
	left: 12px;
	padding: 6px 10px;
	background: var(--atlas-emerald);
	color: var(--atlas-white);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.atlas-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 6px;
	padding-top: 18px;
}

.atlas-card__brand {
	font-size: var(--atlas-fs-xs);
	font-weight: 600;
	color: var(--atlas-ink-2);
}

.atlas-card__title,
.atlas .atlas-card__title {
	font-size: var(--atlas-fs-md);
	font-stretch: var(--atlas-semicondensed);
	font-weight: 600;
	line-height: 1.2;
	text-wrap: balance;
}

.atlas-card__title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

.atlas-card__price {
	font-size: var(--atlas-fs-base);
	font-weight: 500;
	font-variant-numeric: tabular-nums;
}

.atlas-card__price del {
	color: var(--atlas-ink-2);
	font-weight: 400;
	margin-right: 6px;
}

.atlas-card__price ins {
	text-decoration: none;
}

.atlas-card__currency {
	font-size: 0.75rem;
	color: var(--atlas-ink-2);
}

.atlas-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 14px;
	font-size: var(--atlas-fs-xs);
	color: var(--atlas-ink-2);
}

.atlas-card__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 18px;
	margin-top: auto;
	padding-top: 14px;
}

/* Al añadir por AJAX WooCommerce inserta "Ver carrito": lo alineamos. */
.atlas-card__actions .added_to_cart {
	font-size: var(--atlas-fs-sm);
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 0.3em;
}

.atlas-card__actions .atlas-btn.loading {
	opacity: 0.6;
	pointer-events: none;
}

.atlas-card--compact .atlas-card__media {
	aspect-ratio: 1;
}

/* --- Inventario ------------------------------------------------------------ */

.atlas-stock {
	display: inline-flex;
	align-items: center;
	gap: 7px;
}

.atlas-stock::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--atlas-ok);
}

.atlas-stock--low::before { background: var(--atlas-warn); }
.atlas-stock--backorder::before { background: var(--atlas-metal); }
.atlas-stock--out::before { background: var(--atlas-error); }

/* --- Elección (radio como tarjeta) --------------------------------------- */

.atlas-choice {
	position: relative;
	display: block;
	cursor: pointer;
}

.atlas-choice input {
	position: absolute;
	opacity: 0;
	inset: 0;
	margin: 0;
	cursor: pointer;
}

.atlas-choice span {
	display: flex;
	align-items: center;
	min-height: 64px;
	padding: 16px 20px;
	border: 1px solid var(--atlas-line-strong);
	border-radius: var(--atlas-radius);
	background: transparent;
	font-size: var(--atlas-fs-base);
	font-weight: 500;
	line-height: 1.3;
	transition: background-color var(--atlas-dur-fast) linear, border-color var(--atlas-dur-fast) linear, color var(--atlas-dur-fast) linear;
}

.atlas-choice:hover span {
	border-color: var(--atlas-ink);
}

.atlas-choice input:checked + span {
	background: var(--atlas-emerald);
	border-color: var(--atlas-emerald);
	color: var(--atlas-white);
}

.atlas-choice input:focus-visible + span {
	outline: 2px solid var(--atlas-focus);
	outline-offset: 3px;
}

/* --- Panel de compra en la ficha de producto ------------------------------ */

.atlas-buy-panel {
	margin: 24px 0 28px;
	border-top: 1px solid var(--atlas-line);
	font-family: var(--atlas-font);
}

.atlas-buy-panel__list {
	margin: 0;
}

.atlas-buy-panel__row {
	display: grid;
	grid-template-columns: 96px 1fr;
	gap: 16px;
	padding: 14px 0;
	border-bottom: 1px solid var(--atlas-line);
	font-size: var(--atlas-fs-sm);
	line-height: 1.45;
}

.atlas-buy-panel__row dt {
	font-weight: 600;
	color: var(--atlas-ink);
}

.atlas-buy-panel__row dd {
	margin: 0;
	color: var(--atlas-ink-2);
}

.atlas-buy-panel__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 20px;
	padding-top: 18px;
}

.atlas-pdp-brand {
	margin: 0 0 8px;
	font-family: var(--atlas-font);
	font-size: var(--atlas-fs-sm);
	font-weight: 600;
	color: var(--atlas-ink-2);
}

.atlas-anchor {
	display: block;
	position: relative;
	top: -120px;
	visibility: hidden;
}

/* --- Movimiento reducido -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.atlas *,
	.atlas *::before,
	.atlas *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

@media (max-width: 1100px) {
	.atlas-grid--products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.atlas-grid--products {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 28px 12px;
	}
	.atlas-card__title,
	.atlas .atlas-card__title {
		font-size: var(--atlas-fs-base);
	}
	.atlas-card__actions {
		flex-direction: column;
		align-items: stretch;
	}
	.atlas-card__actions .atlas-btn {
		width: 100%;
		padding-inline: 10px;
		white-space: normal;
		text-align: center;
	}
}
