/* Growroom Chatbot 2.1 — editorial urbano, negro + amarillo + blanco cálido */
@font-face {
	font-family: 'GRC Archivo';
	font-style: italic;
	font-weight: 700;
	font-display: swap;
	src: url('../fonts/archivo-narrow-bolditalic.woff2') format('woff2');
}

#grc-root {
	--grc-yellow: #F0F20A;
	--grc-black: #0D0D0D;
	--grc-cream: #F4F1E8;
	--grc-white: #FFFFFF;
	--grc-muted: #6B6B67;
	--grc-line: rgba(13, 13, 13, .16);
	--grc-offset-x: 16px;
	--grc-offset-y: 16px;
	--grc-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--grc-display: 'GRC Archivo', "Arial Narrow", Impact, sans-serif;
	position: fixed;
	z-index: 999999;
	bottom: calc(var(--grc-offset-y) + env(safe-area-inset-bottom, 0px));
	font-family: var(--grc-body);
	font-size: 14px;
	line-height: 1.42;
	color: var(--grc-black);
	-webkit-font-smoothing: antialiased;
}
#grc-root.grc-pos-right { right: calc(var(--grc-offset-x) + env(safe-area-inset-right, 0px)); }
#grc-root.grc-pos-left { left: calc(var(--grc-offset-x) + env(safe-area-inset-left, 0px)); }
#grc-root *, #grc-root *::before, #grc-root *::after { box-sizing: border-box; margin: 0; padding: 0; }
#grc-root button, #grc-root input { font: inherit; color: inherit; }
#grc-root button { border: 0; cursor: pointer; }
#grc-root a { color: inherit; }
#grc-root button:focus-visible, #grc-root a:focus-visible, #grc-root input:focus-visible {
	outline: 3px solid var(--grc-yellow);
	outline-offset: 2px;
}

/* Lanzador */
.grc-launcher {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 54px;
	padding: 8px 19px 8px 9px;
	background: var(--grc-yellow);
	border: 2px solid var(--grc-black) !important;
	border-radius: 999px;
	box-shadow: 4px 4px 0 var(--grc-black), 0 12px 28px rgba(13, 13, 13, .22);
	transition: transform .16s ease, box-shadow .16s ease;
}
.grc-launcher:hover { transform: translateY(-2px); box-shadow: 4px 6px 0 var(--grc-black), 0 14px 30px rgba(13, 13, 13, .25); }
.grc-launcher:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--grc-black); }
.grc-launcher-avatar {
	width: 36px;
	height: 36px;
	object-fit: contain;
	border-radius: 50%;
	background: var(--grc-white);
	border: 1.5px solid var(--grc-black);
}
.grc-launcher-icon { display: inline-flex; padding: 5px; }
.grc-launcher-label {
	font-family: var(--grc-display);
	font-size: 17px;
	font-weight: 700;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: .04em;
	white-space: nowrap;
}
#grc-root.grc-compact .grc-launcher { padding: 8px; }
#grc-root.grc-compact .grc-launcher-label { display: none; }

/* Panel */
.grc-panel {
	position: fixed;
	bottom: calc(var(--grc-offset-y) + 70px + env(safe-area-inset-bottom, 0px));
	width: min(420px, calc(100vw - 24px));
	height: min(680px, calc(100dvh - 105px));
	display: flex;
	flex-direction: column;
	background: var(--grc-cream);
	border: 2px solid var(--grc-black);
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 5px 5px 0 var(--grc-black), 0 24px 70px rgba(13, 13, 13, .28);
	animation: grc-open .2s ease-out;
	transform-origin: bottom right;
}
#grc-root.grc-pos-right .grc-panel { right: calc(var(--grc-offset-x) + env(safe-area-inset-right, 0px)); }
#grc-root.grc-pos-left .grc-panel { left: calc(var(--grc-offset-x) + env(safe-area-inset-left, 0px)); transform-origin: bottom left; }
.grc-panel[hidden] { display: none !important; }
@keyframes grc-open { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }

