/**
 * Public Styles
 *
 * @package    WFCP
 * @subpackage WFCP/public/css
 */

/* Import Persian Font */
@font-face {
	font-family: 'YekanBakh';
	src: url('../../assets/fonts/yekan-bakh/woff2/YekanBakh-Regular.woff2') format('woff2'),
		 url('../../assets/fonts/yekan-bakh/woff/YekanBakh-Regular.woff') format('woff'),
		 url('../../assets/fonts/yekan-bakh/TTF/YekanBakh-Regular.ttf') format('truetype');
	font-weight: normal;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'YekanBakh';
	src: url('../../assets/fonts/yekan-bakh/woff2/YekanBakh-Bold.woff2') format('woff2'),
		 url('../../assets/fonts/yekan-bakh/woff/YekanBakh-Bold.woff') format('woff'),
		 url('../../assets/fonts/yekan-bakh/TTF/YekanBakh-Bold.ttf') format('truetype');
	font-weight: bold;
	font-style: normal;
	font-display: swap;
}

/* Pricing Box Container – CSS variables (overridden by inline style from settings) */
.wfcp-pricing-box {
	--wfcp-box-bg: #ffffff;
	--wfcp-box-border: #e0e0e0;
	--wfcp-box-radius: 8px;
	--wfcp-btn-bg: #2271b1;
	--wfcp-btn-text: #ffffff;
	--wfcp-price-color: #2271b1;
	font-family: 'YekanBakh', 'Tahoma', 'Arial', sans-serif;
	background: var(--wfcp-box-bg);
	border: 1px solid var(--wfcp-box-border);
	border-radius: var(--wfcp-box-radius);
	padding: 20px;
	margin: 20px 0;
	direction: rtl;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.wfcp-pricing-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 15px 0;
	border-bottom: 1px solid #f0f0f0;
}

.wfcp-pricing-row:last-child {
	border-bottom: none;
}

.wfcp-pricing-row.cash,
.wfcp-pricing-row.installment,
.wfcp-pricing-row.credit {
	background: var(--wfcp-box-bg);
	padding: 15px;
	border: 1px solid var(--wfcp-box-border);
	border-radius: calc(var(--wfcp-box-radius) * 0.5);
	margin-bottom: 10px;
	transition: all 0.3s ease;
}

.wfcp-pricing-row.cash:hover,
.wfcp-pricing-row.installment:hover,
.wfcp-pricing-row.credit:hover {
	border-color: var(--wfcp-price-color);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Spacing between installment plans list and quantity/button area */
.wfcp-pricing-row.installment .wfcp-pricing-info {
	min-width: 0;
}
.wfcp-pricing-row.installment .wfcp-pricing-action {
	margin-right: 24px;
}

.wfcp-pricing-info {
	display: flex;
	align-items: center;
	gap: 15px;
	flex: 1;
}

.wfcp-pricing-icon {
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f0f0f0;
	border-radius: 50%;
	font-size: 20px;
}

.wfcp-pricing-row.installment .wfcp-pricing-icon {
	background: #e3f2fd;
	color: #1976d2;
}

.wfcp-pricing-row.cash .wfcp-pricing-icon {
	background: #e8f5e9;
	color: #2e7d32;
}

.wfcp-pricing-row.credit .wfcp-pricing-icon {
	background: #fff3e0;
	color: #f57c00;
}

.wfcp-pricing-details {
	flex: 1;
}

.wfcp-pricing-title {
	font-size: 16px;
	font-weight: bold;
	color: #333;
	margin: 0 0 5px 0;
}

.wfcp-pricing-amount {
	font-size: 18px;
	font-weight: bold;
	color: var(--wfcp-price-color);
	margin: 0;
}

.wfcp-pricing-row.cash .wfcp-pricing-amount {
	color: var(--wfcp-price-color);
	font-size: 20px;
}

.wfcp-pricing-action {
	margin-right: auto;
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 12px;
	flex-wrap: nowrap;
	flex-shrink: 0;
}

/* Quantity selector: horizontal [−] [1] [+], aligned with button height */
.wfcp-quantity-wrap {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--wfcp-box-border);
	border-radius: var(--wfcp-box-radius);
	overflow: hidden;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	background: var(--wfcp-box-bg);
}
.wfcp-quantity-wrap .wfcp-qty-minus,
.wfcp-quantity-wrap .wfcp-qty-plus {
	width: 40px;
	min-width: 40px;
	height: 42px;
	padding: 0;
	border: none;
	background: #f5f5f5;
	color: #374151;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease;
}
.wfcp-quantity-wrap .wfcp-qty-minus:hover,
.wfcp-quantity-wrap .wfcp-qty-plus:hover {
	background: #e5e7eb;
}
.wfcp-quantity-wrap .wfcp-qty-input {
	width: 50px;
	min-width: 50px;
	height: 42px;
	padding: 0 8px;
	border: none;
	border-left: 1px solid var(--wfcp-box-border);
	border-right: 1px solid var(--wfcp-box-border);
	text-align: center;
	font-size: 15px;
	font-family: 'YekanBakh', 'Tahoma', sans-serif;
	color: #374151;
	-moz-appearance: textfield;
}
.wfcp-quantity-wrap .wfcp-qty-input::-webkit-outer-spin-button,
.wfcp-quantity-wrap .wfcp-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Payment gateways list (logo + title + description) */
.wfcp-gateways-list {
	list-style: none;
	margin: 10px 0 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 12px 20px;
}
.wfcp-gateway-item {
	display: flex;
	align-items: center;
	gap: 8px;
}
.wfcp-gateway-icon {
	display: inline-block;
}
.wfcp-gateway-icon img {
	max-height: 28px;
	width: auto;
	vertical-align: middle;
}
.wfcp-gateway-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.wfcp-gateway-title {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}
.wfcp-gateway-desc {
	font-size: 12px;
	color: #6b7280;
	line-height: 1.3;
}

