/* ==========================================================================
   WIStock – Joomla 6 Template
   Mobile-first, modelled on the WIStock app UI
   ========================================================================== */

:root {
	--ws-green: #76b72a;
	--ws-green-dark: #5a9a0f;
	--ws-green-soft: #e9f4d9;
	--ws-green-soft-2: #f4f9ec;
	--ws-dark: #575756;
	--ws-ink: #1f2933;
	--ws-muted: #6b7280;
	--ws-bg: #f2f4f7;
	--ws-card: #ffffff;
	--ws-border: #dfe4ea;
	--ws-red: #ef4444;
	--ws-orange: #f5a623;
	--ws-radius: 18px;
	--ws-radius-sm: 12px;
	--ws-shadow: 0 2px 10px rgba(31, 41, 51, 0.06);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.55;
	color: var(--ws-ink);
	background: var(--ws-bg);
}

img { max-width: 100%; height: auto; }
a { color: var(--ws-green-dark); }
a:hover { color: var(--ws-green); }

h1, h2, h3, h4 { color: var(--ws-ink); line-height: 1.2; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.5px; margin: 0.5rem 0 1rem; }
h2 { font-size: 1.4rem; font-weight: 800; margin: 1.5rem 0 0.75rem; }
h3 { font-size: 1.15rem; font-weight: 700; margin: 1.25rem 0 0.5rem; }

/* Skip link */
.ws-skip {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--ws-ink);
	color: #fff;
	padding: 0.6rem 1rem;
	border-radius: 0 0 8px 0;
	z-index: 2000;
}
.ws-skip:focus { left: 0; color: #fff; }

/* Layout container */
.ws-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 1rem;
}

/* ==========================================================================
   Header
   ========================================================================== */
.ws-header {
	background: var(--ws-green);
	color: #fff;
}

.has-sticky-header .ws-header {
	position: sticky;
	top: 0;
	z-index: 1000;
}

.ws-header.is-scrolled { box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18); }

.ws-header__inner {
	max-width: 1200px;
	margin: 0 auto;
	min-height: 64px;
	padding: 0.75rem 1rem;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.ws-burger {
	background: none;
	border: 0;
	padding: 0.35rem;
	cursor: pointer;
	display: inline-flex;
	flex-direction: column;
	gap: 5px;
}
.ws-burger span {
	display: block;
	width: 27px;
	height: 3.5px;
	border-radius: 3px;
	background: #fff;
}

.ws-logo {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	text-decoration: none;
	background: #fff;
	border-radius: 12px;
	padding: 0.3rem 0.9rem;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
.ws-logo img { max-height: 38px; width: auto; display: block; }

.ws-header__tools {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 36px;
	justify-content: flex-end;
}
.ws-header__tools a { color: #fff; text-decoration: none; }

/* ==========================================================================
   Offcanvas navigation
   ========================================================================== */
.ws-offcanvas {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(320px, 86vw);
	background: #fff;
	z-index: 1100;
	transform: translateX(-105%);
	transition: transform 0.25s ease;
	overflow-y: auto;
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.16);
}
body.ws-nav-open .ws-offcanvas { transform: none; }

.ws-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(31, 41, 51, 0.45);
	z-index: 1050;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s;
}
body.ws-nav-open .ws-backdrop { opacity: 1; pointer-events: auto; }

.ws-offcanvas__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 1rem 1.25rem;
	background: var(--ws-green);
	color: #fff;
	font-weight: 800;
	font-size: 1.1rem;
}
.ws-offcanvas__close {
	background: none;
	border: 0;
	color: #fff;
	font-size: 1.7rem;
	line-height: 1;
	cursor: pointer;
}

