/**
 * ANDA Sync – frontend stílusok.
 * A webshop modern dizájnjához illeszkedik (indigó márkaszín, lekerekített kártyák).
 */

.anda-calculator {
	margin: 32px 0;
	padding: 0;
	border: 1px solid var(--line, #E8E8EC);
	border-radius: 16px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(22, 22, 29, .04), 0 2px 8px rgba(22, 22, 29, .04);
	/* A sticky fejléc ne takarja el, amikor idegörgetünk. */
	scroll-margin-top: 90px;
}

.anda-calc-header {
	padding: 20px 24px;
	background: linear-gradient(135deg, #6C5CE7 0%, #8B7CF0 100%);
	color: #fff;
}

.anda-calc-header h3 {
	margin: 0 0 4px;
	font-size: 19px;
	font-weight: 700;
	color: #fff;
}

.anda-calc-sub {
	margin: 0;
	font-size: 14px;
	opacity: .9;
	line-height: 1.5;
}

/* =========================================================================
   „Csak a termék" / „Egyedi nyomtatással" választó
   (a termékoldalon a rövid leírás alatt jelenik meg)
   ========================================================================= */

.anda-mode-switch {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 20px 0;
}

.anda-mode-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 14px 16px;
	border: 1px solid #E8E8EC;
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
	margin: 0;
}

.anda-mode-option:hover {
	border-color: #C7C0F5;
	background: #FCFCFE;
}

.anda-mode-option input[type="radio"] {
	margin: 3px 0 0;
	accent-color: #6C5CE7;
	flex: 0 0 auto;
	width: 17px;
	height: 17px;
}

.anda-mode-option span {
	display: flex;
	flex-direction: column;
	gap: 3px;
	line-height: 1.35;
	min-width: 0;
}

.anda-mode-option strong {
	font-size: 15px;
	font-weight: 600;
	color: #16161D;
}

.anda-mode-option em {
	font-style: normal;
	font-size: 12.5px;
	color: #9ca3af;
	line-height: 1.4;
}

/* kiválasztott állapot – :has() támogatás esetén */
.anda-mode-option:has(input:checked) {
	border-color: #6C5CE7;
	background: #FBFAFF;
	box-shadow: 0 0 0 3px rgba(108, 92, 231, .12);
}

/* tartalék a :has() nélküli böngészőkhöz (a JS teszi rá az osztályt) */
.anda-mode-option.is-selected {
	border-color: #6C5CE7;
	background: #FBFAFF;
	box-shadow: 0 0 0 3px rgba(108, 92, 231, .12);
}

.anda-calc-body {
	padding: 24px;
}

/* =========================================================================
   Kosár-blokk a kalkulátor alján (készlet + mennyiség + gomb)
   ========================================================================= */

.anda-cart-box {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid #E8E8EC;
}

.anda-cart-stock {
	display: none;
	margin-bottom: 12px;
	font-size: 14px;
	font-weight: 600;
}

.anda-cart-stock.is-in {
	color: #15803D;
}

.anda-cart-stock.is-out {
	color: #B91C1C;
}

.anda-cart-row {
	display: flex;
	align-items: stretch;
	gap: 12px;
	flex-wrap: wrap;
}

/* mennyiség léptető */
.anda-qty-control {
	display: flex;
	align-items: stretch;
	border: 1px solid #E8E8EC;
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
	flex: 0 0 auto;
}

.anda-qty-btn {
	width: 42px;
	border: none;
	background: #FAFAFB;
	color: #52525B;
	font-size: 19px;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background-color .2s ease, color .2s ease;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0;
}

.anda-qty-btn:hover {
	background: #F0EEFE;
	color: #6C5CE7;
	transform: none !important;
}

.anda-qty-input {
	width: 74px;
	border: none !important;
	border-left: 1px solid #E8E8EC !important;
	border-right: 1px solid #E8E8EC !important;
	border-radius: 0 !important;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 4px !important;
	-moz-appearance: textfield;
	box-shadow: none !important;
}

.anda-qty-input::-webkit-outer-spin-button,
.anda-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* kosárba gomb */
.anda-cart-button {
	flex: 1 1 200px;
	padding: 14px 24px;
	border: none;
	border-radius: 10px;
	background: #6C5CE7;
	color: #fff;
	font-size: 15.5px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color .2s ease, transform .2s ease, box-shadow .2s ease;
	white-space: nowrap;
}

.anda-cart-button:hover:not(:disabled) {
	background: #5A4BD1;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(108, 92, 231, .28);
}

.anda-cart-button:disabled {
	background: #C7C7D1;
	cursor: not-allowed;
}

.anda-cart-note {
	margin: 10px 0 0;
	font-size: 13px;
	color: #9A3412;
}

.anda-cart-note:empty {
	display: none;
}

/* --- mezők --- */

.anda-field {
	margin-bottom: 18px;
}

.anda-field > label {
	display: block;
	margin-bottom: 6px;
	font-size: 14px;
	font-weight: 600;
	color: #16161D;
}

.anda-field .anda-select,
.anda-field input[type="number"],
.anda-field input[type="file"],
.anda-field textarea {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid #E8E8EC;
	border-radius: 10px;
	font-size: 15px;
	background: #fff;
	transition: border-color .2s ease, box-shadow .2s ease;
}

.anda-field .anda-select:focus,
.anda-field input:focus,
.anda-field textarea:focus {
	border-color: #6C5CE7;
	box-shadow: 0 0 0 4px rgba(108, 92, 231, .12);
	outline: none;
}

.anda-hint {
	margin: 6px 0 0;
	font-size: 13px;
	color: #6b7280;
	line-height: 1.5;
}

.anda-hint a {
	color: #6C5CE7;
	font-weight: 500;
}

/* --- pozíció előnézet (kattintásra nagyítható) --- */

.anda-position-preview {
	margin: -6px 0 18px;
	text-align: center;
}

.anda-preview-zoom {
	position: relative;
	display: inline-block;
	padding: 0 !important;
	border: none !important;
	background: none !important;
	cursor: zoom-in;
	line-height: 0;
	border-radius: 10px;
	box-shadow: none !important;
	transition: transform .2s ease;
}

.anda-preview-zoom:hover {
	transform: translateY(-2px) !important;
}

.anda-position-preview img {
	max-width: 180px;
	height: auto;
	border-radius: 10px;
	border: 1px solid #E8E8EC;
	background: #F7F7F9;
	padding: 8px;
	display: block;
}

/* nagyító ikon a kép sarkában */
.anda-zoom-hint {
	position: absolute;
	right: 6px;
	bottom: 6px;
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, .95);
	border: 1px solid #E8E8EC;
	border-radius: 50%;
	font-size: 13px;
	line-height: 1;
	box-shadow: 0 2px 6px rgba(22, 22, 29, .12);
	pointer-events: none;
}