/* Custom description below title/price in each row */
.wfcp-pricing-description {
	font-size: 12px;
	color: #6b7280;
	line-height: 1.5;
	margin-top: 8px;
}

/* Gateways: logos only, very small, next to button (in .wfcp-pricing-action) */
.wfcp-gateways-list--logos-only {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
	flex-shrink: 0;
}
.wfcp-gateways-list--logos-only .wfcp-gateway-item {
	display: flex;
	align-items: center;
}
.wfcp-gateways-list--logos-only .wfcp-gateway-icon img {
	max-height: 18px;
	width: auto;
	vertical-align: middle;
}

.wfcp-btn-add {
	padding: 10px 20px;
	height: 42px;
	box-sizing: border-box;
	background: var(--wfcp-btn-bg);
	color: var(--wfcp-btn-text);
	border: none;
	border-radius: var(--wfcp-box-radius);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
	font-family: 'YekanBakh', 'Tahoma', sans-serif;
	font-size: 14px;
	cursor: pointer;
	transition: all 0.3s ease;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.wfcp-btn-add:hover {
	background: #135e96;
	color: var(--wfcp-btn-text);
}

.wfcp-btn-add:disabled {
	background: #ccc;
	cursor: not-allowed;
}

.wfcp-pricing-row.cash .wfcp-pricing-title {
	font-size: 18px;
}

/* Installment Plans */
.wfcp-installment-plans-list {
	margin-top: 10px;
}

.wfcp-installment-plan-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid #f0f0f0;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.wfcp-installment-plan-item:hover {
	background-color: #f9f9f9;
	padding-right: 5px;
	padding-left: 5px;
	margin-right: -5px;
	margin-left: -5px;
	border-radius: 4px;
}

.wfcp-installment-plan-item.active {
	background-color: #e3f2fd;
	padding-right: 5px;
	padding-left: 5px;
	margin-right: -5px;
	margin-left: -5px;
	border-radius: 4px;
}

.wfcp-installment-plan-item:last-child {
	border-bottom: none;
}

.wfcp-installment-plan-months {
	font-size: 14px;
	color: #666;
}

.wfcp-installment-plan-price {
	font-size: 16px;
	font-weight: bold;
	color: var(--wfcp-price-color);
}

/* Hide default theme add-to-cart and price when WFCP pricing box is present */
.single-product .product-main-content__buy form.cart,
.single-product .product-main-content__buy .ishop-woocommerce-add-to-cart-action-wrapper,
.single-product .product-main-content__buy .price {
	display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
	.wfcp-pricing-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 15px;
	}

	.wfcp-pricing-info {
		width: 100%;
	}

	.wfcp-pricing-action {
		width: 100%;
		flex-wrap: wrap;
	}

	.wfcp-btn-add {
		width: 100%;
		text-align: center;
	}
}

