/* GK Kundenportal – Frontend-Styles.
   Nutzt die Theme-CSS-Variablen (mit Fallbacks), damit das Portal in allen
   GK-Themes konsistent aussieht. */

.gkkp-portal {
	--gkkp-primary: var(--primary, #1290CF);
	--gkkp-primary-dark: var(--primary-dark, #0E72A3);
	--gkkp-ink: var(--ink, #0F172A);
	--gkkp-text: var(--text, #334155);
	--gkkp-muted: var(--muted, #64748B);
	--gkkp-line: var(--line, #E2E8F0);
	--gkkp-bg-soft: var(--bg-soft, #F8FAFC);
	--gkkp-radius: var(--radius, 10px);
	color: var(--gkkp-text);
}

/* --- Navigation --- */
.gkkp-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 0 16px;
	margin-bottom: 24px;
	border-bottom: 1px solid var(--gkkp-line);
}
.gkkp-nav-link {
	padding: 8px 14px;
	border-radius: 8px;
	font-weight: 600;
	font-size: 14px;
	color: var(--gkkp-text);
	text-decoration: none;
	transition: background .15s ease, color .15s ease;
}
.gkkp-nav-link:hover { background: var(--gkkp-bg-soft); color: var(--gkkp-ink); }
.gkkp-nav-link.is-active { background: var(--gkkp-primary); color: #fff; }
.gkkp-nav-konto { margin-left: auto; }
.gkkp-nav-logout { color: var(--gkkp-muted); }

/* --- Hinweise --- */
.gkkp-notice {
	padding: 14px 16px;
	border-radius: var(--gkkp-radius);
	margin-bottom: 18px;
	font-size: 15px;
}
.gkkp-notice-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.gkkp-notice-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.gkkp-notice-info    { background: var(--gkkp-bg-soft); color: var(--gkkp-ink); border: 1px solid var(--gkkp-line); }

/* --- Login --- */
.gkkp-login { max-width: 420px; }
.gkkp-login .login-username,
.gkkp-login .login-password { margin-bottom: 12px; }
.gkkp-login label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--gkkp-ink); }
.gkkp-login input[type="text"],
.gkkp-login input[type="password"] {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--gkkp-line);
	border-radius: 8px;
	font-size: 15px;
}
.gkkp-login .login-remember { font-weight: 400; }
.gkkp-login-lost { margin-top: 10px; font-size: 14px; }

/* --- Passwort vergessen --- */
.gkkp-lostpass { margin-top: 12px; max-width: 420px; }
.gkkp-lostpass summary { cursor: pointer; font-size: 14px; color: var(--gkkp-primary); }
.gkkp-lostpass-intro { font-size: 13px; color: var(--gkkp-muted); margin: 10px 0 8px; }
.gkkp-lostpass-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.gkkp-lostpass-form input[type="text"] { width: 100%; padding: 11px 12px; border: 1px solid var(--gkkp-line); border-radius: 8px; font-size: 15px; margin-bottom: 10px; }

/* --- Konto / Passwort ändern --- */
.gkkp-account { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--gkkp-line); max-width: 460px; }
.gkkp-account h3 { margin: 0 0 12px; }

/* --- Dashboard-Karten --- */
.gkkp-cards {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	margin-top: 8px;
}
.gkkp-card {
	display: block;
	padding: 20px;
	border: 1px solid var(--gkkp-line);
	border-radius: var(--gkkp-radius);
	background: #fff;
	text-decoration: none;
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.gkkp-card:hover { border-color: var(--gkkp-primary); transform: translateY(-2px); box-shadow: var(--shadow, 0 4px 16px rgba(15,23,42,.08)); }
.gkkp-card-title { display: block; font-weight: 700; font-size: 17px; color: var(--gkkp-ink); margin-bottom: 6px; }
.gkkp-card-text { display: block; color: var(--gkkp-muted); font-size: 14px; }

/* --- Katalog-Suche --- */
.gkkp-search { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.gkkp-search-input { flex: 1; min-width: 240px; padding: 11px 12px; border: 1px solid var(--gkkp-line); border-radius: 8px; font-size: 15px; }
.gkkp-search-reset { font-size: 14px; color: var(--gkkp-muted); }
.gkkp-search-info { font-size: 13px; color: var(--gkkp-muted); margin: -4px 0 16px; }
.gkkp-katalog-hinweis { font-size: 12px; color: var(--gkkp-muted); margin: 16px 0 0; font-style: italic; }

/* --- Produktliste (kompakt) --- */
.gkkp-product-grid { display: flex; flex-direction: column; gap: 10px; }
.gkkp-product-card {
	display: flex;
	gap: 14px;
	align-items: flex-start;
	padding: 12px 14px;
	border: 1px solid var(--gkkp-line);
	border-radius: var(--gkkp-radius);
	background: #fff;
}
.gkkp-product-media { flex: 0 0 64px; width: 64px; height: 64px; background: var(--gkkp-bg-soft); border-radius: 8px; overflow: hidden; }
.gkkp-product-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gkkp-product-noimg { width: 100%; height: 100%; background: var(--gkkp-bg-soft); }
.gkkp-product-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.gkkp-product-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.gkkp-product-title { font-size: 15px; line-height: 1.3; margin: 0; color: var(--gkkp-ink); }
.gkkp-product-ids { font-size: 12px; color: var(--gkkp-muted); display: inline-flex; gap: 12px; flex-wrap: wrap; }

.gkkp-product-desc-wrap { display: flex; gap: 6px; align-items: flex-start; }
.gkkp-product-desc { font-size: 13px; color: var(--gkkp-text); flex: 1; min-width: 0; }
.gkkp-product-desc:not(.is-open) {
	display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.gkkp-desc-toggle {
	flex: 0 0 auto; background: none; border: none; cursor: pointer; color: var(--gkkp-muted);
	font-size: 15px; line-height: 1; padding: 4px 12px; margin: -4px 0; transition: transform .15s ease;
}
.gkkp-desc-toggle[aria-expanded="true"] { transform: rotate(180deg); }
.gkkp-desc-toggle.is-hidden { display: none; }

/* Beschreibungs-Button-Modus */
.gkkp-desc-btn {
	margin-left: auto; flex: 0 0 auto; background: none; border: none; cursor: pointer;
	color: var(--gkkp-primary); font-size: 13px; font-weight: 600; padding: 2px 4px; white-space: nowrap;
}
.gkkp-desc-btn span { display: inline-block; transition: transform .15s ease; }
.gkkp-desc-btn.is-open span { transform: rotate(180deg); }
.gkkp-desc-full { font-size: 13px; color: var(--gkkp-text); margin: 4px 0 0; }

.gkkp-product-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 2px; }
.gkkp-product-price { font-weight: 700; font-size: 15px; color: var(--gkkp-ink); }
.gkkp-product-price small { font-weight: 500; font-size: 12px; color: var(--gkkp-muted); }
.gkkp-minderhint { font-size: 12px; color: var(--gkkp-muted); }
.gkkp-datasheet { font-size: 13px; }
.gkkp-add-row { display: flex; gap: 8px; align-items: center; margin-left: auto; position: relative; }
.gkkp-qty-input { width: 64px; padding: 7px 8px; border: 1px solid var(--gkkp-line); border-radius: 8px; font-size: 14px; }
.gkkp-add-row .btn { padding: 8px 16px; font-size: 14px; white-space: nowrap; }
.gkkp-add-feedback { position: absolute; top: calc(100% + 2px); right: 0; font-size: 12px; color: #065f46; opacity: 0; transition: opacity .2s ease; white-space: nowrap; pointer-events: none; }
.gkkp-add-feedback.is-visible { opacity: 1; }

@media (max-width: 560px) {
	.gkkp-add-row { margin-left: 0; width: 100%; }
	.gkkp-add-row .btn { flex: 1; justify-content: center; }
}

/* --- Warenkorb-Tabelle --- */
.gkkp-cart-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.gkkp-cart-table th, .gkkp-cart-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--gkkp-line); font-size: 15px; vertical-align: middle; }
.gkkp-cart-table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--gkkp-muted); }
.gkkp-cart-name { font-weight: 600; color: var(--gkkp-ink); }
.gkkp-cart-qty { width: 80px; padding: 8px 10px; border: 1px solid var(--gkkp-line); border-radius: 8px; font-size: 15px; }
.gkkp-cart-total-label { text-align: right; font-weight: 600; }
.gkkp-cart-total { font-weight: 700; font-size: 18px; color: var(--gkkp-ink); }
.gkkp-remove { background: none; border: none; cursor: pointer; font-size: 22px; line-height: 1; color: var(--gkkp-muted); padding: 0 4px; }
.gkkp-remove:hover { color: var(--danger, #DC2626); }
.gkkp-cart-hint { font-size: 13px; color: var(--gkkp-muted); margin-bottom: 24px; }

/* --- Bestell-Historie --- */
.gkkp-order { border: 1px solid var(--gkkp-line); border-radius: var(--gkkp-radius); margin-bottom: 12px; background: #fff; }
.gkkp-order > summary { display: grid; grid-template-columns: minmax(165px, 1fr) 1fr 1fr 1fr 1fr auto; gap: 12px 16px; align-items: center; padding: 14px 16px; cursor: pointer; font-size: 15px; }
.gkkp-order > summary > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gkkp-order-date { font-weight: 600; color: var(--gkkp-ink); }
.gkkp-order-besteller { font-size: 13px; color: var(--gkkp-muted); }
.gkkp-order-bestellnr { font-size: 13px; color: var(--gkkp-muted); }
.gkkp-order-ab { font-size: 13px; color: var(--gkkp-muted); font-weight: 600; }
.gkkp-order-sum { font-weight: 700; }
.gkkp-order-status { justify-self: end; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--gkkp-bg-soft); color: var(--gkkp-text); }
@media (max-width: 680px) {
	.gkkp-order > summary { display: flex; flex-wrap: wrap; gap: 6px 14px; }
	.gkkp-order > summary > span:empty { display: none; }
	.gkkp-order-status { margin-left: auto; justify-self: auto; }
}
.gkkp-status-bestaetigt { background: #dbeafe; color: #1e40af; }
.gkkp-status-in_bearbeitung { background: #fef3c7; color: #92400e; }
.gkkp-status-erledigt { background: #d1fae5; color: #065f46; }
.gkkp-status-storniert { background: #fee2e2; color: #991b1b; }
.gkkp-order-detail { padding: 0 16px 16px; }
.gkkp-order-flag { color: var(--gkkp-primary); font-size: 12px; margin-left: 8px; }
.gkkp-kundeninfo { margin: 0 0 14px; }
.gkkp-line-changed td { background: #fffbeb; }
.gkkp-changed-badge { display: inline-block; font-size: 11px; font-weight: 600; color: #92400e; background: #fef3c7; border-radius: 999px; padding: 1px 8px; margin-left: 6px; vertical-align: middle; }
.gkkp-order-changelog { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--gkkp-line); font-size: 13px; }
.gkkp-changelog-entry { margin: 8px 0 0; }
.gkkp-changelog-meta { color: var(--gkkp-muted); font-size: 12px; }
.gkkp-order-addresses { display: flex; flex-wrap: wrap; gap: 24px; margin: 10px 0; font-size: 14px; }
.gkkp-order-addresses > div { min-width: 200px; }

/* --- Status-Badge im Backend --- */
.gkkp-status-badge { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eef2f7; color: #334155; }
.gkkp-status-badge.gkkp-status-bestaetigt { background: #dbeafe; color: #1e40af; }
.gkkp-status-badge.gkkp-status-in_bearbeitung { background: #fef3c7; color: #92400e; }
.gkkp-status-badge.gkkp-status-erledigt { background: #d1fae5; color: #065f46; }
.gkkp-status-badge.gkkp-status-storniert { background: #fee2e2; color: #991b1b; }

/* --- Anfrageformular --- */
.gkkp-anfrage-intro { color: var(--gkkp-muted); margin: 0 0 16px; }
.gkkp-anfrage-form { max-width: 640px; }
.gkkp-anfrage-form .form-row { margin-bottom: 14px; }
.gkkp-anfrage-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; color: var(--gkkp-ink); }
.gkkp-anfrage-form input[type="text"],
.gkkp-anfrage-form textarea {
	width: 100%;
	padding: 11px 12px;
	border: 1px solid var(--gkkp-line);
	border-radius: 8px;
	font-size: 15px;
	font-family: inherit;
	box-sizing: border-box;
}
.gkkp-anfrage-form textarea { resize: vertical; min-height: 120px; }
.gkkp-anfrage-list { margin-top: 32px; }
.gkkp-anfrage > summary { grid-template-columns: minmax(150px, 1fr) 2fr 1fr auto; }
.gkkp-anfrage-betreff { font-weight: 600; color: var(--gkkp-ink); }

/* --- Freitext unter Bestellbestätigung --- */
.gkkp-bestelltext { margin: -6px 0 18px; padding: 14px 16px; border: 1px solid var(--gkkp-line); border-radius: var(--gkkp-radius); background: var(--gkkp-bg-soft); font-size: 14px; }
.gkkp-bestelltext p { margin: 0 0 8px; }
.gkkp-bestelltext p:last-child { margin-bottom: 0; }

/* --- Unterartikel-Modal --- */
.gkkp-modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.5); display: flex; align-items: center; justify-content: center; z-index: 99999; padding: 16px; }
.gkkp-modal { background: #fff; border-radius: 12px; max-width: 560px; width: 100%; max-height: 85vh; overflow: auto; padding: 22px; box-shadow: 0 16px 40px rgba(15,23,42,.25); }
.gkkp-modal h3 { margin: 0 0 6px; font-size: 18px; }
.gkkp-modal-intro { font-size: 14px; color: #64748B; margin: 0 0 14px; }
.gkkp-modal-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: 14px; }
.gkkp-modal-table th, .gkkp-modal-table td { padding: 8px; border-bottom: 1px solid #E2E8F0; text-align: left; vertical-align: middle; }
.gkkp-modal-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #64748B; }
.gkkp-modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* --- Toast (Rückmeldung) --- */
.gkkp-toast { position: fixed; right: 16px; bottom: 16px; max-width: 320px; background: #0F172A; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px rgba(15,23,42,.25); opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; z-index: 100000; pointer-events: none; }
.gkkp-toast.is-visible { opacity: 1; transform: translateY(0); }
.gkkp-toast.is-error { background: #b91c1c; }

/* --- Honeypot --- */
.gkkp-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* --- Button-Fallback (falls ein Theme keine .btn-Klassen mitbringt) --- */
.gkkp-portal .btn:not([class*="btn-"]),
.gkkp-portal .btn-primary {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 12px 22px; border-radius: 8px; font-weight: 600; font-size: 15px;
	cursor: pointer; border: 1px solid transparent; text-decoration: none;
}
.gkkp-portal .btn-primary { background: var(--gkkp-primary); color: #fff; }
.gkkp-portal .btn-primary:hover { background: var(--gkkp-primary-dark); color: #fff; }
.gkkp-portal .btn-outline { background: #fff; color: var(--gkkp-ink); border-color: var(--gkkp-line); }
/* Formular-Buttons erben weder Schrift noch Theme-Optik — Safari stylt sie
   sonst nativ (kleiner blauer Pill-Button). */
.gkkp-portal input.btn,
.gkkp-portal button.btn {
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
	line-height: 1.2;
}

/* --- Responsive Warenkorb --- */
@media (max-width: 640px) {
	.gkkp-cart-table thead { display: none; }
	.gkkp-cart-table, .gkkp-cart-table tbody, .gkkp-cart-table tr, .gkkp-cart-table td { display: block; width: 100%; }
	.gkkp-cart-table tr { border: 1px solid var(--gkkp-line); border-radius: var(--gkkp-radius); margin-bottom: 12px; padding: 6px 10px; }
	.gkkp-cart-table td { border: none; padding: 6px 0; display: flex; justify-content: space-between; gap: 12px; }
	.gkkp-cart-table td::before { content: attr(data-label); font-size: 12px; color: var(--gkkp-muted); font-weight: 600; }
	.gkkp-cart-table tfoot tr { border: none; }
}