.anda-preview-caption {
	display: block;
	margin-top: 7px;
	font-size: 12.5px;
	color: #9ca3af;
}

/* =========================================================================
   Lightbox (nagyított pozíció-kép)
   ========================================================================= */

body.anda-lightbox-open {
	overflow: hidden;
}

.anda-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	background: rgba(15, 15, 20, .82);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity .2s ease;
	cursor: zoom-out;
}

.anda-lightbox.is-visible {
	opacity: 1;
}

.anda-lightbox-inner {
	margin: 0;
	max-width: 92vw;
	max-height: 88vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	cursor: default;
	transform: scale(.96);
	transition: transform .2s ease;
}

.anda-lightbox.is-visible .anda-lightbox-inner {
	transform: scale(1);
}

.anda-lightbox-inner img {
	max-width: 100%;
	max-height: 78vh;
	width: auto;
	height: auto;
	border-radius: 12px;
	background: #fff;
	padding: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
	display: block;
}

.anda-lightbox-inner figcaption {
	color: #fff;
	font-size: 14px;
	text-align: center;
	max-width: 90vw;
}

.anda-lightbox-close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	border: none !important;
	border-radius: 50% !important;
	background: rgba(255, 255, 255, .95) !important;
	color: #16161D !important;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 !important;
	box-shadow: 0 4px 12px rgba(0, 0, 0, .25) !important;
	transition: background-color .2s ease, transform .2s ease;
}

.anda-lightbox-close:hover {
	background: #fff !important;
	transform: scale(1.06) !important;
}

@media (max-width: 640px) {
	.anda-lightbox {
		padding: 12px;
	}

	.anda-lightbox-inner {
		max-width: 96vw;
	}

	.anda-lightbox-inner img {
		max-height: 70vh;
		padding: 8px;
	}

	.anda-lightbox-close {
		top: 10px;
		right: 10px;
		width: 40px;
		height: 40px;
		font-size: 24px;
	}

	.anda-lightbox-inner figcaption {
		font-size: 13px;
	}
}

