/**
 * AMEA Katalog - core UI (site-wide, small): tokens, buttons, "Dodaj u upit", header counter, toast.
 */

:root {
	--amea-navy: #06264d;
	--amea-navy-footer: #04244c;
	--amea-text: #5b6b82;
	--amea-muted: #8a97ab;
	--amea-teal: #087c84;
	--amea-teal-hover: #06656c;
	--amea-teal-light: #e7f4f5;
	--amea-teal-border: #9ccfd3;
	--amea-bg-light: #f3f7fb;
	--amea-border: #e3e9f0;
	--amea-border-btn: #cfd8e3;
	--amea-border-input: #dde4ec;
	--amea-white: #fff;
	--amea-cyan: #3cc8d8;
	--amea-yellow: #f2c230;
	--amea-green: #5aa832;
	--amea-danger: #b42318;
	--amea-danger-bg: #fef3f2;
	--amea-radius-btn: 8px;
	--amea-radius-card: 12px;
	--amea-radius-input: 8px;
	--amea-shadow: 0 14px 32px rgba(6, 38, 77, 0.09);
	--amea-shadow-sm: 0 4px 14px rgba(6, 38, 77, 0.06);
	--amea-focus: 0 0 0 3px rgba(8, 124, 132, 0.22);
	--amea-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--amea-sticky-top: 24px;
}

.amea-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.amea-icon {
	display: inline-block;
	flex: 0 0 auto;
	vertical-align: middle;
}

/* ---------------------------------------------------------------------
 * Buttons (specificity raised to win over theme / Elementor kit button styles)
 * ------------------------------------------------------------------- */

body a.amea-btn,
body button.amea-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 12px 22px;
	min-height: 44px;
	border: 1px solid transparent;
	border-radius: var(--amea-radius-btn);
	font-family: var(--amea-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: normal;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	white-space: nowrap;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
	-webkit-user-select: none;
	user-select: none;
}

body .amea-btn.amea-btn--solid {
	background-color: var(--amea-teal);
	border-color: var(--amea-teal);
	color: var(--amea-white);
}

body .amea-btn.amea-btn--solid:hover,
body .amea-btn.amea-btn--solid:focus {
	background-color: var(--amea-teal-hover);
	border-color: var(--amea-teal-hover);
	color: var(--amea-white);
	text-decoration: none;
}

body .amea-btn.amea-btn--outline {
	background-color: var(--amea-white);
	border-color: var(--amea-border-btn);
	color: var(--amea-navy);
}

body .amea-btn.amea-btn--outline:hover,
body .amea-btn.amea-btn--outline:focus {
	background-color: var(--amea-white);
	border-color: var(--amea-teal);
	color: var(--amea-teal);
	text-decoration: none;
}

body .amea-btn.amea-btn:focus:not(:focus-visible) {
	outline: none;
	box-shadow: none;
}

body .amea-btn.amea-btn:focus-visible {
	outline: 2px solid var(--amea-teal);
	outline-offset: 2px;
	box-shadow: none;
}

body .amea-btn.amea-btn:disabled,
body .amea-btn.amea-btn[aria-busy="true"] {
	opacity: 0.65;
	cursor: not-allowed;
}

body .amea-btn.amea-btn--sm {
	padding: 9px 16px;
	min-height: 38px;
	font-size: 13px;
}

/* "Dodaj u upit" state: document/plus icon -> check icon. */
.amea-upit-add__icon {
	display: inline-flex;
	line-height: 0;
}

.amea-upit-add__icon--added,
.amea-upit-add.is-added .amea-upit-add__icon--add {
	display: none;
}

.amea-upit-add.is-added .amea-upit-add__icon--added {
	display: inline-flex;
}

body .amea-btn.amea-btn--outline.is-added {
	background-color: var(--amea-teal-light);
	border-color: var(--amea-teal-border);
	color: var(--amea-teal);
}

body .amea-btn.amea-btn--outline.is-added:hover,
body .amea-btn.amea-btn--outline.is-added:focus {
	border-color: var(--amea-teal);
	color: var(--amea-teal-hover);
	background-color: var(--amea-teal-light);
}

/* ---------------------------------------------------------------------
 * Header counter [amea_upit_brojac] - inherits currentColor
 * ------------------------------------------------------------------- */

body a.amea-upit-brojac {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px;
	color: inherit;
	line-height: 0;
	text-decoration: none;
	border-radius: var(--amea-radius-btn);
	transition: opacity 0.18s ease;
}

body a.amea-upit-brojac:hover,
body a.amea-upit-brojac:focus {
	color: inherit;
	opacity: 0.78;
}

body a.amea-upit-brojac:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.amea-upit-brojac__count {
	position: absolute;
	top: -2px;
	right: -4px;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 9px;
	background: var(--amea-yellow);
	color: var(--amea-navy);
	font-family: var(--amea-font);
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.amea-upit-brojac__count[hidden] {
	display: none;
}

/* ---------------------------------------------------------------------
 * Toast
 * ------------------------------------------------------------------- */

.amea-toast {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	width: min(360px, calc(100vw - 32px));
	padding: 14px 14px 14px 16px;
	background: var(--amea-white);
	border: 1px solid var(--amea-border);
	border-left: 4px solid var(--amea-teal);
	border-radius: var(--amea-radius-card);
	box-shadow: var(--amea-shadow);
	font-family: var(--amea-font);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s linear 0.22s;
}

.amea-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition: opacity 0.22s ease, transform 0.22s ease, visibility 0s;
}

.amea-toast.is-error {
	border-left-color: var(--amea-yellow);
}

.amea-toast__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--amea-teal-light);
	color: var(--amea-teal);
}

.amea-toast.is-error .amea-toast__icon {
	background: #fdf5dc;
	color: #8a6a00;
}

.amea-toast__body {
	flex: 1 1 auto;
	min-width: 0;
	padding-top: 1px;
}

.amea-toast__msg {
	margin: 0;
	color: var(--amea-navy);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
}

body a.amea-toast__link {
	display: inline-block;
	margin-top: 4px;
	color: var(--amea-teal);
	font-size: 13px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 2px;
}

body a.amea-toast__link:hover,
body a.amea-toast__link:focus {
	color: var(--amea-teal-hover);
}

body button.amea-toast__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 28px;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--amea-muted);
	cursor: pointer;
}

body button.amea-toast__close:hover,
body button.amea-toast__close:focus {
	background: var(--amea-bg-light);
	color: var(--amea-navy);
}

@media (max-width: 767px) {
	.amea-toast {
		right: 16px;
		left: 16px;
		bottom: 16px;
		width: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.amea-toast,
	.amea-toast.is-visible,
	body a.amea-btn,
	body button.amea-btn {
		transition: none;
	}
}
