/*!
 * Autotehnika — header akcije + "Moja košarica" (lista za upit)
 * Sve je scopeano na .ath-* klase kako ne bi utjecalo na ostatak stranice.
 */

.ath-actions {
	--ath-accent: #C6291F;
	--ath-accent-hover: #CC2419;
	--ath-ink: #1A1A1A;
	--ath-line: #ECE8E4;
	--ath-surface: #FFFFFF;
	--ath-muted: #6B6560;
	--ath-hit: 44px;
	--ath-radius: 10px;
	--ath-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	display: flex;
	align-items: center;
	gap: 6px;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	line-height: 1;
}

/* ---------- Zajednička ikona-gumb ---------- */

/* Dvije klase u selektoru — nadjačava globalni Elementor kit (.elementor-kit-7 button)
   bez pribjegavanja !important. */
.ath-actions .ath-icon-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: var(--ath-hit);
	height: var(--ath-hit);
	min-height: 0;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: var(--ath-radius);
	background: transparent;
	background-color: transparent;
	box-shadow: none;
	color: var(--ath-ink);
	font-size: inherit;
	letter-spacing: normal;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background-color 0.18s var(--ath-ease), color 0.18s var(--ath-ease);
}

.ath-actions .ath-icon-btn svg {
	width: 22px;
	height: 22px;
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.9;
	stroke-linecap: round;
	stroke-linejoin: round;
	pointer-events: none;
}

.ath-actions .ath-icon-btn:hover,
.ath-actions .ath-icon-btn[aria-expanded="true"] {
	background-color: #F6F3F0;
	color: var(--ath-accent-hover);
}

.ath-actions .ath-icon-btn:focus-visible,
.ath-search__field:focus-visible,
.ath-drawer button:focus-visible,
.ath-drawer a:focus-visible,
.ath-drawer input:focus-visible {
	outline: 2px solid var(--ath-accent);
	outline-offset: 2px;
}

/* ---------- Tražilica ---------- */

.ath-search {
	position: relative;
	display: inline-flex;
	align-items: center;
}

.ath-search__panel {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 60;
	display: flex;
	align-items: center;
	gap: 4px;
	box-sizing: border-box;
	width: min(340px, calc(100vw - 32px));
	margin: 0;
	padding: 8px;
	border: 1px solid var(--ath-line);
	border-radius: 12px;
	background: var(--ath-surface);
	box-shadow: 0 12px 28px rgba(26, 26, 26, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
	transition: opacity 0.2s var(--ath-ease), transform 0.2s var(--ath-ease), visibility 0.2s;
}

/* Nevidljivi "most" preko razmaka između ikone i panela — drži hover neprekinutim. */
.ath-search__panel::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -10px;
	height: 10px;
}

.ath-search:hover .ath-search__panel,
.ath-search:focus-within .ath-search__panel,
.ath-search.is-open .ath-search__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(6px);
}

/* Korisnik je izricito zatvorio panel (X ili Esc). Mora nadjacati :hover i
   :focus-within, jer su i toggle i X unutar .ath-search pa oba i dalje vrijede.
   Dupli razred samo podize specificnost - bez !important. */
.ath-search.is-dismissed.is-dismissed .ath-search__panel {
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
}

.ath-search__field {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--ath-line);
	border-radius: 8px;
	background: #FFFFFF;
	color: var(--ath-ink);
	font: inherit;
	font-size: 15px;
	-webkit-appearance: none;
	appearance: none;
}

.ath-search__field::placeholder {
	color: var(--ath-muted);
}

.ath-search__submit,
.ath-search__close {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
}

.ath-search__close svg {
	width: 18px;
	height: 18px;
}

/* ---------- Brojac na košarici ---------- */

