/* Documents for Sale: storefront block.
   Reuses the .swg__doc-item card grid from the member resources styling and
   adds the price + Buy button columns. */

.wp-block-acf-paid-documents .pd__list {
	margin-top: 8px;
	gap: 16px;
}

/* Name + optional short description */
.wp-block-acf-paid-documents .pd__name {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.wp-block-acf-paid-documents .pd__excerpt {
	font-weight: 400;
	font-size: 13px;
	color: #4a6a5c;
	line-height: 1.4;
}

/* Price: sits where the date/size columns are on member documents */
.wp-block-acf-paid-documents .pd__price {
	grid-column: span 3;
	color: #005336;
	font-weight: 700;
	font-size: 16px;
	white-space: nowrap;
}

/* Buy button */
.wp-block-acf-paid-documents .pd__action {
	align-items: flex-end;
}
.wp-block-acf-paid-documents .pd__buy {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #005336;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 11px 26px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
	white-space: nowrap;
}
/* Loading: this button has no trailing arrow, so the spinner replaces the
   label. The label keeps its space (visibility, not display) so the button
   doesn't resize mid-purchase. */
.wp-block-acf-paid-documents .pd__buy-spinner {
	display: none;
}
.wp-block-acf-paid-documents .pd__buy.is-loading .pd__buy-label {
	visibility: hidden;
}
.wp-block-acf-paid-documents .pd__buy.is-loading .pd__buy-spinner {
	display: block;
	position: absolute;
	left: 50%;
	top: 50%;
	width: 16px;
	height: 16px;
	margin: -8px 0 0 -8px;
	box-sizing: border-box;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: pd-buy-spin 0.6s linear infinite;
}
@keyframes pd-buy-spin {
	to {
		transform: rotate(360deg);
	}
}
.wp-block-acf-paid-documents .pd__buy:hover {
	background: #00422b;
}
.wp-block-acf-paid-documents .pd__buy:disabled {
	opacity: 0.6;
	cursor: default;
}
.wp-block-acf-paid-documents .pd__unavailable {
	color: #9ca3af;
	font-size: 14px;
}

/* Notices */
.wp-block-acf-paid-documents .pd__notice {
	padding: 14px 20px;
	border-radius: 12px;
	margin-bottom: 20px;
	font-size: 15px;
}
.wp-block-acf-paid-documents .pd__notice--success {
	background: #deffe4;
	color: #005336;
	border: 1px solid #9fdcae;
}
.wp-block-acf-paid-documents .pd__notice--info {
	background: #eef2f7;
	color: #334155;
	border: 1px solid #cbd5e1;
}
.wp-block-acf-paid-documents .pd__error {
	margin-top: 14px;
	color: #b91c1c;
	font-size: 14px;
}

@media (max-width: 860px) {
	.wp-block-acf-paid-documents .pd__price {
		grid-column: span 4;
	}
}

@media (max-width: 768px) {
	/* Stack the card; the Buy button sits full-width at the bottom. Selectors
	   include .swg__doc-item to beat the theme's mobile ordering rules. */
	.wp-block-acf-paid-documents .pd__item {
		gap: 14px;
	}
	.wp-block-acf-paid-documents .swg__doc-item .pd__name {
		order: 2;
		flex: 1;
		width: auto;
	}
	.wp-block-acf-paid-documents .swg__doc-item .pd__price {
		order: 3;
		width: 100%;
		margin-left: 0;
	}
	.wp-block-acf-paid-documents .swg__doc-item .pd__action {
		order: 4;
		width: 100%;
		align-items: stretch;
	}
	.wp-block-acf-paid-documents .pd__buy {
		width: 100%;
	}
}
