/**
 * Bayna Deposits - WooCommerce Blocks Styling
 * Comprehensive CSS for cart and checkout blocks integration
 */

/* =============================================================================
   Cart Block Styles
   ============================================================================= */

.bayna-cart-deposit-info {
	margin-top: 8px;
	padding: 12px;
	background: #f8f9fa;
	border: 1px solid #e9ecef;
	border-radius: 6px;
	font-size: 0.875em;
}

.bayna-cart-deposit-info p {
	margin: 6px 0;
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.bayna-cart-deposit-info p:last-child {
	margin-bottom: 0;
}

.bayna-cart-deposit-info strong {
	color: #2c3e50;
}

.bayna-cart-deposit-summary {
	margin-top: 16px;
	padding: 16px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fafafa;
}

.bayna-cart-deposit-summary h3 {
	margin: 0 0 12px 0;
	font-size: 1.1em;
	color: #2c3e50;
	font-weight: 600;
}

.bayna-deposit-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 0.95em;
}

.bayna-deposit-summary-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #ddd;
	font-weight: 600;
}

.bayna-cart-totals {
	text-align: right;
}

.bayna-original-total {
	font-size: 1.1em;
}

.bayna-deposit-breakdown {
	opacity: 0.8;
	margin-top: 4px;
	font-size: 0.85em;
}

.bayna-deposit-item {
	position: relative;
	padding-left: 8px;
}

