/**
 * AMAX — модал "продуктът е добавен"
 */

.amax-atc-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(16, 32, 28, 0.45);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
}

.amax-atc-overlay.is-open {
	opacity: 1;
	visibility: visible;
}

.amax-atc-modal {
	position: relative;
	width: 100%;
	max-width: 440px;
	background: var(--surface, #fff);
	border-radius: 4px;
	box-shadow: 0 24px 60px rgba(16, 32, 28, 0.28);
	padding: 36px 32px 28px;
	text-align: center;
	font-family: 'Inter', system-ui, sans-serif;
	color: var(--ink, #10201C);
	transform: translateY(16px) scale(0.96);
	opacity: 0;
	transition: transform 0.36s cubic-bezier(0.2, 0.9, 0.3, 1.3), opacity 0.28s ease;
}

.amax-atc-overlay.is-open .amax-atc-modal {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.amax-atc-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: var(--ink-soft, #4B5D58);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	border-radius: 50%;
	transition: background 0.2s ease, color 0.2s ease;
}

.amax-atc-close:hover {
	background: var(--bg, #F3F6F4);
	color: var(--ink, #10201C);
}

/* Отметка */

.amax-atc-check {
	width: 64px;
	height: 64px;
	margin: 0 auto 18px;
}

.amax-atc-check circle {
	stroke: var(--teal, #0E9C94);
	stroke-width: 2.5;
	fill: none;
	stroke-dasharray: 166;
	stroke-dashoffset: 166;
}

.amax-atc-check path {
	stroke: var(--teal, #0E9C94);
	stroke-width: 3.5;
	stroke-linecap: round;
	stroke-linejoin: round;
	fill: none;
	stroke-dasharray: 48;
	stroke-dashoffset: 48;
}

.amax-atc-overlay.is-open .amax-atc-check circle {
	animation: amax-atc-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) 0.1s forwards;
}

.amax-atc-overlay.is-open .amax-atc-check path {
	animation: amax-atc-stroke 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.5s forwards;
}

/* Успех показва отметка, грешка — удивителен знак. */

.amax-atc-mark-err,
.amax-atc-overlay.is-error .amax-atc-mark-ok {
	display: none;
}

.amax-atc-overlay.is-error .amax-atc-mark-err {
	display: block;
}

.amax-atc-overlay.is-error .amax-atc-check circle,
.amax-atc-overlay.is-error .amax-atc-check path {
	stroke: var(--sale, #E63946);
}

.amax-atc-overlay.is-error .amax-atc-product,
.amax-atc-overlay.is-error .amax-atc-summary,
.amax-atc-overlay.is-error .amax-atc-btn-primary {
	display: none;
}

.amax-atc-overlay.is-error .amax-atc-title {
	font-size: 16px;
	line-height: 1.5;
	font-weight: 600;
	/* Темата вдига h2 в главни букви — за дълго съобщение това не се чете. */
	text-transform: none;
	letter-spacing: 0;
}

@keyframes amax-atc-stroke {
	to { stroke-dashoffset: 0; }
}

.amax-atc-title {
	font-family: 'Space Grotesk', system-ui, sans-serif;
	font-size: 20px;
	font-weight: 700;
	margin: 0 0 22px;
	letter-spacing: -0.01em;
}

/* Продукт */

.amax-atc-product {
	display: flex;
	align-items: center;
	gap: 14px;
	text-align: left;
	padding: 14px;
	background: var(--bg, #F3F6F4);
	border-radius: 3px;
	margin-bottom: 10px;
}

.amax-atc-product img {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 2px;
	flex-shrink: 0;
	background: #fff;
}

.amax-atc-product-info {
	min-width: 0;
	flex: 1;
}

.amax-atc-product-name {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	margin: 0 0 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.amax-atc-product-price {
	font-size: 14px;
	font-weight: 700;
	color: var(--teal-deep, #0A6E68);
}

.amax-atc-product-price del {
	color: var(--ink-soft, #4B5D58);
	font-weight: 400;
	margin-right: 5px;
}

.amax-atc-product-price ins {
	text-decoration: none;
}

.amax-atc-summary {
	font-size: 13px;
	color: var(--ink-soft, #4B5D58);
	margin: 0 0 22px;
}

.amax-atc-summary strong {
	color: var(--ink, #10201C);
}

/* Бутони */

.amax-atc-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.amax-atc-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 14px 20px;
	border-radius: 2px;
	font-family: 'Inter', system-ui, sans-serif;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: 1.5px solid transparent;
	transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.12s ease;
	text-decoration: none;
}

.amax-atc-btn:active {
	transform: translateY(1px);
}

.amax-atc-btn-primary {
	background: var(--teal, #0E9C94);
	color: #fff;
}

.amax-atc-btn-primary:hover {
	background: var(--teal-deep, #0A6E68);
	color: #fff;
}

.amax-atc-btn-primary svg {
	transition: transform 0.2s ease;
}

.amax-atc-btn-primary:hover svg {
	transform: translateX(3px);
}

.amax-atc-btn-ghost {
	background: transparent;
	border-color: var(--line, #DCE3E0);
	color: var(--ink, #10201C);
}

.amax-atc-btn-ghost:hover {
	border-color: var(--ink, #10201C);
	background: var(--bg, #F3F6F4);
}

/* Състояние на бутона за добавяне */

.amax-atc-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Пулс на брояча в количката */

.amax-cart-count-pulse {
	animation: amax-atc-pulse 0.5s ease;
}

@keyframes amax-atc-pulse {
	0%   { transform: scale(1); }
	40%  { transform: scale(1.45); }
	100% { transform: scale(1); }
}

/* Мобилен — долен лист */

@media (max-width: 480px) {
	.amax-atc-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.amax-atc-modal {
		max-width: none;
		border-radius: 4px 4px 0 0;
		padding: 30px 22px 24px;
		transform: translateY(100%);
	}

	.amax-atc-overlay.is-open .amax-atc-modal {
		transform: translateY(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.amax-atc-overlay,
	.amax-atc-modal,
	.amax-atc-btn {
		transition-duration: 0.01ms;
	}

	.amax-atc-check circle,
	.amax-atc-check path {
		animation: none;
		stroke-dashoffset: 0;
	}

	.amax-cart-count-pulse {
		animation: none;
	}
}

/* Подсказки при търсене */
.search-suggest{
	position:absolute; top:calc(100% + 8px); left:-1.5px; right:-1.5px; z-index:900;
	background:var(--surface, #fff); border:1px solid var(--line, #DCE3E0); border-radius:3px;
	box-shadow:0 14px 38px rgba(16,32,28,.16); overflow:hidden; max-height:min(70vh, 460px); overflow-y:auto;
}
.search-suggest[hidden]{display:none;}
.suggest-item{display:flex; align-items:center; gap:12px; padding:10px 14px; border-bottom:1px solid var(--line, #DCE3E0);}
.suggest-item:last-of-type{border-bottom:none;}
.suggest-item:hover,
.suggest-item.is-active{background:var(--bg, #F3F6F4);}
.suggest-item img{width:46px; height:46px; object-fit:contain; background:#fff; border:1px solid var(--line, #DCE3E0); flex-shrink:0;}
.suggest-text{display:flex; flex-direction:column; gap:3px; min-width:0;}
.suggest-name{font-size:13.5px; font-weight:500; color:var(--ink, #10201C); line-height:1.35;
	display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;}
.suggest-price{font-size:13px; font-weight:700; color:var(--teal-deep, #0A6E68);}
.suggest-price del{font-weight:400; opacity:.6; margin-right:5px;}
.suggest-price ins{text-decoration:none; color:var(--sale, #E63946);}
.suggest-all{display:block; padding:12px 14px; text-align:center; font-size:13px; font-weight:600;
	color:var(--teal-deep, #0A6E68); background:var(--bg, #F3F6F4); border-top:1px solid var(--line, #DCE3E0);}
.suggest-all:hover,
.suggest-all.is-active{background:var(--teal, #0E9C94); color:#fff;}
.suggest-empty{padding:18px 14px; text-align:center; font-size:13.5px; color:var(--ink-soft, #4B5D58);}
.search-bar.is-searching button::after{content:'…'; margin-left:4px;}

/* Галерия */
.gallery-main{background:var(--surface); border:1px solid var(--line); aspect-ratio:1/1; overflow:hidden; display:flex; align-items:center; justify-content:center; cursor:zoom-in; position:relative;}
.gallery-main img{width:100%; height:100%; object-fit:contain; padding:18px;}
.gallery-main::after{
  content:''; position:absolute; right:14px; bottom:14px; width:34px; height:34px; border-radius:50%;
  background:rgba(16,32,28,.72) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5M11 8v6M8 11h6'/%3E%3C/svg%3E") center/18px no-repeat;
  opacity:0; transition:opacity .2s ease; pointer-events:none;
}
.gallery-main:hover::after{opacity:1;}
.gallery-thumbs{display:flex; gap:10px; margin-top:12px; flex-wrap:wrap;}
.gallery-thumbs img{width:70px; height:70px; object-fit:contain; background:#fff; padding:6px; border:1.5px solid var(--line); cursor:pointer; transition:border-color .15s ease;}
.gallery-thumbs img:hover{border-color:var(--teal);}
.gallery-thumbs img.is-active{border-color:var(--teal); border-width:2px;}

/* Lightbox */
.amax-lb{
  position:fixed; inset:0; z-index:999998; display:flex; align-items:center; justify-content:center;
  background:rgba(11,24,21,.94); opacity:0; visibility:hidden; transition:opacity .25s ease, visibility .25s ease;
}
.amax-lb.is-open{opacity:1; visibility:visible;}
.amax-lb-stage{position:relative; width:100%; height:100%; display:flex; align-items:center; justify-content:center; padding:64px 72px;}
.amax-lb img{max-width:100%; max-height:100%; object-fit:contain; transform:scale(.96); transition:transform .28s cubic-bezier(.2,.9,.3,1.2);}
.amax-lb.is-open img{transform:scale(1);}
.amax-lb-btn{
  position:absolute; width:46px; height:46px; border-radius:50%; border:1px solid rgba(255,255,255,.22);
  background:rgba(255,255,255,.08); color:#fff; display:flex; align-items:center; justify-content:center;
  cursor:pointer; padding:0; transition:background .18s ease, border-color .18s ease;
}
.amax-lb-btn:hover{background:rgba(255,255,255,.2); border-color:rgba(255,255,255,.45);}
.amax-lb-btn svg{width:22px; height:22px; stroke:#fff; fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round;}
.amax-lb-close{top:20px; right:20px;}
.amax-lb-prev{left:16px; top:50%; margin-top:-23px;}
.amax-lb-next{right:16px; top:50%; margin-top:-23px;}
.amax-lb-btn[hidden]{display:none;}
.amax-lb-count{position:absolute; bottom:22px; left:50%; transform:translateX(-50%); color:rgba(255,255,255,.75); font-size:13px; font-weight:500; letter-spacing:.04em;}

@media (max-width: 640px){
  .amax-lb-stage{padding:56px 12px;}
  .amax-lb-prev{left:8px;}
  .amax-lb-next{right:8px;}
}
@media (prefers-reduced-motion: reduce){
  .amax-lb, .amax-lb img{transition-duration:.01ms;}
}
