/**
 * AJ Shop — front-end styles.
 *
 * Card grid adapted from aj-events (.aj-ev-card*) so the shop matches the rest
 * of the site. Tokens read the block theme's presets with hard fallbacks for
 * the classic Neve theme.
 */

.aj-sh-template,
.aj-sh-cards,
.aj-sh-buy,
.aj-sh-order {
	--aj-ink: var(--wp--preset--color--ink, #14202e);
	--aj-paper: var(--wp--preset--color--paper, #faf6ee);
	--aj-blue: var(--wp--preset--color--brand-blue, #0592ce);
	--aj-red: var(--wp--preset--color--brand-red, #ff1d27);
	--aj-line: rgba(20, 32, 46, 0.12);
	--aj-muted: #5a6672;
	--aj-radius: 14px;
}

/* ---------------------------------------------------------------------------
 * Container
 *
 * Mirrors the theme's own content container so plugin templates line up with
 * the rest of the site. Neve publishes its customiser width as `--container` on
 * <body> and applies it as `.container { max-width: var(--container) }` with
 * 15px gutters — tracking that variable means the shop follows the setting
 * instead of drifting from a hardcoded number. The fallback is Neve's default.
 * ------------------------------------------------------------------------ */

.aj-sh-container {
	width: 100%;
	max-width: var(--container, 1170px);
	margin-inline: auto;
	padding-left: 15px;
	padding-right: 15px;
	box-sizing: border-box;
}

.aj-sh-template {
	padding: 2rem 0 4rem;
}

/* ---------------------------------------------------------------------------
 * Card grid
 * ------------------------------------------------------------------------ */

.aj-sh-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 1.1rem;
	margin: 1rem 0;
}

.aj-sh-card {
	display: flex;
	flex-direction: column;
	border: 1px solid var(--aj-line, rgba(20, 32, 46, 0.12));
	border-radius: var(--aj-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	background: #fff;
	transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.aj-sh-card:hover {
	box-shadow: 0 10px 26px rgba(20, 32, 46, 0.12);
	transform: translateY(-2px);
	border-color: transparent;
}

.aj-sh-card.is-sold-out {
	opacity: 0.72;
}

.aj-sh-card__media {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: rgba(20, 32, 46, 0.06);
}

.aj-sh-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.aj-sh-card__flag {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	font-size: 0.62rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #fff;
	background: var(--aj-red);
	padding: 0.18rem 0.5rem;
	border-radius: 999px;
}

.aj-sh-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.9rem;
}

.aj-sh-card__title {
	font-weight: 700;
	line-height: 1.25;
	transition: color 0.12s;
}

.aj-sh-card:hover .aj-sh-card__title {
	color: var(--aj-blue, #0592ce);
}

.aj-sh-card__price {
	font-size: 0.82rem;
	font-weight: 700;
	opacity: 0.85;
}

.aj-sh-empty {
	opacity: 0.7;
}

/* ---------------------------------------------------------------------------
 * Product layout
 * ------------------------------------------------------------------------ */

.aj-sh-product {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 2rem;
	align-items: start;
}

@media (max-width: 782px) {
	.aj-sh-product {
		grid-template-columns: minmax(0, 1fr);
	}
}

.aj-sh-product__media img {
	width: 100%;
	height: auto;
	border-radius: var(--aj-radius);
	display: block;
}

.aj-sh-product__title {
	margin-top: 0;
}

.aj-sh-archive__header {
	margin-bottom: 1.5rem;
}

/* ---------------------------------------------------------------------------
 * Buy panel
 * ------------------------------------------------------------------------ */

.aj-sh-buy {
	margin: 1.5rem 0 0;
	padding: 1.25rem;
	border: 1px solid var(--aj-line);
	border-radius: var(--aj-radius);
	background: #fff;
}

.aj-sh-buy__price {
	font-size: 1.6rem;
	font-weight: 800;
	margin: 0.75rem 0 1rem;
	color: var(--aj-ink);
}

.aj-sh-buy__soldout {
	margin: 0;
	font-weight: 700;
	color: var(--aj-red);
}

.aj-sh-field {
	display: block;
	margin: 0 0 0.85rem;
}

.aj-sh-field__label {
	display: block;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--aj-muted);
	margin-bottom: 0.3rem;
}

.aj-sh-field input,
.aj-sh-field select {
	width: 100%;
	padding: 0.6rem 0.7rem;
	border: 1px solid var(--aj-line);
	border-radius: 10px;
	font: inherit;
	color: var(--aj-ink);
	background: #fff;
}

.aj-sh-field input:focus,
.aj-sh-field select:focus {
	outline: none;
	border-color: var(--aj-blue);
	box-shadow: 0 0 0 3px rgba(5, 146, 206, 0.15);
}

.aj-sh-field--qty input {
	max-width: 7rem;
}

.aj-sh-grid2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

@media (max-width: 480px) {
	.aj-sh-grid2 {
		grid-template-columns: 1fr;
		gap: 0;
	}
}

.aj-sh-step {
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--aj-line);
}

.aj-sh-step__title {
	margin: 0 0 0.9rem;
	font-size: 1.05rem;
}

.aj-sh-btn {
	display: inline-block;
	border: 0;
	border-radius: 10px;
	padding: 0.75rem 1.35rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	background: var(--aj-line);
	color: var(--aj-ink);
	transition: background 0.15s, opacity 0.15s;
}

.aj-sh-btn--primary,
.aj-sh-btn--primary:visited {
	background: var(--aj-blue);
	color: #fff;
}

.aj-sh-btn--primary:hover:not(:disabled) {
	background: var(--aj-red);
}

.aj-sh-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.aj-sh-btn.is-busy {
	opacity: 0.7;
	pointer-events: none;
}

/* Shipping rate options */

.aj-sh-rates {
	margin: 0 0 0.85rem;
}

.aj-sh-rate {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--aj-line);
	border-radius: 10px;
	margin-bottom: 0.5rem;
	cursor: pointer;
}

.aj-sh-rate:hover {
	border-color: var(--aj-blue);
}

.aj-sh-rate input {
	margin: 0;
	flex: 0 0 auto;
}

.aj-sh-rate__name {
	flex: 1 1 auto;
	min-width: 0;
}

.aj-sh-rate__eta {
	display: block;
	font-size: 0.78rem;
	color: var(--aj-muted);
}

.aj-sh-rate__price {
	font-weight: 700;
	white-space: nowrap;
}

.aj-sh-msg {
	margin: 0 0 0.85rem;
	font-size: 0.9rem;
	color: var(--aj-muted);
	min-height: 1.2em;
}

.aj-sh-msg.is-error {
	color: var(--aj-red);
	font-weight: 600;
}

.aj-sh-secure {
	margin: 0.75rem 0 0;
	font-size: 0.78rem;
	color: var(--aj-muted);
}

/* ---------------------------------------------------------------------------
 * Order status page
 * ------------------------------------------------------------------------ */

.aj-sh-order {
	max-width: 40rem;
	margin: 2rem auto;
}

.aj-sh-order__status {
	display: inline-block;
	font-weight: 700;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	background: rgba(5, 146, 206, 0.12);
	color: var(--aj-blue);
}

.aj-sh-order__status.is-shipped {
	background: rgba(22, 145, 90, 0.12);
	color: #16915a;
}

.aj-sh-order__status.is-failed,
.aj-sh-order__status.is-refunded,
.aj-sh-order__status.is-canceled {
	background: rgba(255, 29, 39, 0.1);
	color: var(--aj-red);
}

.aj-sh-order__items {
	width: 100%;
	margin: 1.5rem 0;
	border-collapse: collapse;
}

.aj-sh-order__items td {
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--aj-line);
}

.aj-sh-order__items td:last-child {
	text-align: right;
	white-space: nowrap;
}

.aj-sh-order__total td {
	font-weight: 800;
	border-bottom: 0;
}

/* ---------------------------------------------------------------------------
 * Discount + summary
 * ------------------------------------------------------------------------ */

.aj-sh-discount {
	margin: 0 0 1rem;
}

.aj-sh-discount__row {
	display: flex;
	gap: 0.5rem;
}

.aj-sh-discount__row input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.6rem 0.7rem;
	border: 1px solid var(--aj-line);
	border-radius: 10px;
	font: inherit;
	text-transform: uppercase;
}

