/* =========================================================================
   AN Marketplace — Gallery + Phro Concierge + Quick Look
   visionOS "Liquid Glass" · Coda Edition
   ========================================================================= */

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

.anmkt-market {
	--ink: #f4f7fb;
	--ink-soft: rgba(244, 247, 251, .66);
	--ink-faint: rgba(244, 247, 251, .40);
	--line: rgba(255, 255, 255, .12);
	--glass: rgba(255, 255, 255, .055);
	--glass-2: rgba(255, 255, 255, .09);
	--blur: 26px;
	--radius: 28px;
	--radius-sm: 16px;
	--emerald: #34d399;
	--cobalt: #5b8cff;
	--amber: #f6c177;
	--shadow: 0 30px 80px -32px rgba(0, 0, 0, .75);
	--font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, system-ui, sans-serif;

	position: relative;
	isolation: isolate;
	overflow: hidden;
	max-width: 1180px;
	margin: 40px auto;
	padding: clamp(20px, 4vw, 48px);
	border-radius: 36px;
	border: 1px solid var(--line);
	background:
		radial-gradient(120% 70% at 10% 0%, rgba(91, 140, 255, .15), transparent 55%),
		radial-gradient(120% 70% at 90% 5%, rgba(52, 211, 153, .13), transparent 55%),
		linear-gradient(180deg, #0a0f1a, #05070d 70%);
	color: var(--ink);
	font-family: var(--font);
	-webkit-font-smoothing: antialiased;
	box-shadow: var(--shadow);
}

/* --- Aurora ------------------------------------------------------------- */
.anmkt-aurora { position: absolute; inset: -20%; z-index: 0; pointer-events: none; filter: blur(70px); opacity: .5; }
.anmkt-aurora span { position: absolute; width: 42%; height: 42%; border-radius: 50%; }
.anmkt-aurora__a { top: -8%; left: -2%; background: radial-gradient(circle, rgba(91, 140, 255, .9), transparent 60%); animation: anmkt-drift 24s ease-in-out infinite; }
.anmkt-aurora__b { top: 6%; right: -6%; background: radial-gradient(circle, rgba(52, 211, 153, .8), transparent 60%); animation: anmkt-drift 28s ease-in-out infinite reverse; }
.anmkt-aurora__c { bottom: -14%; left: 30%; background: radial-gradient(circle, rgba(246, 193, 119, .5), transparent 60%); animation: anmkt-drift 32s ease-in-out infinite; }
@keyframes anmkt-drift {
	0%, 100% { transform: translate(0, 0) scale(1); }
	33% { transform: translate(7%, 5%) scale(1.12); }
	66% { transform: translate(-5%, 3%) scale(.94); }
}
.anmkt-market > *:not(.anmkt-aurora):not(.anmkt-quick) { position: relative; z-index: 1; }

/* --- Header ------------------------------------------------------------- */
.anmkt-eyebrow { margin: 0 0 12px; font-size: .72rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--emerald); }
.anmkt-market__title {
	margin: 0 0 10px; font-size: clamp(1.9rem, 5.5vw, 3rem); font-weight: 600; line-height: 1.03; letter-spacing: -.025em;
	background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, .72)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.anmkt-market__sub { margin: 0 0 20px; max-width: 56ch; font-size: 1.04rem; line-height: 1.5; color: var(--ink-soft); }
.anmkt-market__cta { margin-bottom: 8px; }

/* --- Glass panel base --------------------------------------------------- */
.anmkt-panel {
	position: relative; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line);
	background: var(--glass);
	-webkit-backdrop-filter: blur(var(--blur)) saturate(160%); backdrop-filter: blur(var(--blur)) saturate(160%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 20px 50px -28px rgba(0, 0, 0, .6);
}
.anmkt-panel::before { content: ""; position: absolute; inset: 0 0 auto; height: 40%; background: linear-gradient(180deg, rgba(255, 255, 255, .12), transparent); pointer-events: none; }

