/* ============================================
   Easy Digital Downloads Integration Styles
   ============================================ */

/* EDD Purchase Forms */
.edd_download_purchase_form {
	margin: 1.5rem 0;
}

.edd_download_purchase_form .edd_price {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--primary-color);
	margin-bottom: 1rem;
	display: block;
}

.edd_download_purchase_form .edd_price_options {
	list-style: none;
	margin: 1rem 0;
	padding: 0;
}

.edd_download_purchase_form .edd_price_options li {
	margin-bottom: 0.75rem;
	padding: 0.75rem;
	background: var(--bg-light);
	border-radius: 0.5rem;
	border: 1px solid var(--border-color);
	transition: var(--transition);
}

.edd_download_purchase_form .edd_price_options li:hover {
	background: var(--bg-white);
	border-color: var(--primary-color);
}

.edd_download_purchase_form .edd_price_options li input[type="radio"],
.edd_download_purchase_form .edd_price_options li input[type="checkbox"] {
	margin-right: 0.75rem;
}

.edd_download_purchase_form .edd_price_option_name {
	font-weight: 600;
	color: var(--text-dark);
}

.edd_download_purchase_form .edd_price_option_price {
	color: var(--primary-color);
	font-weight: 700;
	margin-left: 0.5rem;
}

.edd_download_purchase_form .edd_download_quantity_wrapper {
	margin: 1rem 0;
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.edd_download_purchase_form .edd_download_quantity_wrapper label {
	font-weight: 600;
	color: var(--text-dark);
}

.edd_download_purchase_form input[type="number"] {
	padding: 0.5rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	width: 80px;
	font-size: 1rem;
}

.edd_download_purchase_form .edd_purchase_submit_wrapper {
	margin-top: 1.5rem;
}

.edd_download_purchase_form .edd-add-to-cart,
.edd_download_purchase_form .edd-submit,
.edd_download_purchase_form input[type="submit"].edd-submit {
	background: var(--primary-color);
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 0.5rem;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	transition: var(--transition);
	width: 100%;
	display: block;
	text-align: center;
}

.edd_download_purchase_form .edd-add-to-cart:hover,
.edd_download_purchase_form .edd-submit:hover,
.edd_download_purchase_form input[type="submit"].edd-submit:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

/* Single Download Page */
.single-download-page .download-content-wrapper {
	display: grid;
	grid-template-columns: 1fr 350px;
	gap: 3rem;
	margin-top: 2rem;
}

.single-download-page .download-featured-image {
	margin-bottom: 2rem;
}

.single-download-page .download-featured-image img {
	width: 100%;
	height: auto;
	border-radius: 1rem;
	box-shadow: var(--shadow-md);
}

.single-download-page .download-sidebar {
	position: sticky;
	top: 100px;
	align-self: start;
}

.single-download-page .download-purchase-widget {
	background: var(--bg-light);
	padding: 2rem;
	border-radius: 1rem;
	box-shadow: var(--shadow-md);
}

/* Download Archive/Grid */
.download-archive-page .downloads-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 2rem;
	margin-top: 2rem;
}

.download-card {
	background: var(--bg-white);
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: var(--shadow-md);
	transition: var(--transition);
	display: flex;
	flex-direction: column;
}

.download-card:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-xl);
}

.download-card .download-image {
	width: 100%;
	overflow: hidden;
}

.download-card .download-image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: var(--transition);
}

.download-card:hover .download-image img {
	transform: scale(1.05);
}

.download-card .download-info {
	padding: 1.5rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.download-card .download-title {
	font-size: 1.25rem;
	margin-bottom: 0.75rem;
}

.download-card .download-title a {
	color: var(--text-dark);
	text-decoration: none;
}

.download-card .download-title a:hover {
	color: var(--primary-color);
}

.download-card .download-excerpt {
	color: var(--text-medium);
	margin-bottom: 1rem;
	flex: 1;
}

.download-card .download-meta {
	margin-bottom: 1rem;
}

.download-card .download-price {
	font-size: 1.5rem;
	font-weight: 700;
	color: var(--primary-color);
}

.download-card .download-action {
	margin-top: auto;
}

/* EDD Checkout Page */
.edd-checkout-page .container {
	max-width: 800px;
}

.edd-checkout-page .entry-header {
	text-align: center;
	margin-bottom: 2rem;
}

#edd_checkout_form_wrap {
	background: var(--bg-white);
	padding: 2rem;
	border-radius: 1rem;
	box-shadow: var(--shadow-md);
}