/* Encabezado */
.grc-header {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 72px;
	padding: 10px 10px 10px 12px;
	background: var(--grc-black);
	color: var(--grc-white);
	border-bottom: 5px solid var(--grc-yellow);
	flex-shrink: 0;
}
.grc-header-avatar, .grc-avatar-fallback {
	width: 48px;
	height: 48px;
	flex: 0 0 48px;
	border-radius: 50%;
	border: 2px solid var(--grc-yellow);
	background: var(--grc-white);
}
.grc-header-avatar { object-fit: contain; }
.grc-avatar-fallback {
	display: grid;
	place-items: center;
	font-family: var(--grc-display);
	font-size: 23px;
	color: var(--grc-black);
}
.grc-identity { min-width: 0; flex: 1; }
.grc-title {
	font-family: var(--grc-display);
	font-size: 22px;
	font-weight: 700;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: .045em;
	color: var(--grc-yellow);
	line-height: 1;
}
.grc-subtitle {
	margin-top: 4px;
	font-size: 10px;
	line-height: 1.25;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: rgba(255,255,255,.7);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.grc-subtitle::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--grc-yellow); }
.grc-header-home, .grc-close {
	min-width: 38px;
	min-height: 38px;
	padding: 7px;
	border-radius: 8px;
	background: transparent;
	color: var(--grc-white) !important;
	font-weight: 700;
}
.grc-header-home { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.grc-close { font-size: 26px !important; line-height: 1; }
.grc-header-home:hover, .grc-close:hover { background: var(--grc-yellow); color: var(--grc-black) !important; }

/* Conversación */
.grc-messages {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overflow-x: hidden;
	display: flex;
	flex-direction: column;
	gap: 11px;
	padding: 16px 14px 20px;
	scrollbar-width: thin;
	scrollbar-color: var(--grc-black) transparent;
}
.grc-messages::-webkit-scrollbar { width: 5px; }
.grc-messages::-webkit-scrollbar-thumb { background: var(--grc-black); border-radius: 8px; }
.grc-msg { display: flex; max-width: 88%; }
.grc-msg-bot { align-self: flex-start; }
.grc-msg-user { align-self: flex-end; }
.grc-msg-wide { width: 100%; max-width: 100%; }
.grc-bubble {
	padding: 10px 13px;
	border: 1px solid var(--grc-line);
	border-radius: 13px 13px 13px 4px;
	background: var(--grc-white);
	box-shadow: 0 3px 10px rgba(13,13,13,.06);
	white-space: pre-line;
	overflow-wrap: anywhere;
}
.grc-msg-user .grc-bubble {
	background: var(--grc-black);
	color: var(--grc-white);
	border-color: var(--grc-black);
	border-radius: 13px 13px 4px 13px;
	box-shadow: none;
}
.grc-typing { display: inline-flex; gap: 4px; padding: 3px 1px; }
.grc-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--grc-black); animation: grc-dot 1s infinite; }
.grc-typing i:nth-child(2) { animation-delay: .15s; }
.grc-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes grc-dot { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }

/* Inicio y recomendadores */
.grc-home-menu, .grc-recommender-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px;
	width: 100%;
}
.grc-home-action, .grc-recommender-card {
	min-height: 72px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 3px;
	padding: 11px 12px;
	text-align: left;
	background: var(--grc-white);
	border: 1.5px solid var(--grc-black) !important;
	border-radius: 10px;
	transition: background .13s ease, transform .13s ease;
}
.grc-home-action:hover, .grc-recommender-card:hover { background: var(--grc-yellow); transform: translateY(-1px); }
.grc-home-action strong, .grc-recommender-card strong {
	font-family: var(--grc-display);
	font-size: 15px;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: .025em;
	line-height: 1.1;
}
.grc-home-action span, .grc-recommender-card span { color: var(--grc-muted); font-size: 11px; line-height: 1.25; }
.grc-home-action:hover span, .grc-recommender-card:hover span { color: var(--grc-black); }
.grc-resume, .grc-followup {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	border: 1px dashed rgba(13,13,13,.35);
	border-radius: 9px;
	font-size: 11px;
}
.grc-link-button {
	flex: 0 0 auto;
	padding: 5px 8px;
	background: transparent;
	text-decoration: underline;
	font-size: 11px;
	font-weight: 800;
}
.grc-chips, .grc-choice-list { display: flex; flex-wrap: wrap; gap: 7px; width: 100%; }
.grc-chip, .grc-choice {
	padding: 8px 11px;
	background: var(--grc-white);
	border: 1.5px solid var(--grc-black) !important;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 750;
}
.grc-chip:hover, .grc-choice:hover { background: var(--grc-yellow); }
.grc-choice-list { flex-direction: column; }
.grc-choice { width: 100%; border-radius: 9px; text-align: left; }
.grc-notice {
	width: 100%;
	padding: 10px 12px;
	background: var(--grc-yellow);
	border-left: 4px solid var(--grc-black);
	font-size: 12px;
	font-weight: 700;
}

