/* ==========================================================================
   Aisivio components — product cards, modals, drawer, toasts, search,
   wishlist UI, ship progress
   ========================================================================== */

/* ---------- Product card ---------- */
.a-pcard {
	position: relative;
	background: #fff;
	border: 1px solid var(--a-border);
	border-radius: 14px;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	transition: border-color .25s var(--a-ease), box-shadow .25s var(--a-ease), transform .25s var(--a-ease);
}
.a-pcard:hover {
	border-color: rgba(0, 168, 204, .6);
	box-shadow: var(--a-shadow-md);
	transform: translateY(-2px);
}

.a-pcard__media { position: relative; border-radius: 10px; overflow: hidden; background: #f1f3f8; }
.a-pcard__thumb { display: block; }
.a-pcard__thumb img { width: 100%; height: 210px; object-fit: cover; transition: transform .5s var(--a-ease); }
.a-pcard:hover .a-pcard__thumb img { transform: scale(1.05); }

.a-pcard__tag {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	background: var(--a-deep);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .06em;
	padding: 4px 8px;
	border-radius: 6px;
	text-transform: uppercase;
}

.a-pcard__body { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.a-pcard__title { font-size: 14px; font-weight: 700; line-height: 1.35; margin: 0; }
.a-pcard__title a:hover { color: var(--a-cyan); }
.a-pcard__desc {
	font-size: 12px;
	color: var(--a-muted);
	margin: 0;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.a-pcard__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding-top: 12px;
	border-top: 1px solid var(--a-border);
	margin-top: auto;
}
.a-pcard__price, .a-pcard__foot .price { font-size: 16px; font-weight: 800; color: var(--a-deep); }
.a-pcard__foot .price del { color: #94a3b8; font-weight: 600; font-size: 13px; margin-right: 5px; }
.a-pcard__foot .price ins { text-decoration: none; }
.a-pcard__actions { display: flex; align-items: center; gap: 8px; }

/* ---------- Wishlist button ---------- */
.a-wish {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 3;
	width: 34px;
	height: 34px;
	border-radius: 999px;
	border: 1px solid var(--a-border);
	background: rgba(255, 255, 255, .92);
	color: #475569;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all .2s;
	padding: 0;
	font-size: 14px;
}
.a-wish:hover { color: var(--a-red); border-color: #fecaca; }
.a-wish.is-active { color: var(--a-red); border-color: #fecaca; background: #fef2f2; }

/* Single product: inline button with label */
.single-product div.product .a-wish {
	position: static;
	width: auto;
	height: auto;
	border-radius: 12px;
	padding: 12px 18px;
	gap: 8px;
	font-size: 13px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	background: #fff;
}

/* ---------- Quick view button ---------- */
.a-qv {
	width: 36px;
	height: 36px;
	border-radius: 10px;
	border: 1px solid var(--a-border);
	background: var(--a-bg);
	color: var(--a-text);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: all .2s;
	font-size: 13px;
	padding: 0;
}
.a-qv:hover { background: #e8ebf2; color: var(--a-deep); }

/* ---------- Quick view content ---------- */
.a-qv-content { min-height: 160px; }
.a-qv { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 768px) { .a-qv { grid-template-columns: 1fr 1fr; } }
.a-qv__media { position: relative; border-radius: 14px; overflow: hidden; background: #f1f3f8; }
.a-qv__media img { width: 100%; height: 100%; object-fit: cover; max-height: 440px; }
.a-qv__body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.a-qv__title { font-family: var(--a-font-serif); font-size: 22px; margin: 0; }
.a-qv__price { font-size: 22px; font-weight: 800; color: var(--a-deep); }
.a-qv__price del { color: #94a3b8; font-size: 15px; font-weight: 600; margin-right: 6px; }
.a-qv__price ins { text-decoration: none; }
.a-qv__desc { font-size: 13px; color: var(--a-muted); }
.a-qv__desc p { margin-bottom: .6em; }
.a-qv__stock {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 12px;
	color: #0f766e;
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	border-radius: 10px;
	padding: 9px 12px;
}
.a-qv__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding-top: 14px;
	border-top: 1px solid var(--a-border);
	margin-top: auto;
}
.a-qv__link { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--a-cyan); display: inline-flex; gap: 6px; align-items: center; }

/* ---------- Modals ---------- */
.a-modal {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 18px;
	visibility: hidden;
	opacity: 0;
	transition: opacity .22s var(--a-ease), visibility .22s;
}
.a-modal.is-open { visibility: visible; opacity: 1; }
.a-modal__overlay { position: absolute; inset: 0; background: rgba(20, 12, 36, .8); backdrop-filter: blur(3px); }
.a-modal__panel {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 760px;
	max-height: 88vh;
	overflow: auto;
	background: #fff;
	border: 1px solid var(--a-border);
	border-radius: 18px;
	box-shadow: var(--a-shadow-lg);
	padding: 22px;
	transform: translateY(14px) scale(.98);
	transition: transform .25s var(--a-ease);
}
.a-modal.is-open .a-modal__panel { transform: none; }
.a-modal__panel--sm { max-width: 440px; }
.a-modal__panel--search { max-width: 620px; align-self: flex-start; margin-top: 7vh; }
.a-modal__panel--wide { max-width: 920px; }

.a-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--a-border); margin-bottom: 16px; }
.a-modal__title { font-family: var(--a-font-serif); font-size: 18px; margin: 0; }
.a-modal__foot { padding-top: 16px; margin-top: 6px; border-top: 1px solid var(--a-border); }

.a-modal .a-iconbtn { color: #64748b; }
.a-modal .a-iconbtn:hover { background: #eef1f7; color: var(--a-text); }

/* ---------- Live search ---------- */
.a-search { position: relative; margin-bottom: 14px; }
.a-search__icon { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: #94a3b8; font-size: 13px; }
.a-search__input {
	width: 100%;
	border: 1px solid var(--a-border);
	border-radius: 12px;
	background: var(--a-bg);
	padding: 13px 16px 13px 44px;
	font-size: 13px;
	font-family: inherit;
	color: var(--a-text);
}
.a-search__input:focus { outline: none; border-color: var(--a-cyan); box-shadow: 0 0 0 3px rgba(0, 168, 204, .15); }

.a-search__results { max-height: 330px; overflow: auto; display: flex; flex-direction: column; gap: 4px; }
.a-search__item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; }
.a-search__item:hover { background: var(--a-bg); color: inherit; }
.a-search__thumb { width: 42px; height: 42px; border-radius: 8px; overflow: hidden; background: #eef1f7; flex-shrink: 0; }
.a-search__thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-search__name { font-size: 13px; font-weight: 600; color: var(--a-text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.a-search__price { font-size: 13px; font-weight: 800; color: var(--a-cyan); white-space: nowrap; }
.a-search__price del, .a-search__price ins { text-decoration: none; }
.a-search__empty { text-align: center; color: #94a3b8; font-size: 13px; padding: 22px 0; }

/* ---------- Wishlist modal rows ---------- */
.a-wishlist-modal__list { display: flex; flex-direction: column; gap: 10px; max-height: 340px; overflow: auto; }
.a-wishrow { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--a-border); border-radius: 12px; background: #fff; }
.a-wishrow__thumb { width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: #eef1f7; flex-shrink: 0; }
.a-wishrow__thumb img { width: 100%; height: 100%; object-fit: cover; }
.a-wishrow__info { flex: 1; min-width: 0; }
.a-wishrow__title { display: block; font-size: 13px; font-weight: 700; color: var(--a-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.a-wishrow__title:hover { color: var(--a-cyan); }
.a-wishrow__price { font-size: 12px; font-weight: 800; color: var(--a-cyan); }
.a-wishrow__price del, .a-wishrow__price ins { text-decoration: none; }
.a-wishrow__actions { display: flex; align-items: center; gap: 8px; }
.a-wishrow__remove { border: 0; background: transparent; color: #94a3b8; cursor: pointer; padding: 6px; font-size: 13px; }
.a-wishrow__remove:hover { color: var(--a-red); }

/* ---------- Cart drawer ---------- */
.a-drawer {
	position: fixed;
	inset: 0;
	z-index: 100;
	visibility: hidden;
	opacity: 0;
	transition: opacity .25s var(--a-ease), visibility .25s;
}
.a-drawer.is-open { visibility: visible; opacity: 1; }
.a-drawer__overlay { position: absolute; inset: 0; background: rgba(20, 12, 36, .8); backdrop-filter: blur(3px); }
.a-drawer__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	max-width: 420px;
	background: #fff;
	display: flex;
	flex-direction: column;
	transform: translateX(100%);
	transition: transform .3s var(--a-ease);
	box-shadow: var(--a-shadow-lg);
}
.a-drawer.is-open .a-drawer__panel { transform: none; }
.a-drawer__head { background: var(--a-dark); color: #fff; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--a-purple); flex-shrink: 0; }
.a-drawer__title { display: flex; align-items: center; gap: 10px; font-family: var(--a-font-serif); font-size: 16px; color: #fff; margin: 0; }
.a-drawer__title i { color: var(--a-cyan); }
.a-drawer__head .a-iconbtn { color: #94a3b8; }
.a-drawer__head .a-iconbtn:hover { background: rgba(56, 30, 95, .6); color: #fff; }
.a-drawer__scroll { flex: 1; overflow: auto; }
.a-drawer__note { padding: 12px 20px; border-top: 1px solid var(--a-border); font-size: 11px; color: var(--a-muted); background: var(--a-bg); margin: 0; flex-shrink: 0; }

/* ---------- Free shipping progress ---------- */
.a-ship-progress { background: var(--a-bg); border-bottom: 1px solid var(--a-border); padding: 13px 20px; }
.a-ship-progress__text { margin: 0 0 8px; font-size: 12px; font-weight: 600; color: var(--a-text); }
.a-ship-progress__text i { color: var(--a-cyan); margin-right: 4px; }
.a-ship-progress__bar { height: 8px; border-radius: 999px; background: #e2e6f0; overflow: hidden; }
.a-ship-progress__bar span { display: block; height: 100%; width: 0; background: var(--a-cyan); border-radius: 999px; transition: width .35s var(--a-ease); }
.a-ship-progress.is-unlocked .a-ship-progress__text { color: #0f766e; }
.a-ship-progress.is-unlocked .a-ship-progress__text i { color: var(--a-green); }

/* ---------- Toasts ---------- */
.a-toasts { position: fixed; right: 18px; bottom: 18px; z-index: 120; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.a-toast {
	pointer-events: auto;
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: var(--a-dark);
	color: #fff;
	border: 1px solid var(--a-cyan);
	border-radius: 12px;
	padding: 12px 16px;
	font-size: 12px;
	font-weight: 600;
	box-shadow: var(--a-shadow-lg);
	max-width: 360px;
	animation: a-toast-in .3s var(--a-ease);
}
.a-toast i { color: var(--a-cyan); margin-top: 2px; }
.a-toast--error { border-color: var(--a-red); }
.a-toast--error i { color: var(--a-red); }
.a-toast.is-leaving { opacity: 0; transition: opacity .3s; }

@keyframes a-toast-in {
	from { transform: translateY(16px); opacity: 0; }
	to { transform: none; opacity: 1; }
}
