/**
 * Miele Credit Popup Styles - Table Design
 */

/* Button */
.miele-credit-button-wrapper {
	margin: 20px 0;
}

.miele-credit-button {
	cursor: pointer;
	text-decoration: none !important;
	display: inline-block;
}

.miele-credit-button:hover,
.miele-credit-button:focus,
.miele-credit-button:active {
	text-decoration: none !important;
}

/* Popup Container */
.miele-credit-popup {
	max-width: 1200px;
	width: 100%;
	background: #fff;
	border-radius: 0;
	padding: 0;
	overflow: auto;
	max-height: 90vh;
	position: relative;
}

/* Hide popup by default (before Lity opens it) */
.miele-credit-popup--hidden {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	position: absolute !important;
	left: -9999px !important;
	top: -9999px !important;
}

/* When popup is inside Lity - show it */
.lity-content .miele-credit-popup {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative !important;
	left: auto !important;
	top: auto !important;
}

/* Remove hidden class when inside Lity */
.lity-content .miele-credit-popup--hidden {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	position: relative !important;
	left: auto !important;
	top: auto !important;
}

/* Header */
.miele-credit-popup__header {
	background: #fff;
	padding: 30px 40px;
	border-bottom: 1px solid #e0e0e0;
	position: relative;
}

.miele-credit-popup__close {
	position: absolute;
	top: 20px;
	right: 20px;
	background: none;
	border: none;
	font-size: 32px;
	line-height: 1;
	color: #999;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}

.miele-credit-popup__close:hover {
	color: #333;
}

.miele-credit-popup__title {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	color: #333;
}

/* Body */
.miele-credit-popup__body {
	padding: 30px 40px 40px;
}

/* Form */
.miele-credit-popup__form {
	width: 100%;
}

/* Table */
.miele-credit-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 30px;
}

.miele-credit-table thead th {
	background: #f5f5f5;
	padding: 15px 20px;
	text-align: left;
	font-size: 14px;
	font-weight: 600;
	color: #666;
	border: 1px solid #e0e0e0;
}

.miele-credit-table thead th:first-child {
	border-left: none;
}

.miele-credit-table thead th:last-child {
	border-right: none;
}

.miele-credit-table tbody td {
	padding: 20px;
	border: 1px solid #e0e0e0;
	vertical-align: middle;
}

.miele-credit-table tbody td:first-child {
	border-left: none;
}

.miele-credit-table tbody td:last-child {
	border-right: none;
}

.miele-credit-table tbody tr:last-child td {
	border-bottom: none;
}

/* Radio Button */
.miele-credit-radio {
	display: flex;
	align-items: center;
	cursor: pointer;
	margin: 0;
}