#edd_checkout_form_wrap fieldset {
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

#edd_checkout_form_wrap legend {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text-dark);
	padding: 0 1rem;
}

#edd_checkout_form_wrap .edd-form-group {
	margin-bottom: 1.5rem;
}

#edd_checkout_form_wrap label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: var(--text-dark);
}

#edd_checkout_form_wrap input[type="text"],
#edd_checkout_form_wrap input[type="email"],
#edd_checkout_form_wrap input[type="tel"],
#edd_checkout_form_wrap input[type="password"],
#edd_checkout_form_wrap textarea,
#edd_checkout_form_wrap select {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	font-size: 1rem;
	font-family: var(--font-primary);
	transition: var(--transition);
}

#edd_checkout_form_wrap input:focus,
#edd_checkout_form_wrap textarea:focus,
#edd_checkout_form_wrap select:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#edd_checkout_form_wrap .edd-required-indicator {
	color: #ef4444;
	margin-left: 0.25rem;
}

#edd_checkout_cart {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 2rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	overflow: hidden;
}

#edd_checkout_cart thead {
	background: var(--bg-light);
}

#edd_checkout_cart th {
	padding: 1rem;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid var(--border-color);
}

#edd_checkout_cart td {
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
}

#edd_checkout_cart tbody tr:last-child td {
	border-bottom: none;
}

#edd_checkout_cart .edd_cart_actions {
	text-align: right;
}

#edd_checkout_cart .edd_cart_actions .edd-submit {
	background: var(--primary-color);
	color: white;
	border: none;
	padding: 0.5rem 1rem;
	border-radius: 0.5rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
}

#edd_checkout_cart .edd_cart_actions .edd-submit:hover {
	background: var(--primary-dark);
}

#edd-discount-code-wrap {
	background: var(--bg-light);
	padding: 1.5rem;
	border-radius: 0.5rem;
	margin-bottom: 1.5rem;
}

#edd-discount-code-wrap input[type="text"] {
	width: 100%;
	margin-bottom: 0.75rem;
}

#edd-discount-code-wrap .edd-submit {
	background: var(--text-dark);
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 0.5rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
	width: 100%;
}

#edd-discount-code-wrap .edd-submit:hover {
	background: var(--primary-color);
}

#edd_final_total_wrap {
	background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
	color: white;
	padding: 1.5rem;
	border-radius: 0.5rem;
	margin-bottom: 1.5rem;
}

#edd_final_total_wrap .edd_cart_total {
	font-size: 1.5rem;
	font-weight: 700;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

#edd_final_total_wrap .edd_cart_total .edd_cart_amount {
	font-size: 2rem;
}

#edd_purchase_form_wrap #edd-purchase-button {
	background: var(--primary-color);
	color: white;
	border: none;
	padding: 1rem 2rem;
	border-radius: 0.5rem;
	font-weight: 700;
	font-size: 1.125rem;
	cursor: pointer;
	transition: var(--transition);
	width: 100%;
	display: block;
	text-align: center;
}

#edd_purchase_form_wrap #edd-purchase-button:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
}

/* Purchase History Page */
.edd-history-page .container {
	max-width: 1200px;
}

#edd_user_history {
	width: 100%;
	border-collapse: collapse;
	margin-top: 2rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	overflow: hidden;
	background: var(--bg-white);
	box-shadow: var(--shadow-md);
}

#edd_user_history thead {
	background: var(--bg-light);
}

#edd_user_history th {
	padding: 1rem;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid var(--border-color);
}