/* Productos */
.grc-product-list { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.grc-card {
	position: relative;
	overflow: hidden;
	width: 100%;
	background: var(--grc-white);
	border: 1.5px solid var(--grc-black);
	border-radius: 12px;
}
.grc-card-topmatch { border-left: 5px solid var(--grc-yellow); }
.grc-card-main { display: flex; gap: 11px; padding: 12px 11px 9px; }
.grc-card.has-sale .grc-card-main { padding-top: 30px; }
.grc-card-image {
	width: 76px;
	height: 76px;
	flex: 0 0 76px;
	object-fit: contain;
	background: var(--grc-cream);
	border: 1px solid var(--grc-line);
	border-radius: 8px;
}
.grc-card-info { min-width: 0; flex: 1; }
.grc-card h3 {
	font-family: var(--grc-display);
	font-size: 16px;
	font-style: italic;
	line-height: 1.08;
	text-transform: uppercase;
	letter-spacing: .02em;
}
.grc-price { margin-top: 7px; font-size: 16px; line-height: 1.15; font-weight: 850; }
.grc-stock { display: inline-flex; align-items: center; gap: 5px; margin-top: 6px; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.grc-stock::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--grc-yellow); border: 1px solid var(--grc-black); }
.grc-stock.is-out::before { background: var(--grc-black); }
.grc-stock.is-back::before { background: var(--grc-cream); }
.grc-sale-badge {
	position: absolute;
	top: 8px;
	padding: 3px 7px;
	font-family: var(--grc-display);
	font-size: 10px;
	font-style: italic;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .055em;
}
.grc-sale-badge { right: 9px; background: var(--grc-black); color: var(--grc-yellow); }
.grc-card-desc {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
	padding: 0 11px 10px;
	color: var(--grc-muted);
	font-size: 11.5px;
	line-height: 1.35;
}
.grc-card-actions { display: flex; border-top: 1px solid var(--grc-black); }
.grc-card-actions > * {
	flex: 1 1 0;
	min-width: 0;
	padding: 9px 5px;
	background: var(--grc-white);
	border-left: 1px solid var(--grc-black) !important;
	text-align: center;
	text-decoration: none;
	font-family: var(--grc-display);
	font-size: 11px;
	font-style: italic;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .025em;
}
.grc-card-actions > *:first-child { border-left: 0 !important; }
.grc-card-actions .grc-card-add { background: var(--grc-yellow); }
.grc-card-actions > *:hover { filter: brightness(.94); }
.grc-card-compare[aria-pressed="true"] { background: var(--grc-black); color: var(--grc-yellow) !important; }
.grc-cart-success { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; padding: 11px 13px; background: var(--grc-white); border: 1px solid var(--grc-black); border-radius: 10px; }
.grc-cart-success span { font-size: 12px; color: var(--grc-muted); }
.grc-primary-link { display: inline-block; margin-top: 5px; padding: 8px 11px; background: var(--grc-yellow); border: 1.5px solid var(--grc-black); border-radius: 7px; font-family: var(--grc-display); font-style: italic; font-weight: 700; text-transform: uppercase; text-decoration: none; }