.miele-credit-radio__input {
	margin: 0 15px 0 0;
	cursor: pointer;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.miele-credit-radio__label {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1;
}

.miele-credit-radio__icon {
	max-height: 40px;
	max-width: 60px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.miele-credit-radio__text {
	font-size: 16px;
	font-weight: 500;
	color: #333;
}

/* Conditions Column */
.miele-credit-row__conditions {
	font-size: 14px;
	color: #666;
	line-height: 1.6;
}

/* Period Select */
.miele-credit-select {
	width: 100%;
	max-width: 120px;
	padding: 10px 30px 10px 12px;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	font-size: 14px;
	color: #333;
	background-color: #fff;
	background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 12 8"><path fill="%23666" d="M6 8L0 2 1.4 0.6 6 5.2 10.6 0.6 12 2z"/></svg>');
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 12px;
	appearance: none;
	cursor: pointer;
	transition: border-color 0.2s;
}

.miele-credit-select:focus {
	outline: none;
	border-color: #8C0014;
}

.miele-credit-select:disabled {
	background-color: #f5f5f5;
	color: #999;
	cursor: not-allowed;
	opacity: 0.6;
}

/* Payment Display */
.miele-credit-payment {
	font-size: 16px;
	color: #333;
}

.miele-credit-payment strong {
	font-weight: 600;
	color: #8C0014;
}

/* Total Section */
.miele-credit-popup__total {
	background: #f8f9fa;
	padding: 20px 30px;
	margin-bottom: 30px;
	border-radius: 4px;
}

.miele-credit-popup__total-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.miele-credit-popup__total-label {
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.miele-credit-popup__total-value {
	font-size: 22px;
	font-weight: 700;
	color: #8C0014;
}

/* Actions */
.miele-credit-popup__actions {
	text-align: center;
}

.miele-credit-popup__submit {
	min-width: 250px;
	padding: 15px 40px;
	margin-bottom: 15px;
}

.miele-credit-popup__note {
	margin: 0;
	font-size: 13px;
	color: #999;
	line-height: 1.6;
}

.miele-credit-popup__link {
	color: #8C0014;
	text-decoration: underline;
}

.miele-credit-popup__link:hover {
	text-decoration: none;
}

.miele-credit-popup__no-methods {
	text-align: center;
	padding: 60px 20px;
	color: #999;
	font-size: 16px;
}

/* Lity Overrides - only for credit popup */
/* Using class-based selector for better browser support */
.lity-wrap.miele-credit-lity-wrap {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: 15px;
}

.lity-wrap.miele-credit-lity-wrap .lity-content {
	max-width: 1220px !important;
	width: 95% !important;
	margin: 0 auto;
}

/* Desktop - enforce good width */
@media (min-width: 993px) {
	.lity-wrap.miele-credit-lity-wrap .lity-content {
		width: 1200px !important;
		min-width: 1000px !important;
	}
}

/* Tablet */
@media (min-width: 768px) and (max-width: 992px) {
	.lity-wrap.miele-credit-lity-wrap .lity-content {
		width: 90% !important;
		min-width: 700px !important;
	}
}

/* Desktop - ensure good spacing */
@media (min-width: 993px) {
	.miele-credit-table thead th,
	.miele-credit-table tbody td {
		padding: 18px 20px;
	}

	.miele-credit-radio__icon {
		max-height: 45px;
		max-width: 80px;
	}

	.miele-credit-select {
		max-width: 140px;
		font-size: 15px;
	}
}

/* Responsive - Tablet and smaller */
@media (max-width: 992px) {
	.lity-content {
		min-width: auto;
		max-width: 100%;
	}

	.miele-credit-popup {
		max-width: 100%;
	}

	.miele-credit-popup__header {
		padding: 20px 30px;
	}

	.miele-credit-popup__body {
		padding: 20px 30px 30px;
	}

	.miele-credit-popup__title {
		font-size: 20px;
		padding-right: 40px;
	}

	.miele-credit-table thead th,
	.miele-credit-table tbody td {
		padding: 12px 10px;
		font-size: 13px;
	}

	.miele-credit-radio__text {
		font-size: 14px;
	}

	.miele-credit-radio__icon {
		max-height: 35px;
		max-width: 60px;
	}

	.miele-credit-select {
		max-width: 100px;
		font-size: 13px;
		padding: 8px 25px 8px 10px;
	}

	.miele-credit-payment {
		font-size: 14px;
	}
}

@media (max-width: 768px) {
	.miele-credit-popup__header {
		padding: 15px 20px;
	}

	.miele-credit-popup__body {
		padding: 15px 20px 20px;
	}

	.miele-credit-popup__title {
		font-size: 18px;
	}

	/* Stack table on mobile */
	.miele-credit-table,
	.miele-credit-table thead,
	.miele-credit-table tbody,
	.miele-credit-table tr,
	.miele-credit-table td {
		display: block;
		width: 100%;
	}

	.miele-credit-table thead {
		display: none;
	}

	.miele-credit-table tbody tr {
		margin-bottom: 20px;
		border: 1px solid #e0e0e0;
		border-radius: 8px;
		overflow: hidden;
	}

	.miele-credit-table tbody td {
		border: none;
		border-bottom: 1px solid #f0f0f0;
		padding: 15px;
		position: relative;
		/*padding-left: 140px;*/
		min-height: 50px;
	}

	.miele-credit-table tbody td:last-child {
		border-bottom: none;
	}

	.miele-credit-table tbody td:before {
		content: attr(data-label);
		position: absolute;
		left: 15px;
		top: 15px;
		font-weight: 600;
		font-size: 13px;
		color: #666;
		width: 110px;
	}

	.miele-credit-row__option:before {
		content: 'Пропозиція:';
	}

	.miele-credit-row__conditions:before {
		content: 'Умови:';
	}

	.miele-credit-row__period:before {
		content: 'Місяців:';
	}

	.miele-credit-row__payment:before {
		content: 'Платіж:';
	}

	.miele-credit-radio__icon {
		max-height: 30px;
		max-width: 50px;
	}

	.miele-credit-radio__input {
		width: 18px;
		height: 18px;
		margin: 0 10px 0 0;
	}

	.miele-credit-radio__label {
		gap: 8px;
	}

	.miele-credit-select {
		max-width: 100%;
		font-size: 14px;
	}

	.miele-credit-popup__total {
		padding: 15px 20px;
	}

	.miele-credit-popup__total-row {
		flex-direction: column;
		gap: 8px;
		align-items: flex-start;
	}

	.miele-credit-popup__total-label {
		font-size: 15px;
	}

	.miele-credit-popup__total-value {
		font-size: 20px;
	}

	.miele-credit-popup__submit {
		min-width: auto;
		width: 100%;
		font-size: 15px;
	}

	.miele-credit-popup__note {
		font-size: 12px;
	}
}

@media (max-width: 480px) {
	.miele-credit-popup__close {
		top: 10px;
		right: 10px;
		font-size: 28px;
		width: 28px;
		height: 28px;
	}

	.miele-credit-popup__total-value {
		font-size: 20px;
	}

	.miele-credit-radio__text {
		font-size: 14px;
	}
}