.ws-offcanvas__nav ul {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0;
}
.ws-offcanvas__nav a,
.ws-offcanvas__nav .nav-header {
	display: block;
	padding: 0.85rem 1.25rem;
	color: var(--ws-ink);
	text-decoration: none;
	font-weight: 600;
	border-left: 4px solid transparent;
}
.ws-offcanvas__nav li.active > a,
.ws-offcanvas__nav a:hover {
	background: var(--ws-green-soft-2);
	border-left-color: var(--ws-green);
	color: var(--ws-green-dark);
}
.ws-offcanvas__nav ul ul a { padding-left: 2.4rem; font-weight: 500; }

/* ==========================================================================
   Main area & grid
   ========================================================================== */
.ws-main { padding: 1.25rem 0 2.5rem; }

.ws-grid { display: grid; gap: 1.25rem; }

@media (min-width: 992px) {
	.ws-grid--left  { grid-template-columns: 300px 1fr; }
	.ws-grid--right { grid-template-columns: 1fr 300px; }
	.ws-grid--both  { grid-template-columns: 280px 1fr 280px; }
}

/* ==========================================================================
   Cards (matches the app's white rounded panels)
   ========================================================================== */
.ws-card {
	background: var(--ws-card);
	border-radius: var(--ws-radius);
	box-shadow: var(--ws-shadow);
	padding: 1.25rem;
	margin-bottom: 1.25rem;
}
.ws-card__title {
	margin: 0 0 0.75rem;
	font-size: 1.15rem;
	font-weight: 800;
}

/* Stat / dashboard cards */
.ws-stats {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1rem;
	margin: 1rem 0;
}
@media (min-width: 768px) { .ws-stats { grid-template-columns: repeat(3, 1fr); } }