/* --- méret mezők --- */

.anda-size-inputs {
	display: flex;
	align-items: center;
	gap: 10px;
}

.anda-size-inputs > span {
	position: relative;
	flex: 1;
	display: flex;
	align-items: center;
	gap: 6px;
}

.anda-size-inputs input {
	flex: 1;
}

.anda-size-inputs small {
	color: #9ca3af;
	font-size: 13px;
}

.anda-size-x {
	flex: 0 0 auto !important;
	color: #9ca3af;
	font-weight: 600;
}

/* --- eredmény --- */

.anda-result {
	margin-top: 22px;
	padding: 18px 20px;
	background: #F7F7F9;
	border-radius: 12px;
	transition: opacity .2s ease;
}

.anda-result.is-loading {
	opacity: .5;
}

.anda-result-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	padding: 7px 0;
	font-size: 14px;
	color: #52525B;
}

.anda-result-row strong {
	color: #16161D;
	font-weight: 600;
	white-space: nowrap;
}

/* „(130 Ft × 100 db)" – hogy látszódjon: a mennyiséggel szorozva szerepel */
.anda-calc-detail {
	display: block;
	margin-top: 2px;
	font-size: 12.5px;
	font-style: normal;
	color: #9ca3af;
}

.anda-result-total {
	margin-top: 8px;
	padding-top: 14px;
	border-top: 1px solid #E0E0E6;
	font-size: 16px;
}

.anda-result-total strong {
	font-size: 22px;
	font-weight: 800;
	color: #6C5CE7;
}

.anda-result-unit {
	font-size: 13px;
	color: #9ca3af;
}

.anda-result-unit strong {
	font-weight: 500;
	color: #6b7280;
}

.anda-lead-time {
	margin: 12px 0 0;
	padding: 9px 12px;
	background: #EEF2FF;
	border-radius: 8px;
	font-size: 13px;
	color: #4338CA;
}

.anda-error {
	display: none;
	margin: 12px 0 0;
	padding: 10px 12px;
	background: #FEF2F2;
	border-radius: 8px;
	font-size: 13px;
	color: #B91C1C;
}

.anda-vat-note {
	margin: 12px 0 0;
	font-size: 12px;
	color: #9ca3af;
	text-align: right;
}

.anda-custom-quote {
	margin: 14px 0 0;
	padding: 12px 14px;
	background: #FFF7ED;
	border-radius: 10px;
	font-size: 13.5px;
	color: #9A3412;
	line-height: 1.6;
}

.anda-custom-quote a {
	color: #C2410C;
	font-weight: 600;
	white-space: nowrap;
}

/* --- feltöltés visszajelzés --- */

.anda-upload-status {
	display: none;
	margin: 8px 0 0;
	font-size: 13px;
}

.anda-upload-status.is-ok {
	color: #15803D;
}

.anda-upload-status.is-error {
	color: #B91C1C;
}

/* --- termékoldali infóblokkok --- */

.anda-stock-info {
	margin: 16px 0;
	padding: 14px 16px;
	background: #F7F7F9;
	border-radius: 12px;
	border-left: 3px solid #6C5CE7;
	font-size: 14px;
}

.anda-stock-info strong {
	display: block;
	margin-bottom: 6px;
	color: #16161D;
	font-size: 14px;
}

.anda-stock-info ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.anda-stock-info li {
	padding: 3px 0;
	color: #52525B;
}

.anda-moq-notice {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 14px 0;
	padding: 11px 14px;
	background: #FFF7ED;
	border-radius: 10px;
	font-size: 13.5px;
	color: #9A3412;
}

/* --- áthúzott katalógusár --- */

.anda-list-price {
	color: #A1A1AA;
	font-weight: 400;
	margin-right: 6px;
}

/* --- műszaki adatok tábla --- */

.anda-specs {
	width: 100%;
	margin-bottom: 24px;
	border-collapse: collapse;
}

.anda-specs th,
.anda-specs td {
	padding: 10px 14px;
	border-bottom: 1px solid #E8E8EC;
	text-align: left;
	font-size: 14.5px;
}