#edd_user_history td {
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
}

#edd_user_history tbody tr:hover {
	background: var(--bg-light);
}

#edd_user_history tbody tr:last-child td {
	border-bottom: none;
}

#edd_user_history .edd_download_links {
	list-style: none;
	padding: 0;
	margin: 0;
}

#edd_user_history .edd_download_links li {
	margin-bottom: 0.5rem;
}

#edd_user_history .edd_download_links a {
	color: var(--primary-color);
	font-weight: 600;
	text-decoration: none;
}

#edd_user_history .edd_download_links a:hover {
	text-decoration: underline;
}

/* Purchase Confirmation/Receipt Page */
.edd-confirmation-page .container {
	max-width: 800px;
}

#edd_purchase_receipt {
	width: 100%;
	border-collapse: collapse;
	margin-top: 2rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	overflow: hidden;
	background: var(--bg-white);
	box-shadow: var(--shadow-md);
}

#edd_purchase_receipt thead {
	background: var(--bg-light);
}

#edd_purchase_receipt th {
	padding: 1rem;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid var(--border-color);
}

#edd_purchase_receipt td {
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
}

#edd_purchase_receipt tbody tr:last-child td {
	border-bottom: none;
}

#edd_purchase_receipt_products {
	width: 100%;
	border-collapse: collapse;
	margin-top: 2rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	overflow: hidden;
	background: var(--bg-white);
	box-shadow: var(--shadow-md);
}

#edd_purchase_receipt_products thead {
	background: var(--bg-light);
}

#edd_purchase_receipt_products th {
	padding: 1rem;
	text-align: left;
	font-weight: 600;
	border-bottom: 2px solid var(--border-color);
}

#edd_purchase_receipt_products td {
	padding: 1rem;
	border-bottom: 1px solid var(--border-color);
}

#edd_purchase_receipt_products tbody tr:last-child td {
	border-bottom: none;
}

/* EDD Cart Widget */
.widget_edd_cart_widget {
	background: var(--bg-white);
	padding: 1.5rem;
	border-radius: 0.5rem;
	box-shadow: var(--shadow-md);
}

.widget_edd_cart_widget .edd-cart-item {
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--border-color);
}

.widget_edd_cart_widget .edd-cart-item:last-child {
	border-bottom: none;
}

.widget_edd_cart_widget .edd_subtotal {
	background: var(--bg-light);
	padding: 1rem;
	margin: 1rem 0;
	border-radius: 0.5rem;
	font-weight: 700;
	display: flex;
	justify-content: space-between;
}

.widget_edd_cart_widget .edd_checkout {
	margin-top: 1rem;
}

.widget_edd_cart_widget .edd_checkout a {
	display: block;
	text-align: center;
	background: var(--primary-color);
	color: white;
	padding: 0.75rem;
	border-radius: 0.5rem;
	font-weight: 600;
	text-decoration: none;
	transition: var(--transition);
}

.widget_edd_cart_widget .edd_checkout a:hover {
	background: var(--primary-dark);
}

/* EDD Downloads List Shortcode */
.edd_downloads_list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 2rem;
	margin: 2rem 0;
}

.edd_download {
	margin: 0;
}

.edd_download .edd_download_inner {
	background: var(--bg-white);
	border-radius: 1rem;
	overflow: hidden;
	box-shadow: var(--shadow-md);
	transition: var(--transition);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.edd_download .edd_download_inner:hover {
	transform: translateY(-5px);
	box-shadow: var(--shadow-xl);
}

.edd_download_image {
	width: 100%;
	overflow: hidden;
}

.edd_download_image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: var(--transition);
}

.edd_download .edd_download_inner:hover .edd_download_image img {
	transform: scale(1.05);
}

.edd_download_title {
	padding: 1.5rem 1.5rem 0.5rem;
	font-size: 1.25rem;
	margin: 0;
}

.edd_download_title a {
	color: var(--text-dark);
	text-decoration: none;
}

