/**
 * Purchase Summary Widget Styles
 *
 * @package Custom_Elementor_Widgets
 * @since 1.0.0
 */

/* Main Container */
.cew-purchase-summary {
	width: 100%;
	max-width: 100%;
}

/* Notice */
.cew-notice {
	padding: 15px 20px;
	background-color: #f0f0f1;
	border-left: 4px solid #72aee6;
	color: #2c3338;
	font-size: 14px;
	line-height: 1.5;
	margin-bottom: 20px;
}

/* Sections */
.cew-purchase-summary-section {
	background-color: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 20px;
	margin-bottom: 20px;
}

.cew-section-title {
	font-size: 1.5em;
	font-weight: 700;
	margin: 0 0 20px 0;
	padding: 0;
	line-height: 1.3;
}

/* Confirmation Message */
.cew-confirmation-message {
	font-size: 1.2em;
	font-weight: 600;
	padding: 20px;
	background-color: #f8f8f8;
}

/* Payment Details */
.cew-payment-details-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 15px 30px;
}

.cew-payment-details-item {
	display: flex;
	gap: 10px;
	align-items: center;
	flex: 0 1 auto;
}

.cew-payment-details-label {
	font-weight: 400;
	color: #666;
}

.cew-payment-details-value {
	font-weight: 700;
	color: #333;
}

.cew-payment-details-divider {
	width: 1px;
	height: 20px;
	background-color: #e0e0e0;
	border: none;
	flex: 0 0 1px;
}

/* Bank Details */
.cew-bank-account {
	margin-bottom: 20px;
}

.cew-bank-account:last-child {
	margin-bottom: 0;
}

.cew-bank-account-title {
	font-size: 1.2em;
	font-weight: 600;
	margin: 0 0 15px 0;
}

.cew-bank-details-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.cew-bank-details-item {
	display: flex;
	gap: 10px;
	padding: 10px 0;
}

.cew-bank-details-label {
	font-weight: 400;
	color: #666;
	min-width: 150px;
}

.cew-bank-details-value {
	font-weight: 600;
	color: #333;
}

.cew-bank-details-divider {
	height: 1px;
	background-color: #e0e0e0;
	border: none;
	margin: 5px 0;
}

/* Downloads */
.cew-downloads-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
}

.cew-downloads-table thead th {
	text-align: left;
	padding: 12px;
	background-color: #f8f8f8;
	font-weight: 600;
	border-bottom: 2px solid #e0e0e0;
}

.cew-downloads-table tbody td {
	padding: 12px;
	border-bottom: 1px solid #e0e0e0;
}

.cew-download-button {
	display: inline-block;
	padding: 8px 16px;
	background-color: #333;
	color: #fff;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 500;
	transition: all 0.3s ease;
}

.cew-download-button:hover {
	background-color: #555;
	color: #fff;
	text-decoration: none;
}

/* Order Summary */
.cew-order-summary-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 15px;
}

.cew-order-summary-table thead th {
	text-align: left;
	padding: 12px;
	background-color: #f8f8f8;
	font-weight: 600;
	border-bottom: 2px solid #e0e0e0;
}

.cew-order-summary-table tbody td {
	padding: 15px 12px;
	border-bottom: 1px solid #e0e0e0;
	vertical-align: top;
}

.cew-order-summary-table tfoot th,
.cew-order-summary-table tfoot td {
	padding: 12px;
	border-top: 2px solid #e0e0e0;
	font-weight: 600;
}

.cew-order-summary-table tfoot tr:not(:last-child) th,
.cew-order-summary-table tfoot tr:not(:last-child) td {
	border-top: 1px solid #e0e0e0;
	font-weight: 400;
}

.cew-order-item-name {
	font-weight: 600;
}

.cew-order-item-quantity {
	font-weight: 400;
	color: #666;
	margin-left: 5px;
}

.cew-order-item-variations {
	list-style: none;
	margin: 10px 0 0 0;
	padding: 0;
}

.cew-order-item-variation {
	font-size: 0.9em;
	color: #666;
	margin: 5px 0;
}

.cew-order-item-price {
	text-align: right;
	font-weight: 600;
}

.cew-order-total {
	font-size: 1.2em;
	font-weight: 700;
	color: #333;
}

/* Address Wrapper */
.cew-address-wrapper {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 20px;
}

/* Billing and Shipping Details */
.cew-billing-details address,
.cew-shipping-address address {
	font-style: normal;
	line-height: 1.8;
}

.cew-billing-details address p,
.cew-shipping-address address p {
	margin: 5px 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
	.cew-payment-details-list {
		flex-direction: column;
		gap: 10px;
	}

	.cew-payment-details-divider {
		display: none;
	}

	.cew-payment-details-item {
		width: 100%;
		justify-content: space-between;
	}

	.cew-downloads-table,
	.cew-order-summary-table {
		font-size: 0.9em;
	}

	.cew-downloads-table thead,
	.cew-order-summary-table thead {
		display: none;
	}

	.cew-downloads-table tbody td,
	.cew-order-summary-table tbody td {
		display: block;
		text-align: right;
		padding: 10px;
		position: relative;
	}

	.cew-downloads-table tbody td::before,
	.cew-order-summary-table tbody td::before {
		content: attr(data-label);
		position: absolute;
		left: 10px;
		font-weight: 600;
		text-align: left;
	}

	.cew-downloads-table tbody tr,
	.cew-order-summary-table tbody tr {
		margin-bottom: 15px;
		display: block;
		border: 1px solid #e0e0e0;
	}

	.cew-order-item-price {
		text-align: right;
	}

	.cew-address-wrapper {
		grid-template-columns: 1fr;
	}

	.cew-bank-details-item {
		flex-direction: column;
		gap: 5px;
	}

	.cew-bank-details-label {
		min-width: auto;
	}
}

@media screen and (max-width: 480px) {
	.cew-purchase-summary-section {
		padding: 15px;
	}

	.cew-section-title {
		font-size: 1.3em;
		margin-bottom: 15px;
	}

	.cew-confirmation-message {
		font-size: 1.1em;
	}
}

/* Editor Specific Styles */
.elementor-editor-active .cew-purchase-summary {
	min-height: 100px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	.cew-purchase-summary-section {
		background-color: #1e1e1e;
		border-color: #3a3a3a;
		color: #e0e0e0;
	}

	.cew-section-title,
	.cew-payment-details-value,
	.cew-bank-details-value,
	.cew-order-item-name,
	.cew-order-total {
		color: #fff;
	}

	.cew-payment-details-label,
	.cew-bank-details-label,
	.cew-order-item-quantity,
	.cew-order-item-variation {
		color: #b0b0b0;
	}

	.cew-downloads-table thead th,
	.cew-order-summary-table thead th {
		background-color: #2a2a2a;
	}

	.cew-downloads-table tbody td,
	.cew-order-summary-table tbody td,
	.cew-downloads-table tfoot th,
	.cew-downloads-table tfoot td,
	.cew-order-summary-table tfoot th,
	.cew-order-summary-table tfoot td {
		border-color: #3a3a3a;
	}
}

/* Print Styles */
@media print {
	.cew-purchase-summary-section {
		border: 1px solid #000;
		page-break-inside: avoid;
	}

	.cew-download-button {
		display: none;
	}
}
