/* ==========================================================================
   WooCommerce Chatbot AI - Atelier Sonoris Frontend Styles
   ========================================================================== */

:root {
	--woo-chat-primary: #1e3a8a;
	--woo-chat-primary-dark: #0f172a;
	--woo-chat-accent: #d97706;
	--woo-chat-accent-light: #f59e0b;
	--woo-chat-bg-glass: rgba(15, 23, 42, 0.85);
	--woo-chat-text-light: #f8fafc;
	--woo-chat-text-muted: #94a3b8;
	--woo-chat-bubble-bot: #1e293b;
	--woo-chat-bubble-user: #2563eb;
	--woo-chat-border: rgba(255, 255, 255, 0.12);
	--woo-chat-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.4), 0 10px 15px -5px rgba(0, 0, 0, 0.2);
}
.as-chat-avatar-image {
    display: block;
    width: 100%;
    height: 100%;
    padding: 3px;
    margin: 0;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
    border-radius: 50%;
}
.woo-chatbot-container {
	position: fixed;
	bottom: 25px;
	right: 25px;
	z-index: 99999;
	box-sizing: border-box;
}

.woo-chatbot-container * {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Floating Trigger Button
   -------------------------------------------------------------------------- */
.woo-chatbot-toggle-btn {
    position: fixed !important;
    right: 24px;
    bottom: 96px;
    display: inline-flex !important;
    align-items: center !important;
    gap: 11px !important;
    min-height: 52px !important;
    padding: 8px 17px 8px 9px !important;
    margin: 0;
    color: #ffffff !important;
    background: linear-gradient(180deg, #842E28 0%, #741F1B 45%, #611411 100%);
    border: 1px solid rgba(201, 154, 91, 0.55) !important;
    border-radius: 13px !important;
    font: inherit;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    text-align: left !important;
    text-transform: none !important;
    cursor: pointer !important;
    box-shadow: 0 8px 22px rgba(86, 5, 3, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.10) !important;
    transition: filter 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, transform 0.22s ease !important;
}

.woo-chatbot-toggle-btn:hover {
	color: #ffffff !important;
    filter: brightness(1.08);
    border-color: rgba(201, 154, 91, 0.78) !important;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(86, 5, 3, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.15) !important;
}

.as-chat-toggle-icon img {
	display: block;
    width: 35px;
    height: 100%;
    margin: 0;
    padding: 1px;
    object-fit: contain;
    object-position: center;
    background: #ffffff;
    border-radius: 50%;
}

.woo-chatbot-toggle-btn svg {
	width: 28px;
	height: 28px;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.woo-chatbot-toggle-btn .woo-icon-close {
	display: none;
}

.woo-chatbot-container.woo-chat-open .woo-icon-chat {
	display: none;
}

.woo-chatbot-container.woo-chat-open .woo-icon-close {
	display: block;
}

.woo-chatbot-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: linear-gradient(135deg, #ef4444, #dc2626);
	color: white;
	font-size: 11px;
	font-weight: 700;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #ffffff;
	animation: woo-pulse 2s infinite;
}

@keyframes woo-pulse {
	0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
	70% { transform: scale(1.1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
	100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* --------------------------------------------------------------------------
   Chat Window
   -------------------------------------------------------------------------- */
.woo-chatbot-window {
	position: fixed;
    right: 20px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    width: 420px;
    height: min(740px, calc(100vh - 48px));
    margin: 0;
    overflow: hidden;
    color: #352a24;
    background: #fffdfb;
    border: 1px solid rgba(201, 154, 91, 0.25);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(37, 25, 18, 0.18), 0 4px 14px rgba(37, 25, 18, 0.08);
    transform-origin: right bottom;
    animation: asChatOpen 0.24s ease-out;
}

.woo-chatbot-window.woo-chatbot-hidden {
	opacity: 0;
	pointer-events: none;
	transform: scale(0.85) translateY(30px);
}

/* Header */
.woo-chatbot-header {
	display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 82px;
    padding: 17px 16px 17px 18px;
    margin: 0;
    color: #ffffff;
    background: linear-gradient(180deg, #8A3A35 0%, #74211D 48%, #5F1512 100%);
    border-bottom: 1px solid rgba(201, 154, 91, 0.60);
}

.woo-chatbot-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(217, 119, 6, 0.2);
	border: 1px solid rgba(245, 158, 11, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 20px;
}

.woo-chatbot-header-info {
	flex: 1;
}

.woo-chatbot-title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: #ffffff;
}

.woo-chatbot-status {
	font-size: 12px;
	color: #4ade80;
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 2px;
}

.woo-status-dot {
	width: 7px;
	height: 7px;
	background-color: #4ade80;
	border-radius: 50%;
	box-shadow: 0 0 8px #4ade80;
}

.woo-chatbot-header-close {
	display: flex !important;
    flex: 0 0 38px;
    align-items: center !important;
    justify-content: center !important;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    height: 38px;
    min-height: 38px !important;
    max-height: 38px;
    aspect-ratio: 1 / 1;
    padding: 0 !important;
    margin: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.96) !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    border-radius: 50% !important;
    font-size: 22px !important;
    font-weight: 300 !important;
    line-height: 1 !important;
    text-align: center !important;
    text-transform: none !important;
    appearance: none !important;
    -webkit-appearance: none;
    cursor: pointer !important;
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease !important;
}

.as-chat-avatar {
    display: flex;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid rgba(201, 154, 91, 0.70);
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgba(86, 5, 3, 0.04), 0 3px 8px rgba(0, 0, 0, 0.12);
}

.as-chat-heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    text-align: left;
}

.as-chat-heading strong {
    display: block;
    margin: 0 0 2px;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.15;
}

.as-chat-heading > span {
    display: block;
    max-width: 210px;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.90);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.as-chat-heading small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    margin-top: 5px;
    padding-top: 5px;
    color: rgba(255, 255, 255, 0.82);
    border-top: 1px solid rgba(255, 255, 255, 0.42);
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1;
}

.as-chat-heading small i {
    display: block;
    flex: 0 0 7px;
    width: 7px;
    height: 7px;
    background: #8fcf82;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(143, 207, 130, 0.12);
}
.woo-chatbot-header-close:hover {
	color: #ffffff;
}

/* Chat Body */
.woo-chatbot-body {
	display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 13px;
    min-height: 0;
    padding: 16px;
    margin: 0;
    overflow-x: hidden;
    overflow-y: auto;
    background: #faf7f3;
    text-align: left;
    scrollbar-width: thin;
    scrollbar-color: rgba(201, 154, 91, 0.55) transparent;
}

.woo-chatbot-body::-webkit-scrollbar {
	width: 6px;
}
.woo-chatbot-body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.15);
	border-radius: 3px;
}

/* Messages */
.woo-chatbot-msg {
	display: flex;
	flex-direction: column;
	max-width: 85%;
	animation: woo-fade-in 0.25s ease-out;
}

@keyframes woo-fade-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.woo-chatbot-msg-bot {
	align-self: flex-start;
    color: #ffffff;
    font-weight: 500;
    line-height: 1.55;
    letter-spacing: 0.01em;
    background: linear-gradient(to bottom, #BD8882 0%, #AE746E 52%, #985E59 100%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    border-bottom-left-radius: 2px;
    box-shadow: 0 2px 7px rgba(70, 38, 33, 0.05);
}

.woo-chatbot-msg-user {
	align-self: flex-end;
}

.woo-chatbot-msg-bubble {
	padding: 12px 16px;
	border-radius: 16px;
	font-size: 13.5px;
	line-height: 1.5;
	word-break: break-word;
}

.as-chat-identity {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.woo-chatbot-msg-bot .woo-chatbot-msg-bubble {
	color: #f1f5f9;
}

.woo-chatbot-msg-user .woo-chatbot-msg-bubble {
    align-self: flex-end;
    color: #3D2C22;
    background: linear-gradient(to bottom, #FFFDF8 0%, #FAE9CB 100%);
    border: 1px solid rgba(201, 154, 91, 0.72);
    border-radius: 14px;
    border-bottom-right-radius: 2px;
    box-shadow: 0 2px 7px rgba(76, 52, 35, 0.06);
}

.woo-chatbot-msg-bubble a {
	color: #60a5fa;
	text-decoration: underline;
}

.woo-chatbot-msg-bubble strong {
	color: #fbbf24;
}

/* Quick Chips */
.woo-chatbot-quick-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 8px;
}

.woo-chip-btn {
	background: linear-gradient(to bottom, #BD8882 0%, #AE746E 52%, #985E59 100%);
	border: 1px solid rgba(217, 119, 6, 0.3) !important;
	color: #f3f4f6 !important;
	padding: 6px 12px !important;
	border-radius: 14px !important;
    border-bottom-left-radius: 2px !important;
	font-size: 12px !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
}

.woo-chip-btn:hover {
	background: linear-gradient(to bottom, #BD8882 0%, #AE746E 52%, #985E59 100%);
	color: #ffffff !important;
	transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Product Cards Component inside Chat
   -------------------------------------------------------------------------- */
.woo-chatbot-products-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
    padding: 15px;
    width: 100%;
}

.woo-product-card {
	background: rgba(15, 23, 42, 0.9);
	border: 1px solid rgba(245, 158, 11, 0.3);
	border-radius: 12px;
	padding: 10px;
	display: flex;
	gap: 12px;
	align-items: center;
	transition: transform 0.2s ease, border-color 0.2s ease;
}

.woo-product-card:hover {
	border-color: #f59e0b;
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.woo-product-card-img {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border-radius: 8px;
	background: #1e293b;
	border: 1px solid rgba(255, 255, 255, 0.1);
}

.woo-product-card-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.woo-product-card-name {
	font-size: 13px;
	font-weight: 600;
	color: #ffffff;
	margin: 0;
	line-height: 1.3;
}

.woo-product-card-price {
	font-size: 13px;
	font-weight: 700;
	color: #fbbf24;
}

.woo-product-card-badge {
	font-size: 10px;
	padding: 2px 6px;
	border-radius: 4px;
	width: fit-content;
}

.woo-badge-stock {
	background: rgba(34, 197, 94, 0.2);
	color: #4ade80;
	border: 1px solid rgba(74, 222, 128, 0.3);
}

.woo-badge-out {
	background: rgba(239, 68, 68, 0.2);
	color: #f87171;
	border: 1px solid rgba(248, 113, 113, 0.3);
}

.woo-product-card-btn {
	background: linear-gradient(135deg, #d97706, #b45309);
	color: white;
	text-decoration: none !important;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	transition: background 0.2s;
}

.woo-product-card-btn:hover {
	background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* --------------------------------------------------------------------------
   Typing Indicator
   -------------------------------------------------------------------------- */
.woo-typing-indicator {
	display: flex;
	align-items: center;
	gap: 4px;
	padding: 10px 14px;
	border-radius: 16px;
	border-top-left-radius: 4px;
	width: fit-content;
}

.woo-typing-dot {
	width: 6px;
	height: 6px;
	background: #ffffff;
	border-radius: 50%;
	animation: woo-bounce 1.4s infinite ease-in-out both;
}

.woo-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.woo-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes woo-bounce {
	0%, 80%, 100% { transform: scale(0); }
	40% { transform: scale(1); }
}

/* --------------------------------------------------------------------------
   Footer / Input Form
   -------------------------------------------------------------------------- */
.woo-chatbot-footer #woo-chatbot-form {
	display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 11px 12px 12px;
    margin: 0;
    background: #fffdfb;
    border-top: 1px solid rgba(201, 154, 91, 0.24);
}

#woo-chatbot-form {
	display: flex;
	gap: 8px;
	align-items: center;
}

#woo-chatbot-input {
	display: block;
    flex: 1;
    min-width: 0;
    height: 43px;
    padding: 10px 12px;
    margin: 0;
    color: #352a24;
    background: #ffffff;
    border: 1px solid rgba(201, 154, 91, 0.42);
    border-radius: 10px;
    font: inherit;
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    outline: none;
    box-shadow: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#woo-chatbot-input:focus {
	border-color: #d97706;
}

#woo-chatbot-input::placeholder {
	color: #64748b;
}

#woo-chatbot-send-btn {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    height: 43px;
    padding: 0 13px;
    margin: 0;
    color: #ffffff;
    background: #c99a5b;
    border: 1px solid #c99a5b;
    border-radius: 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

#woo-chatbot-send-btn:hover {
	transform: scale(1.05);
	background: linear-gradient(135deg, #f59e0b, #d97706);
}

#woo-chatbot-send-btn svg {
	width: 18px;
	height: 18px;
}

.woo-chatbot-branding {
	text-align: center;
	font-size: 10px;
	color: #64748b;
	margin-top: 6px;
}