.bayna-deposit-item::before {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	width: 4px;
	height: 100%;
	background: linear-gradient(135deg, #0073aa, #005a87);
	border-radius: 2px;
}

/* =============================================================================
   Checkout Block Styles
   ============================================================================= */

.bayna-deposit-selection,
.bayna-deposit-selection-frontend {
	margin: 20px 0;
	padding: 20px;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	background: #fafafa;
	transition: opacity 0.3s ease;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bayna-deposit-selection.bayna-updating,
.bayna-deposit-selection-frontend.bayna-updating {
	opacity: 0.7;
	pointer-events: none;
}

.bayna-deposit-selection h3,
.bayna-deposit-selection-frontend h3 {
	margin: 0 0 16px 0;
	color: #2c3e50;
	font-size: 1.125em;
	font-weight: 600;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 8px;
}

.bayna-payment-modes {
	margin-bottom: 20px;
}

.bayna-radio-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
	padding: 14px;
	border: 2px solid #ddd;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	background: #fff;
	position: relative;
}

.bayna-radio-option:hover:not(:has(input:disabled)) {
	border-color: #0073aa;
	background: #f0f8ff;
	transform: translateY(-1px);
	box-shadow: 0 4px 8px rgba(0, 115, 170, 0.1);
}

.bayna-radio-option:has(input:checked) {
	border-color: #0073aa;
	background: #f0f8ff;
	box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

.bayna-radio-option input[type="radio"] {
	margin-right: 12px;
	accent-color: #0073aa;
	transform: scale(1.1);
}

.bayna-radio-option input[type="radio"]:disabled {
	opacity: 0.5;
}

.bayna-radio-label {
	font-weight: 500;
	color: #2c3e50;
	flex: 1;
	font-size: 1em;
}

.bayna-payment-plans {
	margin-top: 20px;
	padding-top: 20px;
	border-top: 2px solid #e0e0e0;
}

.bayna-payment-plans h4 {
	margin: 0 0 12px 0;
	color: #2c3e50;
	font-size: 1em;
	font-weight: 600;
}

.bayna-plan-option {
	flex-direction: row;
	align-items: flex-start;
	padding: 16px;
}

.bayna-plan-option input[type="radio"] {
	margin-top: 4px;
	margin-right: 12px;
}

.bayna-plan-details {
	flex: 1;
}

.bayna-plan-name {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
	color: #2c3e50;
	font-size: 0.95em;
}

.bayna-plan-description {
	display: block;
	color: #666;
	font-size: 0.85em;
	line-height: 1.4;
	margin-top: 2px;
}

.bayna-deposit-summary {
	margin-top: 16px;
	padding: 16px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bayna-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 10px;
	font-size: 0.95em;
}

.bayna-summary-row:last-child {
	margin-bottom: 0;
	padding-top: 10px;
	border-top: 1px solid #eee;
	font-weight: 600;
}

.bayna-order-summary-deposit {
	margin: 16px 0;
	padding: 16px;
	background: linear-gradient(135deg, #f8f9fa, #e9ecef);
	border: 1px solid #e9ecef;
	border-radius: 8px;
}

.bayna-deposit-breakdown h4 {
	margin: 0 0 12px 0;
	color: #0073aa;
	font-size: 1em;
	font-weight: 600;
}

.bayna-breakdown-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 8px;
	font-size: 0.95em;
}

.bayna-breakdown-row:last-child {
	margin-bottom: 0;
}

/* =============================================================================
   Notice Styles
   ============================================================================= */

.bayna-force-deposit-notice {
	margin-top: 16px;
	padding: 12px 16px;
	background: #e7f3ff;
	border: 1px solid #0073aa;
	border-left: 4px solid #0073aa;
	border-radius: 6px;
	color: #0073aa;
	font-size: 0.9em;
	position: relative;
}

.bayna-force-deposit-notice::before {
	content: "ⓘ";
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	font-weight: bold;
	font-size: 1.1em;
}

.bayna-force-deposit-notice {
	padding-left: 40px;
}

/* =============================================================================
   Loading States
   ============================================================================= */

.bayna-updating {
	position: relative;
}

.bayna-updating::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 20px;
	height: 20px;
	margin: -10px 0 0 -10px;
	border: 2px solid #0073aa;
	border-top-color: transparent;
	border-radius: 50%;
	animation: bayna-spin 1s linear infinite;
	z-index: 10;
}

@keyframes bayna-spin {
	to {
		transform: rotate(360deg);
	}
}

.components-spinner {
	margin-left: 8px;
	width: 16px;
	height: 16px;
}

/* =============================================================================
   Error States
   ============================================================================= */

.bayna-error-notice {
	margin-bottom: 16px;
	padding: 12px 16px;
	background: #ffeaea;
	border: 1px solid #dc3232;
	border-left: 4px solid #dc3232;
	border-radius: 6px;
	color: #dc3232;
	font-size: 0.9em;
}

/* =============================================================================
   Responsive Design
   ============================================================================= */

@media (max-width: 768px) {
	.bayna-deposit-selection,
	.bayna-deposit-selection-frontend,
	.bayna-cart-deposit-summary {
		padding: 16px;
		margin: 16px 0;
	}
	
	.bayna-radio-option {
		padding: 12px;
		flex-direction: column;
		align-items: flex-start;
	}
	
	.bayna-radio-option input[type="radio"] {
		margin-bottom: 8px;
		margin-right: 0;
	}
	
	.bayna-plan-details {
		margin-left: 0;
		margin-top: 8px;
	}
	
	.bayna-summary-row,
	.bayna-breakdown-row,
	.bayna-deposit-summary-row {
		font-size: 0.9em;
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
	}
	
	.bayna-deposit-selection h3,
	.bayna-deposit-selection-frontend h3 {
		font-size: 1em;
	}
}

@media (max-width: 480px) {
	.bayna-cart-deposit-info p {
		flex-direction: column;
		align-items: flex-start;
		gap: 2px;
	}
	
	.bayna-deposit-breakdown {
		text-align: left;
	}
}

/* =============================================================================
   WooCommerce Blocks Theme Integration
   ============================================================================= */

.wc-block-checkout .bayna-deposit-selection,
.wc-block-checkout .bayna-deposit-selection-frontend {
	border-color: var(--wc-border-color, #e0e0e0);
	background: var(--wc-background-color, #fafafa);
}

.wc-block-checkout .bayna-radio-option {
	border-color: var(--wc-border-color, #ddd);
	background: var(--wc-background-color, #fff);
}

.wc-block-checkout .bayna-radio-option:hover {
	border-color: var(--wc-primary-color, #0073aa);
}

.wc-block-checkout .bayna-radio-option input[type="radio"] {
	accent-color: var(--wc-primary-color, #0073aa);
}

.wc-block-cart .bayna-cart-deposit-summary {
	border-color: var(--wc-border-color, #e0e0e0);
	background: var(--wc-background-color, #fafafa);
}

/* =============================================================================
   Accessibility Improvements
   ============================================================================= */

.bayna-radio-option:focus-within {
	outline: 2px solid #0073aa;
	outline-offset: 2px;
}

.bayna-radio-option input[type="radio"]:focus {
	outline: none;
}

/* Screen reader only text */
.bayna-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.bayna-deposit-selection,
	.bayna-deposit-selection-frontend {
		border-width: 2px;
		border-color: #000;
	}
	
	.bayna-radio-option {
		border-width: 2px;
	}
	
	.bayna-radio-option:hover {
		border-color: #000;
		background: #fff;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	.bayna-radio-option,
	.bayna-deposit-selection {
		transition: none;
	}
	
	.bayna-updating::after {
		animation: none;
	}
}

/* =============================================================================
   Print Styles
   ============================================================================= */

@media print {
	.bayna-deposit-selection,
	.bayna-deposit-selection-frontend {
		border: 1px solid #000;
		background: #fff;
		box-shadow: none;
	}
	
	.bayna-radio-option {
		border: 1px solid #000;
		background: #fff;
	}
	
	.bayna-updating::after {
		display: none;
	}
}

/* ADD to existing CSS */
.bayna-cart-payment-modes {
    margin-bottom: 20px;
    padding: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
}

.bayna-cart-payment-modes h4 {
    margin: 0 0 12px 0;
    color: #2c3e50;
    font-weight: 600;
}

.bayna-mode-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafafa;
}

.bayna-mode-option:hover,
.bayna-mode-option.selected {
    border-color: #0073aa;
    background: #f0f8ff;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.1);
}

.bayna-mode-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 2px;
    accent-color: #0073aa;
}

.bayna-mode-option strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 4px;
}

.bayna-mode-option small {
    color: #666;
    font-size: 0.875em;
}

.bayna-deposit-breakdown-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
	padding-right: 10px;
    padding-left: 10px;
}
.bayna-deposit-summary-total{
	padding-right: 10px;
    padding-left: 10px;
}