.aj-sh-discount__row input:focus {
	outline: none;
	border-color: var(--aj-blue);
	box-shadow: 0 0 0 3px rgba(5, 146, 206, 0.15);
}

.aj-sh-discount__row .aj-sh-btn {
	flex: 0 0 auto;
}

.aj-sh-discount__msg {
	margin: 0.4rem 0 0;
	font-size: 0.85rem;
	color: #16915a;
	font-weight: 600;
	min-height: 1.2em;
}

.aj-sh-discount__msg.is-error {
	color: var(--aj-red);
}

.aj-sh-summary {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 0.35rem 1rem;
	margin: 0 0 1rem;
	padding: 0.9rem 0 0;
	border-top: 1px solid var(--aj-line);
	font-size: 0.92rem;
}

.aj-sh-summary dt {
	margin: 0;
	color: var(--aj-muted);
}

.aj-sh-summary dd {
	margin: 0;
	text-align: right;
	white-space: nowrap;
}

.aj-sh-summary .is-discount {
	color: #16915a;
	font-weight: 600;
}

.aj-sh-summary .is-total {
	font-weight: 800;
	color: var(--aj-ink);
	font-size: 1.05rem;
	padding-top: 0.35rem;
}

/* ---------------------------------------------------------------------------
 * Embedded product ([aj_shop_product])
 * ------------------------------------------------------------------------ */

.aj-sh-embed {
	--aj-ink: var(--wp--preset--color--ink, #14202e);
	--aj-blue: var(--wp--preset--color--brand-blue, #0592ce);
	--aj-red: var(--wp--preset--color--brand-red, #ff1d27);
	--aj-line: rgba(20, 32, 46, 0.12);
	--aj-muted: #5a6672;
	--aj-radius: 14px;

	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
	gap: 1.5rem;
	align-items: start;
	margin: 1.5rem 0;
}

@media (max-width: 680px) {
	.aj-sh-embed {
		grid-template-columns: minmax(0, 1fr);
	}
}

.aj-sh-embed__media img {
	width: 100%;
	height: auto;
	border-radius: var(--aj-radius);
	display: block;
}

.aj-sh-embed__title {
	margin: 0 0 0.5rem;
}

.aj-sh-embed__title a {
	color: inherit;
	text-decoration: none;
}

.aj-sh-embed__title a:hover {
	color: var(--aj-blue);
}

.aj-sh-embed .aj-sh-buy {
	margin-top: 1rem;
}

/* Inline buy button ([aj_shop_button]) */

.aj-sh-btn--inline {
	--aj-blue: var(--wp--preset--color--brand-blue, #0592ce);
	--aj-red: var(--wp--preset--color--brand-red, #ff1d27);
	--aj-line: rgba(20, 32, 46, 0.12);
	--aj-ink: var(--wp--preset--color--ink, #14202e);
}

.aj-sh-btn--disabled {
	pointer-events: none;
	opacity: 0.55;
	background: var(--aj-line);
	color: var(--aj-ink);
}