.ath-cart-toggle .ath-count {
	position: absolute;
	top: 4px;
	right: 3px;
	display: none;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	box-sizing: border-box;
	border-radius: 9px;
	background: var(--ath-accent);
	color: #FFFFFF;
	font-size: 11px;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.ath-cart-toggle.has-items .ath-count {
	display: block;
}

/* ---------- Mobilni raspored ---------- */

/* Ikone su grupirane i centrirane u redu. */
.ath-mobile-bar {
	position: relative;
}

.ath-actions[data-context="mobile"] {
	flex: 0 0 auto;
	justify-content: center;
	gap: 0;
}

/* Logo na mobitelu — fiksna visina, širina se računa iz omjera (SVG je 1866×386). */
.ath-mobile-logo .elementor-widget-image {
	flex: 0 0 auto;
	width: auto;
	max-width: 100%;
}

.ath-mobile-logo .elementor-widget-image img,
.ath-mobile-logo img {
	display: block;
	width: auto;
	height: 46px;
	max-width: min(74vw, 300px);
	object-fit: contain;
}

.ath-actions[data-context="mobile"] .ath-icon-btn {
	width: 48px;
	height: 48px;
}

.ath-actions[data-context="mobile"] .ath-search {
	position: static;
}

.ath-actions[data-context="mobile"] .ath-search__panel {
	position: absolute;
	top: 100%;
	left: 16px;
	right: 16px;
	width: auto;
	max-width: none;
	transform: translateY(-8px);
}

.ath-actions[data-context="mobile"] .ath-search:hover .ath-search__panel {
	opacity: 0;
	visibility: hidden;
	transform: translateY(-8px);
}

.ath-actions[data-context="mobile"] .ath-search.is-open .ath-search__panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(6px);
}

/* Xpro hamburger u mobilnom redu poravnat s našim ikonama */
.ath-mobile-bar .elementor-widget-xpro-horizontal-menu,
.ath-mobile-bar .elementor-widget-shortcode {
	flex: 0 0 auto;
	width: auto;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ath-mobile-bar .xpro-menu-toggle-wrapper,
.ath-mobile-bar .xpro-horizontal-menu-wrapper {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* i Xpro hamburger nasljedi crvenu iz kita — vraćamo ga na neutralno */
.ath-mobile-bar .xpro-menu-toggle,
.ath-mobile-bar button.xpro-menu-toggle {
	min-height: 0;
	padding: 0;
	background-color: transparent;
	box-shadow: none;
	color: var(--ath-ink, #1A1A1A);
}

/* ---------- Ladica "Moja košarica" ---------- */

.ath-drawer {
	--ath-accent: #C6291F;
	--ath-accent-hover: #A32218;
	--ath-ink: #1A1A1A;
	--ath-line: #ECE8E4;
	--ath-muted: #6B6560;
	--ath-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	position: fixed;
	inset: 0;
	z-index: 100000;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ath-drawer[hidden] {
	display: none;
}

.ath-drawer__overlay {
	position: absolute;
	inset: 0;
	background: rgba(26, 26, 26, 0.45);
	opacity: 0;
	transition: opacity 0.25s var(--ath-ease);
}

.ath-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(440px, 100%);
	background: #FFFFFF;
	box-shadow: -12px 0 40px rgba(26, 26, 26, 0.18);
	transform: translateX(100%);
	transition: transform 0.28s var(--ath-ease);
}

.ath-drawer.is-open .ath-drawer__overlay {
	opacity: 1;
}

.ath-drawer.is-open .ath-drawer__panel {
	transform: translateX(0);
}

.ath-drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--ath-line);
}

.ath-drawer__title {
	margin: 0;
	font-family: Archivo, Inter, sans-serif;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: var(--ath-ink);
}

.ath-drawer .ath-drawer__close {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	min-height: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 10px;
	background-color: transparent;
	box-shadow: none;
	color: var(--ath-ink);
	cursor: pointer;
}

.ath-drawer .ath-drawer__close:hover {
	background-color: #F6F3F0;
	color: var(--ath-accent);
}

.ath-drawer__close svg {
	width: 20px;
	height: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	pointer-events: none;
}

.ath-drawer__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 8px 20px 20px;
}

.ath-drawer__foot {
	flex: 0 0 auto;
	padding: 16px 20px calc(16px + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--ath-line);
	background: #FFFFFF;
}

/* stavke */

.ath-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ath-item {
	display: grid;
	grid-template-columns: 64px 1fr auto;
	gap: 12px;
	align-items: center;
	padding: 14px 0;
	border-bottom: 1px solid var(--ath-line);
}

.ath-item__thumb {
	width: 64px;
	height: 64px;
	border-radius: 8px;
	border: 1px solid var(--ath-line);
	object-fit: contain;
	background: #FAF8F6;
}

.ath-item__body {
	min-width: 0;
}

