/* EDD for GeneratePress — front-end styles (free version)
 * Low specificity (single-class) so child themes / user CSS can override.
 * Consumes CSS variables printed by inc/css.php.
 */

/* ---- Archive grid ------------------------------------------------------ */
.gp-edd-archive .edd_downloads_list,
.gp-edd-archive #edd_download_grid {
	display: grid;
	grid-template-columns: repeat(var(--gp-edd-cols, 3), 1fr);
	gap: 2rem;
}

.gp-edd-card {
	border: 1px solid var(--gp-edd-grid-border, #e0e0e0);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
	display: flex;
	flex-direction: column;
	position: relative;
}

.gp-edd-card .edd_download_inner,
.gp-edd-card .gp-edd-card__body {
	padding: 1.25rem;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	text-align: var(--gp-edd-text-align, center);
}

.gp-edd-card .edd_download_image {
	position: relative;
	overflow: hidden;
}

.gp-edd-card .edd_download_image img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	display: block;
}

/* Price + sale badges */
.gp-edd-price-badge {
	position: absolute;
	top: .75rem;
	right: .75rem;
	background: var(--gp-edd-sale-bg, #e53935);
	color: var(--gp-edd-sale-text, #fff);
	padding: .25rem .6rem;
	border-radius: 999px;
	font-size: .8rem;
	font-weight: 600;
	z-index: 2;
}

.gp-edd-price-badge { background: var(--gp-edd-price, #333); }

.gp-edd-sale-badge {
	position: absolute;
	top: .75rem;
	left: .75rem;
	background: var(--gp-edd-sale-bg, #e53935);
	color: var(--gp-edd-sale-text, #fff);
	padding: .2rem .55rem;
	border-radius: 4px;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	z-index: 2;
}

.gp-edd-card .edd_price {
	color: var(--gp-edd-price, #333);
	font-weight: 700;
	font-size: 1.05rem;
}

/* Purchase button (reuses GP .button) */
.gp-edd-btn {
	background: var(--gp-edd-btn-bg, #1a73e8);
	color: var(--gp-edd-btn-text, #fff);
	border-color: var(--gp-edd-btn-bg, #1a73e8);
}
.gp-edd-btn:hover,
.gp-edd-btn:focus {
	background: var(--gp-edd-btn-bg, #1a73e8);
	color: var(--gp-edd-btn-text, #fff);
	filter: brightness(0.95);
}

/* Mobile columns */
@media (max-width: 768px) {
	.gp-edd-archive .edd_downloads_list,
	.gp-edd-archive #edd_download_grid {
		grid-template-columns: repeat(var(--gp-edd-cols-mobile, 1), 1fr);
	}
}

/* ---- Single download --------------------------------------------------- */
.gp-edd-single .gp-edd-single__buy {
	margin: 1.5rem 0;
}
.gp-edd-single .gp-edd-price-block__amount {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--gp-edd-price, #333);
	display: block;
}
.gp-edd-single .gp-edd-price-block__note {
	font-size: .85rem;
	color: #666;
}

/* ---- Checkout ---------------------------------------------------------- */
.gp-edd-checkout-two-column #edd_checkout_form_wrap,
.gp-edd-checkout-two-column .edd-checkout-form {
	display: grid;
	grid-template-columns: 1fr 320px;
	gap: 2.5rem;
}
.gp-edd-checkout-two-column .gp-edd-checkout__summary,
.gp-edd-checkout-two-column #edd_purchase_receipt,
.gp-edd-checkout-two-column .edd-order-summary {
	order: 2;
}
.gp-edd-checkout-one-column #edd_checkout_form_wrap {
	display: block;
	max-width: 720px;
	margin: 0 auto;
}
@media (max-width: 768px) {
	.gp-edd-checkout-two-column #edd_checkout_form_wrap {
		grid-template-columns: 1fr;
	}
}

/* ---- Menu cart --------------------------------------------------------- */
.gp-edd-menu-cart {
	position: relative;
}
.gp-edd-cart-link {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	color: inherit;
}
.gp-edd-cart-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--gp-edd-btn-bg, #1a73e8);
	color: var(--gp-edd-btn-text, #fff);
	font-size: .72rem;
	font-weight: 700;
}
.gp-edd-minicart {
	position: absolute;
	top: 100%;
	right: 0;
	width: 280px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0,0,0,.12);
	padding: 1rem;
	opacity: 0;
	visibility: hidden;
	transition: opacity .15s;
	z-index: 999;
}
.gp-edd-menu-cart:hover .gp-edd-minicart,
.gp-edd-menu-cart:focus-within .gp-edd-minicart {
	opacity: 1;
	visibility: visible;
}
.gp-edd-minicart__list {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
}
.gp-edd-minicart__item { padding: .35rem 0; border-bottom: 1px solid #f0f0f0; }

/* ---- Cart widget ------------------------------------------------------- */
.gp-edd-cart-widget__list { list-style: none; margin: 0 0 1rem; padding: 0; }
.gp-edd-cart-widget__item { padding: .35rem 0; border-bottom: 1px solid #f0f0f0; }
.gp-edd-cart-widget__total {
	display: flex; justify-content: space-between;
	font-weight: 700; margin-bottom: .75rem;
}

/* ---- Extension dashboards (conditionally styled) ----------------------- */
.gp-edd-fes-dash, .gp-edd-affwp-dash { /* shared base for vendor/affiliate dashboards */ }
.gp-edd-fes-dash .fes-form, .gp-edd-affwp-dash .affwp-tab-content {
	background: #fff;
	border: 1px solid var(--gp-edd-grid-border, #e0e0e0);
	border-radius: 8px;
	padding: 1.5rem;
}
