/**
 * NAYDIM Product Card – Basis-Layout.
 *
 * Diese Datei enthält NUR die Struktur (Flexbox, Ausrichtung, Positionierung).
 * Alle Design-Werte (Farben, Schriftgrößen, Abstände, Radius, Schatten)
 * werden über die Elementor-Controls gesetzt und überschreiben die
 * hier hinterlegten Fallbacks.
 */

/* ---------- Grid (Widget: Produktkarten Grid) ----------
 * Spaltenanzahl und Gaps kommen aus den responsiven
 * Elementor-Controls (Desktop / Laptop / Tablet / Mobile). */
.npc-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));   /* Fallback */
	column-gap: 24px;
	row-gap: 24px;
	align-items: stretch;                               /* gleiche Kartenhöhe pro Reihe */
	scrollbar-width: thin;                              /* dezenter Scrollbalken im Scroll-Modus */
}

/* Scroll-Modus ("Horizontal scrollen"):
 * Der Modus selbst wird per Elementor-Control gesetzt (display:flex + overflow).
 * Diese Regeln sind im Raster-Modus wirkungslos, weil Grid-Items
 * Flex-Eigenschaften ignorieren. */
.npc-grid > .npc-card {
	flex: 0 0 var(--npc-card-w, 300px);                 /* Kartenbreite aus dem Slider */
	scroll-snap-align: start;                           /* sauberes Einrasten beim Wischen */
}

/* ---------- Karte ---------- */
.npc-card {
	position: relative;               /* Bezugspunkt für den Badge */
	display: flex;
	flex-direction: column;
	height: 100%;                     /* gleiche Höhe bei Karten nebeneinander */
	box-sizing: border-box;
	background: #fff;
	font-family: inherit;
}

/* ---------- Badge (oben links) ---------- */
.npc-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	display: inline-block;
	line-height: 1.4;
	white-space: nowrap;
}

/* ---------- Produktbild ---------- */
.npc-card__image {
	text-align: center;
}

.npc-card__image img {
	display: inline-block;
	max-width: 100%;
	width: auto;
	object-fit: contain;              /* Bild proportional einpassen */
}

/* ---------- Textzeilen ---------- */
.npc-card__manufacturer,
.npc-card__storage {
	line-height: 1.4;
}

.npc-card__name {
	margin: 0;                        /* Theme-Defaults neutralisieren */
	line-height: 1.25;
}

.npc-card__tariff {
	line-height: 1.4;
}

/* ---------- Energie-Label + Datenblatt ---------- */
.npc-card__datasheet {
	display: flex;
	align-items: center;
	gap: 10px;
}

.npc-card__energy img {
	display: block;
	width: auto;
}

.npc-card__datasheet-link {
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.2s ease;
}

/* ---------- Preisbereich ---------- */
.npc-card__prices {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 12px;
	margin-top: auto;                 /* Preise + Button immer unten bündig */
}

.npc-card__price-col {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.npc-card__price-col--right {
	text-align: right;
	align-items: flex-end;
}

.npc-card__price-label {
	text-transform: uppercase;
	line-height: 1;
}

.npc-card__price-value {
	line-height: 1;
	white-space: nowrap;
	display: inline-flex;
	align-items: flex-start;
	gap: 4px;
}

/* Kleines eingekreistes Info-Icon hinter dem Monatspreis */
.npc-card__info {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 14px;
	height: 14px;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	font-size: 9px;
	font-weight: 700;
	font-style: normal;
	line-height: 1;
	transform: translateY(1px);
}

/* ---------- Button ---------- */
.npc-card__button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.npc-card__button:hover {
	text-decoration: none;
}

.npc-card__button-arrow {
	flex-shrink: 0;
}

/* ---------- Energie-Label als HTML/SVG ---------- */
.npc-card__energy--html {
	display: inline-flex;
	align-items: center;
}

/* ---------- Tooltip am Info-Symbol (Monatspreis) ----------
 * Öffnet per Klick/Tipp (JS toggelt .is-open), zusätzlich per
 * Hover und Tastatur-Fokus. Farben über CSS-Variablen aus den
 * Elementor-Controls (--npc-tip-bg / --npc-tip-color). */
.npc-tooltip {
	position: relative;
	display: inline-flex;
}

button.npc-card__info {
	background: none;
	padding: 0;
	cursor: pointer;
	font-family: inherit;
}

.npc-tooltip__bubble {
	position: absolute;
	bottom: calc(100% + 9px);
	left: 50%;
	transform: translateX(-50%);
	z-index: 20;
	min-width: 180px;
	max-width: 240px;
	background: var(--npc-tip-bg, #1a1a1a);
	color: var(--npc-tip-color, #fff);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
	padding: 10px 12px;
	border-radius: 6px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s ease;
	white-space: normal;
	pointer-events: none;
}

/* Kleiner Pfeil unter der Sprechblase */
.npc-tooltip__bubble::after {
	content: "";
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translateX(-50%);
	border: 6px solid transparent;
	border-top-color: var(--npc-tip-bg, #1a1a1a);
}

.npc-tooltip.is-open .npc-tooltip__bubble,
.npc-tooltip:hover .npc-tooltip__bubble,
.npc-tooltip:focus-within .npc-tooltip__bubble {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* ---------- Responsive ----------
 * Das Stapeln der Karten übernimmt das Elementor-Grid
 * (3 Spalten Desktop → 2 Tablet → 1 Mobile).
 * Hier nur kleine Feinjustierung für sehr schmale Screens. */
@media (max-width: 480px) {
	.npc-card__prices {
		flex-wrap: wrap;
	}
}