.ath-item__name {
	display: block;
	margin: 0 0 6px;
	color: var(--ath-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.ath-item__name:hover {
	color: var(--ath-accent);
}

.ath-item__meta {
	margin: 0;
	color: var(--ath-muted);
	font-size: 12px;
}

.ath-qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid var(--ath-line);
	border-radius: 8px;
	overflow: hidden;
}

.ath-drawer .ath-qty button,
.ath-add-wrap .ath-qty button {
	width: 32px;
	height: 36px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	box-shadow: none;
	color: var(--ath-ink);
	font-size: 17px;
	font-weight: 500;
	line-height: 1;
	cursor: pointer;
}

.ath-drawer .ath-qty button:hover,
.ath-add-wrap .ath-qty button:hover {
	background-color: #F6F3F0;
	color: var(--ath-accent);
}

.ath-qty input {
	width: 40px;
	height: 36px;
	border: 0;
	border-left: 1px solid var(--ath-line);
	border-right: 1px solid var(--ath-line);
	background: #FFFFFF;
	color: var(--ath-ink);
	font: inherit;
	font-size: 14px;
	text-align: center;
	-moz-appearance: textfield;
}

.ath-qty input::-webkit-outer-spin-button,
.ath-qty input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ath-item__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.ath-drawer .ath-remove {
	border: 0;
	border-radius: 0;
	min-height: 0;
	background-color: transparent;
	box-shadow: none;
	padding: 4px 2px;
	color: var(--ath-muted);
	font-size: 12px;
	font-weight: 500;
	text-decoration: underline;
	cursor: pointer;
}

.ath-drawer .ath-remove:hover {
	color: var(--ath-accent);
	background-color: transparent;
}

.ath-empty {
	padding: 40px 8px;
	text-align: center;
	color: var(--ath-muted);
	font-size: 15px;
	line-height: 1.6;
}

/* gumbi */

.ath-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 12px 20px;
	border: 1.5px solid transparent;
	border-radius: 10px;
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.18s var(--ath-ease), color 0.18s var(--ath-ease), border-color 0.18s var(--ath-ease);
}

.ath-btn--primary {
	background: var(--ath-accent);
	border-color: var(--ath-accent);
	color: #FFFFFF;
}

.ath-btn--primary:hover {
	background: var(--ath-accent-hover);
	border-color: var(--ath-accent-hover);
	color: #FFFFFF;
}

.ath-drawer .ath-btn--ghost,
.ath-add-wrap .ath-btn--ghost {
	margin-top: 8px;
	background-color: transparent;
	border-color: var(--ath-line);
	color: var(--ath-muted);
	font-weight: 600;
	min-height: 42px;
}

.ath-drawer .ath-btn--ghost:hover,
.ath-add-wrap .ath-btn--ghost:hover {
	background-color: transparent;
	border-color: var(--ath-accent);
	color: var(--ath-accent);
}

.ath-btn[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

/* forma upita unutar ladice */

.ath-form {
	margin-top: 4px;
	padding-top: 18px;
	border-top: 1px solid var(--ath-line);
}

.ath-form[hidden] {
	display: none;
}

.ath-form__intro {
	margin: 0 0 14px;
	color: var(--ath-muted);
	font-size: 13px;
	line-height: 1.5;
}

.ath-drawer .ath-form .ff-btn-submit {
	width: 100%;
}

.ath-note {
	margin: 14px 0 0;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 14px;
	line-height: 1.5;
}

.ath-note--ok {
	background: #EDF7EE;
	color: #1F5B27;
}

.ath-note--err {
	background: #FCEDEC;
	color: #8C1E16;
}

/* dodaj-u-košaricu gumb na proizvodu */

.ath-add-wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	font-family: Inter, system-ui, sans-serif;
}

.ath-add-wrap .ath-qty {
	flex: 0 0 auto;
}

.ath-add-wrap .ath-btn {
	width: auto;
	flex: 1 1 200px;
}

.ath-add-wrap .ath-added {
	flex: 1 1 100%;
	margin: 0;
	color: #1F5B27;
	font-size: 13px;
	font-weight: 600;
}

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

@media (prefers-reduced-motion: reduce) {
	.ath-search__panel,
	.ath-drawer__panel,
	.ath-drawer__overlay,
	.ath-icon-btn,
	.ath-btn {
		transition-duration: 0.01ms;
	}
}