/* --- Buttons ------------------------------------------------------------ */
.anmkt-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 13px 26px; font-family: inherit; font-size: .95rem; font-weight: 600;
	border: 1px solid transparent; border-radius: 99px; cursor: pointer; text-decoration: none;
	transition: transform .18s ease, box-shadow .25s ease, background .25s ease, border-color .2s ease, opacity .2s ease;
}
.anmkt-btn--solid { color: #04140d; background: linear-gradient(120deg, var(--cobalt), var(--emerald)); box-shadow: 0 12px 30px -10px rgba(52, 211, 153, .6), inset 0 1px 0 rgba(255, 255, 255, .35); }
.anmkt-btn--solid:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(52, 211, 153, .7); }
.anmkt-btn--solid:active { transform: translateY(0) scale(.98); }
.anmkt-btn--ghost { color: var(--ink-soft); background: var(--glass-2); border-color: var(--line); }
.anmkt-btn--ghost:hover { color: var(--ink); border-color: rgba(255, 255, 255, .3); }
.anmkt-btn:focus-visible { outline: 2px solid var(--emerald); outline-offset: 3px; }

/* --- Concierge ---------------------------------------------------------- */
.anmkt-concierge { margin: 28px 0; padding: clamp(16px, 3vw, 24px); }
.anmkt-cc__head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.anmkt-cc__orb {
	position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%;
	background: radial-gradient(circle at 35% 30%, #8fb2ff, var(--cobalt) 70%);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 0 24px -2px rgba(91, 140, 255, .7);
	animation: anmkt-pulse 3.4s ease-in-out infinite;
}
.anmkt-cc__hat {
	position: absolute; left: 50%; top: -5px; transform: translateX(-50%);
	width: 30px; height: 12px; border-radius: 14px 14px 4px 4px;
	background: linear-gradient(180deg, #ffd98a, var(--amber)); box-shadow: 0 1px 0 rgba(0,0,0,.2);
}
.anmkt-cc__hat::after { content: ""; position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); width: 40px; height: 5px; border-radius: 99px; background: var(--amber); }
@keyframes anmkt-pulse { 0%, 100% { box-shadow: 0 0 0 1px rgba(255,255,255,.2), 0 0 20px -2px rgba(91,140,255,.55); } 50% { box-shadow: 0 0 0 1px rgba(255,255,255,.3), 0 0 30px 0 rgba(91,140,255,.85); } }
.anmkt-cc__id { display: flex; flex-direction: column; line-height: 1.2; }
.anmkt-cc__id strong { font-size: 1rem; }
.anmkt-cc__id span { font-size: .76rem; color: var(--ink-faint); }
.anmkt-cc__reset { margin-left: auto; padding: 7px 14px; font-family: inherit; font-size: .8rem; font-weight: 600; color: var(--ink-soft); background: var(--glass-2); border: 1px solid var(--line); border-radius: 99px; cursor: pointer; transition: color .2s ease, border-color .2s ease; }
.anmkt-cc__reset:hover { color: var(--ink); border-color: rgba(255,255,255,.3); }

.anmkt-cc__log { display: flex; flex-direction: column; gap: 12px; }
.anmkt-cc__log:empty { display: none; }
.anmkt-msg { max-width: 88%; padding: 12px 16px; font-size: .94rem; line-height: 1.45; border-radius: 18px; animation: anmkt-msgin .35s ease; }
@keyframes anmkt-msgin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.anmkt-msg--bot { align-self: flex-start; color: var(--ink); background: var(--glass-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.anmkt-msg--user { align-self: flex-end; color: #04140d; font-weight: 500; background: linear-gradient(120deg, var(--cobalt), var(--emerald)); border-bottom-right-radius: 6px; }
.anmkt-typing { display: inline-flex; gap: 5px; align-items: center; }
.anmkt-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-soft); animation: anmkt-bounce 1.2s infinite ease-in-out; }
.anmkt-typing span:nth-child(2) { animation-delay: .15s; }
.anmkt-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes anmkt-bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* concierge result rail */
.anmkt-cc__rail { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.anmkt-cc__rail::-webkit-scrollbar { height: 6px; }
.anmkt-cc__rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 99px; }

.anmkt-cc__chips { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 16px; }
.anmkt-cc__chips:empty { display: none; }
.anmkt-cc__input { display: flex; gap: 10px; margin-top: 16px; }
.anmkt-cc__input input { flex: 1; padding: 12px 16px; font-family: inherit; font-size: .94rem; color: var(--ink); background: rgba(255,255,255,.045); border: 1px solid var(--line); border-radius: 99px; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.anmkt-cc__input input::placeholder { color: var(--ink-faint); }
.anmkt-cc__input input:focus { border-color: rgba(52,211,153,.7); box-shadow: 0 0 0 4px rgba(52,211,153,.16); }
.anmkt-cc__input button { padding: 0 22px; font-family: inherit; font-size: .9rem; font-weight: 600; color: #04140d; background: linear-gradient(120deg, var(--cobalt), var(--emerald)); border: none; border-radius: 99px; cursor: pointer; transition: transform .18s ease; }
.anmkt-cc__input button:hover { transform: translateY(-1px); }

/* shared chip (concierge + facets) */
.anmkt-chip {
	display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px;
	font-family: inherit; font-size: .85rem; font-weight: 500; color: var(--ink-soft);
	background: var(--glass-2); border: 1px solid var(--line); border-radius: 99px; cursor: pointer;
	transition: transform .18s ease, border-color .2s ease, background .2s ease, color .2s ease;
}
.anmkt-chip__emoji { font-size: 1rem; line-height: 1; }
.anmkt-chip:hover { transform: translateY(-2px); border-color: rgba(255,255,255,.28); }
.anmkt-chip.is-active { color: #04140d; font-weight: 600; background: linear-gradient(120deg, var(--emerald), #7ef0c0); border-color: transparent; box-shadow: 0 8px 24px -8px rgba(52,211,153,.6); }
.anmkt-chip__count { font-size: .72rem; opacity: .65; }

/* --- Toolbar ------------------------------------------------------------ */
.anmkt-toolbar { display: flex; flex-direction: column; gap: 16px; margin: 8px 0 26px; }
.anmkt-search { position: relative; display: flex; align-items: center; }
.anmkt-search__icon { position: absolute; left: 16px; font-size: 1.1rem; color: var(--ink-faint); pointer-events: none; }
.anmkt-search input { width: 100%; padding: 14px 16px 14px 44px; font-family: inherit; font-size: 1rem; color: var(--ink); background: var(--glass); border: 1px solid var(--line); border-radius: 99px; outline: none; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); transition: border-color .2s ease, box-shadow .2s ease; }
.anmkt-search input::placeholder { color: var(--ink-faint); }
.anmkt-search input:focus { border-color: rgba(52,211,153,.7); box-shadow: 0 0 0 4px rgba(52,211,153,.14); }
.anmkt-facets { display: flex; flex-wrap: wrap; gap: 9px; }

/* --- Grid + cards ------------------------------------------------------- */
.anmkt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: clamp(12px, 2vw, 20px); }
@media (min-width: 560px) { .anmkt-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }

.anmkt-card {
	position: relative; display: flex; flex-direction: column; overflow: hidden; cursor: pointer;
	border-radius: var(--radius-sm); border: 1px solid var(--line);
	background: var(--glass);
	-webkit-backdrop-filter: blur(16px) saturate(150%); backdrop-filter: blur(16px) saturate(150%);
	box-shadow: 0 14px 36px -22px rgba(0,0,0,.7);
	transition: transform .26s cubic-bezier(.22,1,.36,1), box-shadow .26s ease, border-color .26s ease;
}
.anmkt-card:hover, .anmkt-card:focus-visible { transform: translateY(-6px); border-color: rgba(255,255,255,.28); box-shadow: 0 28px 60px -26px rgba(0,0,0,.8); outline: none; }
.anmkt-card[hidden] { display: none; }

.anmkt-card__media { position: relative; aspect-ratio: 1 / 1; overflow: hidden; }
.anmkt-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.anmkt-card:hover .anmkt-card__media img { transform: scale(1.06); }
.anmkt-card__ph { position: absolute; inset: 0; display: grid; place-items: center; background: linear-gradient(150deg, hsl(var(--ph-hue, 150), 60%, 22%), hsl(calc(var(--ph-hue, 150) + 40), 55%, 12%)); }
.anmkt-card__ph-emoji { font-size: clamp(2.4rem, 7vw, 3.4rem); filter: drop-shadow(0 6px 14px rgba(0,0,0,.4)); }
.anmkt-card__pill { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; max-width: calc(100% - 20px); padding: 5px 10px; font-size: .68rem; font-weight: 600; color: var(--ink); background: rgba(5,7,13,.55); border: 1px solid var(--line); border-radius: 99px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.anmkt-card__pill span { flex: none; }

.anmkt-card__body { display: flex; flex-direction: column; gap: 4px; padding: 14px; flex: 1; }
.anmkt-card__name { margin: 0; font-size: .98rem; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.anmkt-card__price { font-size: .9rem; font-weight: 600; color: var(--amber); }
.anmkt-card__by { font-size: .78rem; color: var(--ink-faint); }
.anmkt-card__open { margin-top: auto; padding-top: 8px; font-size: .82rem; font-weight: 600; color: var(--emerald); text-decoration: none; align-self: flex-start; }
.anmkt-card__open:hover { text-decoration: underline; }

/* --- Empty / no results ------------------------------------------------- */
.anmkt-empty { text-align: center; padding: 60px 20px; }
.anmkt-empty__glyph { font-size: 3rem; }
.anmkt-empty h3 { margin: 14px 0 6px; font-size: 1.3rem; font-weight: 600; }
.anmkt-empty p { margin: 0 0 20px; color: var(--ink-soft); }
.anmkt-noresults { text-align: center; padding: 40px 20px; color: var(--ink-faint); }

/* --- Quick Look --------------------------------------------------------- */
.anmkt-quick { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.anmkt-quick[hidden] { display: none; }
.anmkt-quick__scrim { position: absolute; inset: 0; background: rgba(5,7,13,.72); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: anmkt-fade .3s ease; }
@keyframes anmkt-fade { from { opacity: 0; } to { opacity: 1; } }
.anmkt-quick__panel {
	position: relative; z-index: 1; width: min(760px, 100%); max-height: 90vh; overflow: auto;
	border-radius: var(--radius); border: 1px solid var(--line);
	background: linear-gradient(180deg, rgba(20,26,38,.92), rgba(8,11,18,.92));
	-webkit-backdrop-filter: blur(30px) saturate(160%); backdrop-filter: blur(30px) saturate(160%);
	box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.14);
	color: var(--ink); font-family: var(--font);
	animation: anmkt-quickin .4s cubic-bezier(.22,1,.36,1);
}
@keyframes anmkt-quickin { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }
.anmkt-quick__close { position: absolute; top: 14px; right: 14px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; font-size: 1rem; color: var(--ink); background: rgba(5,7,13,.5); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: background .2s ease; }
.anmkt-quick__close:hover { background: rgba(5,7,13,.8); }
.anmkt-quick__media { width: 100%; aspect-ratio: 16 / 10; overflow: hidden; }
.anmkt-quick__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anmkt-quick__media .anmkt-card__ph { position: relative; height: 100%; }
.anmkt-quick__body { padding: clamp(20px, 4vw, 30px); }
.anmkt-quick__pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; font-size: .76rem; font-weight: 600; color: var(--emerald); background: rgba(52,211,153,.12); border: 1px solid rgba(52,211,153,.3); border-radius: 99px; }
.anmkt-quick__name { margin: 14px 0 8px; font-size: clamp(1.4rem, 4vw, 1.9rem); font-weight: 600; letter-spacing: -.02em; }
.anmkt-quick__meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; font-size: .9rem; color: var(--ink-soft); }
.anmkt-quick__meta b { color: var(--amber); font-weight: 600; }
.anmkt-quick__desc { margin: 0 0 22px; font-size: 1rem; line-height: 1.6; color: var(--ink-soft); }
.anmkt-quick__desc:empty { display: none; }
.anmkt-quick__open { width: 100%; }

/* cross-sell */
.anmkt-xsell { margin-top: 26px; }
.anmkt-xsell:empty { display: none; }
.anmkt-xsell__title { margin: 0 0 12px; font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); }
.anmkt-xsell__rail { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
.anmkt-xsell__rail::-webkit-scrollbar { height: 6px; }
.anmkt-xsell__rail::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 99px; }

/* mini card (used in concierge rail + cross-sell) */
.anmkt-mini { flex: none; width: 132px; scroll-snap-align: start; cursor: pointer; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--glass-2); transition: transform .2s ease, border-color .2s ease; }
.anmkt-mini:hover { transform: translateY(-3px); border-color: rgba(255,255,255,.3); }
.anmkt-mini__media { aspect-ratio: 1 / 1; overflow: hidden; position: relative; }
.anmkt-mini__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.anmkt-mini__name { padding: 8px 10px; font-size: .76rem; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.anmkt-aurora span, .anmkt-cc__orb { animation: none !important; }
	.anmkt-card, .anmkt-card__media img, .anmkt-mini, .anmkt-btn, .anmkt-chip { transition: none; }
	.anmkt-msg, .anmkt-quick__panel, .anmkt-quick__scrim { animation: none; }
}