/* Barra y tabla de comparación */
.grc-comparebar {
	flex-shrink: 0;
	padding: 8px 10px;
	background: var(--grc-black);
	color: var(--grc-white);
	border-top: 3px solid var(--grc-yellow);
}
.grc-comparebar > strong { display: block; margin-bottom: 5px; color: var(--grc-yellow); font-family: var(--grc-display); font-style: italic; text-transform: uppercase; }
.grc-compare-selected { display: flex; gap: 5px; margin-bottom: 6px; }
.grc-compare-selected > span { display: flex; align-items: center; gap: 3px; max-width: 50%; padding: 3px 5px; background: rgba(255,255,255,.12); border-radius: 5px; font-size: 10px; overflow: hidden; }
.grc-remove-compare { flex: 0 0 auto; padding: 0 2px; background: transparent; color: var(--grc-yellow) !important; font-weight: 900; }
.grc-compare-go { width: 100%; padding: 6px; background: var(--grc-yellow); color: var(--grc-black) !important; border-radius: 5px; font-size: 11px; font-weight: 850; text-transform: uppercase; }
.grc-compare-go:disabled { opacity: .55; cursor: default; }
.grc-table-scroll { width: 100%; overflow-x: auto; border: 1.5px solid var(--grc-black); border-radius: 10px; }
.grc-compare-table { width: 100%; min-width: 520px; border-collapse: collapse; background: var(--grc-white); font-size: 11px; }
.grc-compare-table th, .grc-compare-table td { padding: 7px 8px; border: 1px solid var(--grc-line); text-align: left; vertical-align: top; }
.grc-compare-table thead th { background: var(--grc-black); color: var(--grc-yellow); font-family: var(--grc-display); font-style: italic; text-transform: uppercase; }
.grc-compare-table tbody th { background: var(--grc-cream); width: 25%; }

/* Composer */
.grc-inputbar {
	display: flex;
	gap: 7px;
	padding: 10px;
	padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	background: var(--grc-white);
	border-top: 1.5px solid var(--grc-black);
	flex-shrink: 0;
}
.grc-input {
	min-width: 0;
	flex: 1;
	height: 42px;
	padding: 0 12px;
	background: var(--grc-cream);
	border: 1.5px solid var(--grc-black);
	border-radius: 9px;
	font-size: 14px;
}
.grc-input::placeholder { color: rgba(13,13,13,.48); }
.grc-send {
	flex: 0 0 72px;
	height: 42px;
	padding: 0 14px;
	background: var(--grc-yellow);
	border: 1.5px solid var(--grc-black) !important;
	border-radius: 9px;
	font-family: var(--grc-display) !important;
	font-style: italic !important;
	font-weight: 700 !important;
	text-transform: uppercase;
}
.grc-send:disabled { opacity: .55; cursor: default; }

/* WhatsApp y nudge */
.grc-wa-box { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.grc-wa-box p { color: var(--grc-muted); font-size: 11.5px; }
.grc-nudge {
	position: absolute;
	bottom: calc(100% + 11px);
	display: flex;
	align-items: flex-start;
	gap: 8px;
	width: max-content;
	max-width: min(290px, calc(100vw - 24px));
	padding: 10px 9px 10px 12px;
	background: var(--grc-white);
	border: 1.5px solid var(--grc-black);
	border-radius: 10px;
	box-shadow: 3px 3px 0 var(--grc-black);
	font-size: 12px;
	font-weight: 750;
	cursor: pointer;
}
#grc-root.grc-pos-right .grc-nudge { right: 0; }
#grc-root.grc-pos-left .grc-nudge { left: 0; }
.grc-nudge-close { flex: 0 0 auto; padding: 0 3px; background: transparent; font-weight: 900; }

@media (max-width: 520px) {
	html.grc-chat-open { overflow: hidden; }
	.grc-panel {
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border-width: 0;
		border-radius: 0;
		box-shadow: none;
	}
	.grc-chat-open .grc-launcher { visibility: hidden; }
	.grc-header { gap: 7px; padding: calc(8px + env(safe-area-inset-top, 0px)) 7px 8px 9px; }
	.grc-header-avatar, .grc-avatar-fallback { width: 42px; height: 42px; flex-basis: 42px; }
	.grc-title { font-size: 20px; }
	.grc-subtitle { font-size: 9px; }
	.grc-header-home { min-width: 34px; width: 34px; padding: 5px; font-size: 0; }
	.grc-header-home::before { content: '⌂'; font-size: 22px; line-height: 1; }
	.grc-close { min-width: 34px; width: 34px; padding: 4px; }
	.grc-messages { padding-bottom: 16px; }
	.grc-inputbar { gap: 6px; padding-left: 7px; padding-right: 7px; }
	.grc-send { flex-basis: 66px; padding: 0 8px; font-size: 12px; }
}

@media (max-width: 360px) {
	.grc-home-menu, .grc-recommender-grid { grid-template-columns: 1fr; }
	.grc-header-home { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	#grc-root * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
