/**
 * Bulk Pricing Modal Styles
 *
 * @package EST_Core
 */

/* ── Purchase Type Selector ────────────────────────────── */

.est-purchase-type-selector {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-bottom: 20px;
	width: 100%;
}

.est-purchase-type-option {
	position: relative;
	border: 2px solid #ddd;
	border-radius: 8px;
	padding: 16px;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
	background: #fff;
}

.est-purchase-type-option:hover {
	border-color: var(--primary, #00a1b3);
}

.est-purchase-type-option.est-active {
	border-color: var(--primary, #00a1b3);
	box-shadow: 0 0 0 1px var(--primary, #00a1b3);
	background: rgba(0, 161, 179, 0.04);
}

.est-purchase-type-option input[type="radio"] {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.est-purchase-type-option label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	text-align: center;
}

.est-type-icon {
	color: var(--base, #344F6F);
	margin-bottom: 2px;
}

.est-active .est-type-icon {
	color: var(--primary, #00a1b3);
}

.est-type-label {
	font-weight: 600;
	font-size: 1em;
	color: var(--base, #344F6F);
}

.est-active .est-type-label {
	color: var(--primary, #00a1b3);
}

.est-type-desc {
	font-size: var(--text-xs, 0.75rem);
	color: #666;
	line-height: 1.3;
}

/* Individual mode: hide qty, bulk rates trigger, and seats label */
form.cart.est-individual-mode .quantity,
form.cart.est-individual-mode .est-bulk-rates-trigger {
	display: none !important;
}

@media (max-width: 480px) {
	.est-purchase-type-selector {
		grid-template-columns: 1fr;
	}
}

/* ── Seats Label & Bulk Pricing ───────────────────────── */

/* Seats Label (via pseudo-element to avoid Bricks DOM timing issues) */
form.cart .quantity {
	position: relative;
}

form.cart .quantity::after {
	content: "seats";
	position: absolute;
	right: -50px;
	top: 50%;
	transform: translateY(-50%);
	font-size: var(--text-xs, 0.75rem);
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	white-space: nowrap;
}

/* Trigger Link */
.est-bulk-rates-trigger {
	display: inline-block;
	margin-bottom: 15px;
	color: #0073aa;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.95em;
}

.est-bulk-rates-trigger:hover {
	text-decoration: underline;
}

.est-question-mark {
	display: inline-block;
	width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	border-radius: 50%;
	background: #0073aa;
	color: #fff;
	font-size: 12px;
	margin-left: 5px;
}

/* Modal */
.est-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
}

.est-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.7);
}

.est-modal-content {
	position: relative;
	max-width: 600px;
	margin: 50px auto;
	background: #fff;
	border-radius: 8px;
	padding: 30px;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
	max-height: 80vh;
	overflow-y: auto;
}

.est-modal-close {
	position: absolute;
	top: 15px;
	right: 20px;
	font-size: 28px;
	font-weight: bold;
	color: #999;
	cursor: pointer;
	line-height: 1;
}

.est-modal-close:hover {
	color: #333;
}

.est-modal-content h3 {
	margin-top: 0;
	margin-bottom: 10px;
	font-size: 1.8em;
	color: #333;
}

.est-modal-content > p {
	margin-bottom: 20px;
	color: #666;
}

/* Pricing Table */
.est-pricing-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 25px;
}

.est-pricing-table th,
.est-pricing-table td {
	padding: 12px;
	text-align: left;
	border-bottom: 1px solid #eee;
}

.est-pricing-table th {
	background: #f5f5f5;
	font-weight: 600;
	color: #333;
	text-transform: uppercase;
	font-size: 0.85em;
}

.est-pricing-table tbody tr {
	transition: background 0.2s;
}

.est-pricing-table tbody tr:hover {
	background: #f9f9f9;
}

.est-pricing-table tbody tr.est-tier-active {
	background: #e6f2ff;
	font-weight: 600;
}

.est-pricing-table tbody tr.est-tier-active td {
	color: #0073aa;
}

/* Pricing Summary */
.est-pricing-summary {
	background: #f9f9f9;
	border-radius: 4px;
	padding: 20px;
	margin-top: 20px;
}

.est-pricing-summary p {
	display: flex;
	justify-content: space-between;
	margin: 10px 0;
	font-size: 1em;
}

.est-pricing-summary p.est-total-price {
	border-top: 2px solid #ddd;
	padding-top: 15px;
	margin-top: 15px;
	font-size: 1.3em;
}

.est-pricing-summary strong {
	color: #333;
}

.est-pricing-summary span {
	color: #0073aa;
	font-weight: 600;
}

/* Cart Savings */
.est-bulk-savings th {
	color: #4caf50;
}

.est-savings-amount {
	color: #4caf50 !important;
	font-size: 1.1em;
}

/* Responsive */
@media (max-width: 600px) {
	.est-modal-content {
		margin: 20px;
		padding: 20px;
		max-height: 90vh;
	}

	.est-pricing-table th,
	.est-pricing-table td {
		padding: 8px;
		font-size: 0.9em;
	}

	.est-pricing-summary {
		padding: 15px;
	}
}