.edd_download_title a:hover {
	color: var(--primary-color);
}

.edd_download_excerpt {
	padding: 0 1.5rem;
	color: var(--text-medium);
	flex: 1;
}

.edd_download_purchase_form {
	padding: 1.5rem;
	margin: 0;
}

/* EDD Buttons in Various Contexts */
.pricing-action .edd_download_purchase_form {
	margin: 0;
}

.pricing-action .edd_download_purchase_form .edd-add-to-cart {
	width: 100%;
	padding: 1rem 2rem;
	font-size: 1.125rem;
}

.cta-buttons .edd_download_purchase_form {
	display: inline-block;
}

.cta-buttons .edd_download_purchase_form .edd-add-to-cart {
	background: white;
	color: var(--primary-color);
}

.cta-buttons .edd_download_purchase_form .edd-add-to-cart:hover {
	background: rgba(255, 255, 255, 0.9);
}

/* EDD Alerts and Messages */
.edd-alert {
	padding: 1rem;
	border-radius: 0.5rem;
	margin-bottom: 1.5rem;
}

.edd-alert.edd-alert-success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #10b981;
}

.edd-alert.edd-alert-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #ef4444;
}

.edd-alert.edd-alert-info {
	background: #dbeafe;
	color: #1e40af;
	border: 1px solid #3b82f6;
}

/* Failed Transaction Page */
.edd-failed-page .container {
	max-width: 800px;
	text-align: center;
}

.edd-failed-page .entry-content {
	background: var(--bg-white);
	padding: 3rem;
	border-radius: 1rem;
	box-shadow: var(--shadow-md);
}

/* EDD Account/Profile Editor */
#edd_profile_editor_form {
	background: var(--bg-white);
	padding: 2rem;
	border-radius: 1rem;
	box-shadow: var(--shadow-md);
}

#edd_profile_editor_form fieldset {
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	padding: 1.5rem;
	margin-bottom: 1.5rem;
}

#edd_profile_editor_form legend {
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--text-dark);
	padding: 0 1rem;
}

#edd_profile_editor_form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: var(--text-dark);
	width: 200px;
}

#edd_profile_editor_form input[type="text"],
#edd_profile_editor_form input[type="email"],
#edd_profile_editor_form input[type="password"],
#edd_profile_editor_form textarea {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid var(--border-color);
	border-radius: 0.5rem;
	font-size: 1rem;
	font-family: var(--font-primary);
	transition: var(--transition);
}

#edd_profile_editor_form input:focus,
#edd_profile_editor_form textarea:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#edd_profile_editor_form .edd-submit {
	background: var(--primary-color);
	color: white;
	border: none;
	padding: 0.75rem 1.5rem;
	border-radius: 0.5rem;
	font-weight: 600;
	cursor: pointer;
	transition: var(--transition);
}

#edd_profile_editor_form .edd-submit:hover {
	background: var(--primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--shadow-md);
}

/* Responsive Design */
@media (max-width: 768px) {
	.single-download-page .download-content-wrapper {
		grid-template-columns: 1fr;
	}
	
	.single-download-page .download-sidebar {
		position: static;
	}
	
	.download-archive-page .downloads-grid {
		grid-template-columns: 1fr;
	}
	
	.edd_downloads_list {
		grid-template-columns: 1fr;
	}
	
	#edd_checkout_cart {
		font-size: 0.875rem;
	}
	
	#edd_checkout_cart th,
	#edd_checkout_cart td {
		padding: 0.75rem 0.5rem;
	}
	
	#edd_user_history,
	#edd_purchase_receipt,
	#edd_purchase_receipt_products {
		font-size: 0.875rem;
	}
	
	#edd_user_history th,
	#edd_user_history td,
	#edd_purchase_receipt th,
	#edd_purchase_receipt td,
	#edd_purchase_receipt_products th,
	#edd_purchase_receipt_products td {
		padding: 0.75rem 0.5rem;
	}
	
	#edd_profile_editor_form label {
		width: 100%;
	}
}