.ws-stat {
	background: #fff;
	border-radius: var(--ws-radius);
	box-shadow: var(--ws-shadow);
	padding: 1.25rem;
}
.ws-stat__icon {
	width: 46px;
	height: 46px;
	border-radius: 13px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.35rem;
	background: var(--ws-green-soft);
	margin-bottom: 1rem;
}
.ws-stat__icon--red    { background: #fde2e2; }
.ws-stat__icon--orange { background: #fdeed2; }
.ws-stat__icon--blue   { background: #dbeefe; }
.ws-stat__value { font-size: 2.1rem; font-weight: 800; line-height: 1; }
.ws-stat__label { color: var(--ws-muted); margin-top: 0.4rem; }

/* Big counter panel ("16 STÜCK AUF LAGER") */
.ws-counter {
	background: #fafbfc;
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius);
	text-align: center;
	padding: 1.75rem 1rem;
	margin: 1rem 0;
}
.ws-counter__value { font-size: 3rem; font-weight: 800; line-height: 1; }
.ws-counter__label {
	color: var(--ws-muted);
	letter-spacing: 2px;
	text-transform: uppercase;
	font-size: 0.85rem;
	margin-top: 0.5rem;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.ws-btn,
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border: 0;
	border-radius: var(--ws-radius-sm);
	padding: 0.75rem 1.5rem;
	font-weight: 700;
	font-size: 1rem;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: filter 0.15s ease, transform 0.05s ease;
}
.ws-btn:active, .btn:active { transform: scale(0.99); }
.ws-btn:hover, .btn:hover { filter: brightness(0.94); }

.ws-btn--green, .btn-primary, .btn-success,
button[type="submit"]:not(.ws-btn):not(.btn) {
	background: var(--ws-green);
	color: #fff;
}
.ws-btn--dark-green { background: var(--ws-green-dark); color: #fff; }
.ws-btn--soft, .btn-secondary, .btn-outline-secondary {
	background: var(--ws-green-soft);
	color: var(--ws-green-dark);
}
.ws-btn--red, .btn-danger { background: var(--ws-red); color: #fff; }
.ws-btn--orange, .btn-warning { background: var(--ws-orange); color: #fff; }
.ws-btn--block { display: flex; width: 100%; }

.btn-primary:hover, .btn-danger:hover, .btn-warning:hover { color: #fff; }

/* Round icon buttons (toolbar row) */
.ws-iconbtn {
	width: 52px;
	height: 52px;
	border-radius: 50%;
	border: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--ws-green-soft);
	color: var(--ws-green-dark);
	font-size: 1.2rem;
	cursor: pointer;
}
.ws-iconbtn--solid { background: var(--ws-green); color: #fff; }
.ws-iconbtn--danger { background: #fde2e2; color: var(--ws-red); }

/* Fixed bottom action bar (Bestellen / Speichern / Löschen) */
.ws-actionbar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 900;
	display: flex;
	gap: 0.6rem;
	padding: 0.65rem 1rem;
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(4px);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
}
.ws-actionbar .ws-btn { flex: 1; }
.ws-actionbar .ws-btn--red { flex: 0 0 auto; }
body.has-actionbar .ws-main { padding-bottom: 6rem; }

/* ==========================================================================
   Chips / filter pills (Alle · Offen · Bestätigt …)
   ========================================================================== */
.ws-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 1rem 0;
}
.ws-chip {
	display: inline-block;
	border: 0;
	border-radius: 999px;
	padding: 0.55rem 1.25rem;
	font-weight: 700;
	font-size: 0.95rem;
	background: var(--ws-green-soft);
	color: var(--ws-green-dark);
	text-decoration: none;
	cursor: pointer;
}
.ws-chip.is-active,
.ws-chip:hover {
	background: var(--ws-green);
	color: #fff;
}

/* Badges */
.ws-badge {
	display: inline-block;
	border-radius: 999px;
	padding: 0.35rem 1rem;
	font-weight: 700;
	font-size: 0.85rem;
	line-height: 1.2;
}
.ws-badge--open { background: var(--ws-orange); color: #fff; }
.ws-badge--ok   { background: var(--ws-green); color: #fff; }
.ws-badge--out  { background: var(--ws-red); color: #fff; }
.ws-badge--tag  {
	background: var(--ws-green-soft);
	color: var(--ws-green-dark);
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.5px;
}

/* ==========================================================================
   List rows (article / order positions)
   ========================================================================== */
.ws-list { list-style: none; margin: 0; padding: 0; }

.ws-row,
.ws-list > li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.95rem 0;
	border-bottom: 1px solid var(--ws-border);
}
.ws-list > li:last-child, .ws-row:last-child { border-bottom: 0; }

.ws-row__title { font-weight: 800; }
.ws-row__meta { color: var(--ws-muted); font-size: 0.92rem; }
.ws-row__value { font-size: 1.6rem; font-weight: 800; text-align: right; }
.ws-row__chevron { color: #9aa3ad; flex: 0 0 auto; }

/* ==========================================================================
   Forms
   ========================================================================== */
label, .form-label {
	display: block;
	font-weight: 600;
	margin: 0.9rem 0 0.35rem;
}

input[type="text"],
input[type="search"],
input[type="email"],
input[type="url"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
select,
textarea,
.form-control,
.form-select {
	width: 100%;
	padding: 0.8rem 1rem;
	border: 1px solid var(--ws-border);
	border-radius: var(--ws-radius-sm);
	background: #fff;
	font: inherit;
	color: inherit;
}

input:focus, select:focus, textarea:focus,
.form-control:focus, .form-select:focus {
	outline: 2px solid var(--ws-green);
	outline-offset: 0;
	border-color: var(--ws-green);
}

fieldset { border: 0; padding: 0; margin: 0; }
legend {
	font-weight: 700;
	color: var(--ws-muted);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-size: 0.85rem;
	margin-bottom: 0.5rem;
}

/* ==========================================================================
   Tables
   ========================================================================== */
table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	border-radius: var(--ws-radius-sm);
	overflow: hidden;
	box-shadow: var(--ws-shadow);
	margin: 1rem 0;
}
th {
	background: var(--ws-green-soft);
	color: var(--ws-green-dark);
	text-align: left;
	padding: 0.8rem 1rem;
	font-weight: 700;
}
td { padding: 0.8rem 1rem; border-top: 1px solid var(--ws-border); }

/* ==========================================================================
   Breadcrumbs, pagination, alerts
   ========================================================================== */
.ws-breadcrumbs { margin-bottom: 1rem; }
.mod-breadcrumbs__wrapper ol,
ol.breadcrumb {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
	color: var(--ws-muted);
	font-size: 0.9rem;
}
.breadcrumb-item + .breadcrumb-item::before { content: "›"; padding: 0 0.35rem; color: #9aa3ad; }

.pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	list-style: none;
	padding: 0;
	margin: 1.5rem 0;
}
.pagination .page-link {
	display: inline-block;
	min-width: 42px;
	text-align: center;
	padding: 0.55rem 0.8rem;
	border-radius: 999px;
	background: #fff;
	border: 1px solid var(--ws-border);
	color: var(--ws-ink);
	text-decoration: none;
	font-weight: 600;
}
.pagination .active .page-link,
.pagination .page-link:hover {
	background: var(--ws-green);
	border-color: var(--ws-green);
	color: #fff;
}

.alert, joomla-alert {
	display: block;
	border-radius: var(--ws-radius-sm);
	padding: 0.9rem 1.1rem;
	margin: 1rem 0;
	border: 1px solid var(--ws-border);
	background: #fff;
	box-shadow: var(--ws-shadow);
}
.alert-success { border-left: 5px solid var(--ws-green); }
.alert-warning { border-left: 5px solid var(--ws-orange); }
.alert-danger, .alert-error { border-left: 5px solid var(--ws-red); }
.alert-info { border-left: 5px solid #3b82f6; }

/* ==========================================================================
   Content (com_content) niceties
   ========================================================================== */
.ws-content .item-page,
.ws-content .blog,
.ws-content .com-content-category-blog,
.ws-content .com-content-article {
	background: var(--ws-card);
	border-radius: var(--ws-radius);
	box-shadow: var(--ws-shadow);
	padding: 1.5rem;
}
.ws-content .page-header h1,
.ws-content .page-header h2 { margin-top: 0; }

.items-more, .readmore { margin-top: 1rem; }
.readmore .btn { background: var(--ws-green); color: #fff; }

/* ==========================================================================
   Footer (grey stripe + green bar, like the login splash)
   ========================================================================== */
.ws-footer { margin-top: 2.5rem; }
.ws-footer__stripe {
	height: 16px;
	width: 62%;
	background: var(--ws-dark);
}
.ws-footer__bar {
	background: var(--ws-green);
	color: #fff;
	padding: 1.5rem 0 1.75rem;
}
.ws-footer a { color: #fff; }
.ws-footer__copy { opacity: 0.92; font-size: 0.92rem; margin-top: 0.35rem; }

/* ==========================================================================
   Error / offline pages
   ========================================================================== */
.ws-splash {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 2rem 1rem;
	background-size: cover;
	background-position: center;
}
.ws-splash__card {
	width: 100%;
	max-width: 420px;
	background: rgba(255, 255, 255, 0.96);
	border-radius: var(--ws-radius);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
	padding: 2rem 1.75rem;
	text-align: center;
}
.ws-splash__logo img { max-height: 72px; margin-bottom: 1rem; }
.ws-splash__code {
	font-size: 4rem;
	font-weight: 800;
	color: var(--ws-green);
	line-height: 1;
	margin: 0.5rem 0;
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.ws-text-muted { color: var(--ws-muted); }
.ws-text-center { text-align: center; }
.ws-mt-0 { margin-top: 0; }
.ws-mb-0 { margin-bottom: 0; }
.ws-hidden { display: none !important; }

@media print {
	.ws-header, .ws-footer, .ws-actionbar, .ws-offcanvas, .ws-backdrop { display: none !important; }
	body { background: #fff; }
	.ws-card { box-shadow: none; border: 1px solid #ccc; }
}