.anda-specs th {
	width: 38%;
	font-weight: 600;
	color: #52525B;
	background: #FAFAFB;
}

.anda-docs {
	margin: 0;
	padding: 0;
	list-style: none;
}

.anda-docs li {
	padding: 9px 0;
	border-bottom: 1px solid #E8E8EC;
}

.anda-docs a {
	color: #6C5CE7;
	font-weight: 500;
}

/* --- mobil --- */

@media (max-width: 782px) {
	/* A választó mobilon egymás alá kerül, hogy a szöveg ne törjön csúnyán. */
	.anda-mode-switch {
		grid-template-columns: 1fr;
		gap: 8px;
		margin: 16px 0;
	}

	.anda-mode-option {
		padding: 13px 14px;
		align-items: center;
	}

	.anda-mode-option span {
		gap: 1px;
	}
}

@media (max-width: 640px) {
	.anda-calculator {
		margin: 24px 0;
		border-radius: 14px;
	}

	.anda-calc-body {
		padding: 18px;
	}

	.anda-calc-header {
		padding: 16px 18px;
	}

	.anda-calc-header h3 {
		font-size: 17px;
	}

	.anda-calc-sub {
		font-size: 13px;
	}

	.anda-result {
		padding: 15px 16px;
	}

	.anda-result-row {
		font-size: 13.5px;
		gap: 10px;
	}

	.anda-result-total strong {
		font-size: 19px;
	}

	.anda-calc-detail {
		font-size: 11.5px;
	}

	/* Méret mezők: egymás alá, hogy elférjenek */
	.anda-size-inputs {
		flex-wrap: wrap;
		gap: 8px;
	}

	.anda-size-inputs > span {
		flex: 1 1 42%;
	}

	.anda-size-x {
		display: none;
	}

	/* Kosár-blokk: a gomb teljes szélességű, a léptető alatta/mellette */
	.anda-cart-row {
		gap: 10px;
	}

	.anda-qty-control {
		flex: 1 1 100%;
	}

	.anda-qty-input {
		flex: 1;
		width: auto;
	}

	.anda-cart-button {
		flex: 1 1 100%;
		padding: 15px 20px;
		font-size: 16px;
	}

	.anda-position-preview img {
		max-width: 140px;
	}

	/* A hosszú technológianevek ne lógjanak ki */
	.anda-field .anda-select {
		max-width: 100%;
		text-overflow: ellipsis;
	}
}

/* Nagyon keskeny kijelzők (≤380px) */
@media (max-width: 380px) {
	.anda-calc-body {
		padding: 14px;
	}

	.anda-qty-btn {
		width: 38px;
	}

	.anda-result-row {
		flex-wrap: wrap;
	}
}

/* =========================================================================
   Ajánlatkérő link a kalkulátorban
   ========================================================================= */

.anda-quote-link {
	display: inline-block;
	margin-left: 4px;
	color: #C2410C;
	font-weight: 600;
	white-space: nowrap;
}

.anda-error a {
	color: #B91C1C;
	font-weight: 600;
	text-decoration: underline;
}

/* Az ajánlatkérő űrlapon az előre kitöltött mezők halványabbak,
   hogy látszódjon: ezeket a rendszer töltötte ki. */
.anda-prefilled input[type="text"] {
	background: #F7F7F9 !important;
	color: #52525B !important;
	font-weight: 500;
}

/* ------------------------------------------------------------------
   Dupla mennyiség-vezérlő megszüntetése
   ------------------------------------------------------------------
   Ahol megjelenik a kalkulátor, ott a `#anda-cart-qty` a mennyiség
   vezérlője; a Woo/Flatsome saját mezője csak egy második +/- párt
   rajzolna. A JS kétirányban szinkronizálja a kettőt, ezért a Woo
   mezőt elrejtjük – az érték a kosárba tételkor így is átkerül.
   A `body.anda-has-calculator` osztályt a frontend PHP teszi ki, kizárólag
   azokon a termékoldalakon, ahol a kalkulátor renderel; az `anda-print-mode`
   osztályt a JS, amikor az „Egyedi nyomtatással” mód aktív. Csak a kettő
   együtt rejt: „Csak a termék” módban a Woo mezője marad az egyetlen
   mennyiség-vezérlő, különben nem lenne egy sem. */
body.anda-has-calculator.anda-print-mode form.cart .quantity {
	display: none !important;
}
