.sg-chat-bubble {
	position: fixed;
	bottom: 24px;
	right: 24px;
	width: 60px;
	height: 60px;
	background: #0073aa;
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(0,0,0,0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	z-index: 99999;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.25s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sg-chat-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 28px rgba(0,0,0,0.28);
}

.sg-chat-bubble:active {
    transform: scale(0.95);
}

.sg-chat-bubble svg {
    display: block;
    color: #fff;
}

.sg-chat-bubble .sg-favicon-icon {
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.25));
}

.sg-chat-bubble:hover .sg-favicon-icon {
    transform: scale(1.08);
}

.sg-chat-bubble:active .sg-favicon-icon {
    transform: scale(0.95);
}

.sg-classic-avatar .sg-favicon-icon,
.sg-modern-avatar .sg-favicon-icon,
.sg-bot-avatar .sg-favicon-icon {
    display: block;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.sg-chat-container {
	position: fixed;
	bottom: 96px;
	right: 24px;
	width: 420px;
	max-width: calc(100vw - 32px);
	height: min(650px, calc(100vh - 120px));
	max-height: calc(100vh - 120px);
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 12px 48px rgba(0,0,0,0.18), 0 2px 10px rgba(0,0,0,0.06);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    border: 1px solid rgba(0,0,0,0.08);
    animation: sg-container-appear 0.25s ease-out;
}

@keyframes sg-container-appear {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sg-chat-header {
	background: #0073aa;
	color: #fff;
	padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.sg-chat-header::after {
    display: none !important;
}

.sg-classic-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sg-classic-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.sg-classic-title {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    color: #fff;
}

.sg-classic-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.85);
    display: block;
    margin-top: 2px;
}

.sg-classic-close-btn {
    background: rgba(255, 255, 255, 0.18);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.sg-classic-close-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: scale(1.08);
}

.sg-chat-messages {
	flex: 1;
	padding: 25px;
	overflow-y: auto;
    overflow-x: hidden;
	background: #fdfdfd;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sg-chat-message {
	padding: 14px 20px;
	border-radius: 18px;
	max-width: 85%;
    line-height: 1.6;
    font-size: 16px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* Bot messages that contain a product carousel get full width */
.sg-chat-message.bot.sg-has-products {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    align-self: stretch;
}

.sg-chat-message.user {
	background: #0073aa;
	color: #fff;
	align-self: flex-end;
	margin-left: auto;
    border-bottom-right-radius: 2px;
    animation: sg-fade-in-right 0.3s ease-out;
}

@keyframes sg-fade-in-right {
    from { opacity: 0; transform: translateX(5px); }
    to { opacity: 1; transform: translateX(0); }
}

.sg-chat-message.bot {
	background: #fff;
	color: #333;
	align-self: flex-start;
    border: 1px solid #eee;
    border-bottom-left-radius: 2px;
    animation: sg-fade-in 0.3s ease-out;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
}

@keyframes sg-fade-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

.sg-chat-input-area {
	padding: 20px 30px;
	border-top: 1px solid #eee;
	display: flex;
    align-items: center;
    background: #fff;
}

.sg-chat-input-area input {
	flex: 1;
	border: 1px solid #e0e0e0;
	padding: 14px 20px;
	border-radius: 30px;
	outline: none;
    font-size: 16px;
    transition: border-color 0.2s;
}

.sg-chat-input-area input:focus {
    border-color: #0073aa;
}

.sg-chat-input-area button {
	background: #0073aa;
	color: #fff;
	border: none;
	padding: 12px 25px;
	margin-left: 15px;
	border-radius: 30px;
	cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.sg-chat-input-area button:hover {
    opacity: 0.9;
}

.sg-message-inner {
    display: block;
    align-items: flex-start;
    gap: 15px;
}

.sg-bot-avatar {
    width: 32px;
    height: 32px;
    background: #eee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    color: #666;
    flex-shrink: 0;
    border: 1px solid #ddd;
}

.sg-message-text {
    flex: 1;
}

.sg-chat-header::after {
    content: "−";
    cursor: pointer;
    font-size: 22px;
    font-weight: bold;
    opacity: 0.8;
}

.sg-chat-header:hover::after {
    opacity: 1;
}

/* ============================================
   Product Carousel — single card, no overflow
   ============================================ */
.sg-product-carousel-wrapper {
    position: relative;
    width: 100%;
    margin: 12px 0 4px;
    box-sizing: border-box;
}


/*
  sg-product-viewport: position:relative context for the arrows.
  Does NOT clip — arrows sit absolutely inside here so top:50% = card center.
*/
.sg-product-viewport {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

/*
  sg-product-clip: actually clips card content so nothing overflows horizontally.
  This inner wrapper has overflow:hidden.
*/
.sg-product-clip {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    box-sizing: border-box;
}

/* Slide-in animations */
@keyframes sg-slide-from-right {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes sg-slide-from-left {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}
.sg-slide-from-right { animation: sg-slide-from-right 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.sg-slide-from-left  { animation: sg-slide-from-left  0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); }

/* Arrow buttons — float above the card edges */
.sg-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    font-size: 18px;
    line-height: 1;
    color: #333;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: background 0.18s, box-shadow 0.18s, transform 0.18s;
    padding: 0;
    user-select: none;
}
.sg-carousel-arrow:hover {
    background: #fff;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    transform: translateY(-50%) scale(1.12);
}
.sg-carousel-arrow:active {
    transform: translateY(-50%) scale(0.92);
}
/* Arrows sit just inside the card edges */
.sg-carousel-arrow.left  { left: 8px; }
.sg-carousel-arrow.right { right: 8px; }
.sg-carousel-arrow:disabled {
    opacity: 0.25;
    cursor: default;
    pointer-events: none;
}

/* Dot indicators */
.sg-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.sg-carousel-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ccc;
    transition: background 0.2s, transform 0.2s;
    cursor: pointer;
    border: none;
    padding: 0;
    flex-shrink: 0;
}
.sg-carousel-dot.active {
    background: #0073aa;
    transform: scale(1.3);
}

/* Individual product card */
.sg-product-card {
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.sg-product-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
    display: block;
}

.sg-product-info {
    padding: 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.sg-product-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    color: #222;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-product-price {
    font-size: 16px;
    color: #2e7d32;
    font-weight: 700;
    margin-bottom: 12px;
}

.sg-product-button {
    display: block;
    text-align: center;
    background: #0073aa;
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: filter 0.18s;
    margin-top: auto;
    box-sizing: border-box;
}
.sg-product-button:hover {
    filter: brightness(1.12);
}

/* Counter label e.g. "2 / 5" */
.sg-carousel-counter {
    text-align: center;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
    letter-spacing: 0.04em;
}

.sg-message-text-content {
    margin-bottom: 10px;
}

.sg-product-card-simple {
    background: #fdfdfd;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    margin: 5px 0 15px 0;
}

.sg-chat-link {
    color: #0073aa;
    text-decoration: underline;
    font-weight: bold;
}

/* ==========================================================================
   AskGuardian Modern Theme (Homepage Split-Hero Design)
   ========================================================================== */

/* Modern Floating Bubble */
.sg-chat-bubble.sg-theme-modern {
    background: linear-gradient(135deg, #7B5CF0 0%, #1BC8FF 100%) !important;
    box-shadow: 0 8px 30px rgba(123, 92, 240, 0.45), 0 0 20px rgba(27, 200, 255, 0.3) !important;
    border: 1px solid rgba(255, 255, 255, 0.25);
    overflow: visible;
}

.sg-chat-bubble.sg-theme-modern svg {
    color: #ffffff;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.25));
}

.sg-chat-bubble.sg-theme-modern .sg-favicon-icon {
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.sg-modern-bubble-glow {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(123, 92, 240, 0.5) 0%, transparent 70%);
    pointer-events: none;
    animation: sg-pulse-glow 3s infinite alternate;
}

.sg-modern-bubble-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #36cc72;
    border: 2.5px solid #0d0d1a;
    box-shadow: 0 0 8px #36cc72;
    animation: sg-blink-dot 1.8s infinite;
}

@keyframes sg-pulse-glow {
    from { transform: scale(0.95); opacity: 0.5; }
    to   { transform: scale(1.15); opacity: 0.85; }
}

@keyframes sg-blink-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.9); }
}

/* Modern Chat Window Container */
.sg-chat-container.sg-theme-modern {
    background: rgba(13, 13, 26, 0.95) !important;
    backdrop-filter: blur(28px) !important;
    -webkit-backdrop-filter: blur(28px) !important;
    border: 1px solid rgba(123, 92, 240, 0.35) !important;
    border-radius: 24px !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.75), 0 0 45px rgba(123, 92, 240, 0.25) !important;
    color: #ffffff;
    font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
    width: 420px;
    max-width: calc(100vw - 32px);
    height: min(650px, calc(100vh - 120px));
    max-height: calc(100vh - 120px);
    bottom: 96px;
    right: 24px;
}

/* Modern Header */
.sg-modern-header {
    background: rgba(255, 255, 255, 0.03) !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: none;
}

.sg-modern-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sg-modern-avatar {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7B5CF0, #1BC8FF);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 0 16px rgba(123, 92, 240, 0.5);
    flex-shrink: 0;
}

.sg-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #36cc72;
    border: 2px solid #0d0d1a;
    box-shadow: 0 0 6px #36cc72;
}

.sg-offline-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #94a3b8;
    border: 2px solid #0d0d1a;
    box-shadow: none;
}

.sg-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sg-agent-title {
    font-weight: 700;
    font-size: 16px;
    color: #ffffff;
    line-height: 1.2;
}

.sg-agent-tag {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(123, 92, 240, 0.25);
    color: #a78bfa;
    border: 1px solid rgba(123, 92, 240, 0.4);
}

.sg-agent-status {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

.sg-modern-header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sg-header-dots {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sg-hdot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    opacity: 0.8;
}

.sg-hdot.red {
    background: #ff5f56;
    cursor: pointer;
    transition: transform 0.15s;
}
.sg-hdot.red:hover {
    transform: scale(1.2);
}

.sg-hdot.yellow { background: #ffbd2e; }
.sg-hdot.green  { background: #27c93f; }

.sg-modern-close-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s;
}

.sg-modern-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Modern Messages Area */
.sg-chat-messages.sg-theme-modern {
    background: radial-gradient(ellipse at top right, rgba(123, 92, 240, 0.12) 0%, transparent 60%), rgba(7, 7, 15, 0.85) !important;
    padding: 20px 18px !important;
    gap: 16px;
}

/* Bot Message */
.sg-chat-container.sg-theme-modern .sg-chat-message.bot {
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 16px 16px 16px 4px !important;
    color: rgba(255, 255, 255, 0.95) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
    font-size: 14.5px;
    line-height: 1.55;
}

.sg-chat-container.sg-theme-modern .sg-bot-avatar {
    background: rgba(123, 92, 240, 0.2) !important;
    border: 1px solid rgba(123, 92, 240, 0.4) !important;
    color: #a78bfa !important;
}

/* User Message */
.sg-chat-container.sg-theme-modern .sg-chat-message.user {
    background: linear-gradient(135deg, #7B5CF0 0%, #6236ff 100%) !important;
    border: none !important;
    border-radius: 16px 16px 4px 16px !important;
    color: #ffffff !important;
    box-shadow: 0 4px 18px rgba(98, 54, 255, 0.35) !important;
    font-size: 14.5px;
    line-height: 1.55;
}

/* Modern Product Card */
.sg-product-card.sg-theme-modern {
    background: rgba(7, 7, 15, 0.75) !important;
    border: 1px solid rgba(123, 92, 240, 0.35) !important;
    border-radius: 14px !important;
    padding: 12px !important;
    margin-top: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
    box-sizing: border-box;
}


.sg-modern-card-content {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sg-modern-product-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.sg-modern-product-thumb-fallback {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.sg-modern-product-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.sg-modern-product-title {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sg-modern-product-price-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.sg-modern-product-price {
    font-weight: 800;
    color: #36cc72;
    font-size: 15px;
}


.sg-modern-product-btn {
    width: 100%;
    padding: 9px 14px;
    background: rgba(123, 92, 240, 0.25);
    border: 1px solid rgba(123, 92, 240, 0.45);
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.sg-modern-product-btn:hover {
    background: #7B5CF0 !important;
    border-color: #7B5CF0 !important;
    box-shadow: 0 0 16px rgba(123, 92, 240, 0.5);
    transform: translateY(-1px);
}

.sg-modern-product-btn .sg-arrow {
    transition: transform 0.15s;
}
.sg-modern-product-btn:hover .sg-arrow {
    transform: translateX(3px);
}

/* Suggestion Chips in Modern Theme */
.sg-modern-suggestions {
    display: flex;
    gap: 8px;
    padding: 0 18px 12px;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.sg-modern-suggestions::-webkit-scrollbar { display: none; }

.sg-modern-chip {
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 99px;
    padding: 6px 13px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.18s;
}

.sg-modern-chip:hover {
    background: rgba(123, 92, 240, 0.2);
    border-color: rgba(123, 92, 240, 0.45);
    color: #ffffff;
}

/* Modern Typing Indicator */
.sg-modern-typing-row {
    padding: 10px 14px !important;
}

.sg-modern-typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 6px;
}

.sg-tdot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #7B5CF0;
    box-shadow: 0 0 6px #7B5CF0;
    animation: sg-type-bounce 1.4s infinite ease-in-out both;
}

.sg-tdot:nth-child(1) { animation-delay: -0.32s; }
.sg-tdot:nth-child(2) { animation-delay: -0.16s; }
.sg-tdot:nth-child(3) { animation-delay: 0s; }

@keyframes sg-type-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40%           { transform: scale(1.15); opacity: 1; }
}

/* Modern Input Area */
.sg-modern-input-area {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: rgba(7, 7, 15, 0.7) !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
}

.sg-modern-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 99px !important;
    padding: 12px 18px !important;
    font-size: 14px !important;
    color: #ffffff !important;
    outline: none !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
}

.sg-modern-input::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

.sg-modern-input:focus {
    border-color: #7B5CF0 !important;
    box-shadow: 0 0 0 3px rgba(123, 92, 240, 0.25) !important;
}

.sg-modern-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7B5CF0, #1BC8FF);
    border: none;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
    box-shadow: 0 0 16px rgba(123, 92, 240, 0.4);
}

.sg-modern-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    box-shadow: none;
}

.sg-modern-send-btn:not(:disabled):hover {
    transform: scale(1.08);
    box-shadow: 0 0 22px rgba(123, 92, 240, 0.6);
}

/* ==========================================================================
   Responsive Design: Laptops and Intermediate Viewports
   ========================================================================== */

@media (max-width: 1366px), (max-height: 850px) {
    .sg-chat-container,
    .sg-chat-container.sg-theme-modern,
    .sg-chat-container.sg-theme-classic {
        width: 390px;
        height: min(560px, calc(100vh - 100px));
        max-height: calc(100vh - 100px);
        bottom: 82px;
        right: 20px;
        border-radius: 18px;
    }

    .sg-chat-bubble {
        width: 54px;
        height: 54px;
        bottom: 18px;
        right: 18px;
    }

    .sg-chat-header,
    .sg-modern-header {
        padding: 13px 16px;
    }

    .sg-chat-messages,
    .sg-chat-messages.sg-theme-modern {
        padding: 16px 14px !important;
        gap: 14px;
    }

    .sg-chat-input-area,
    .sg-modern-input-area {
        padding: 12px 16px !important;
    }
}

/* Shorter laptop screens (e.g. 768px height with toolbars & scaling) */
@media (max-height: 720px) and (min-width: 641px) {
    .sg-chat-container,
    .sg-chat-container.sg-theme-modern,
    .sg-chat-container.sg-theme-classic {
        height: min(480px, calc(100vh - 84px));
        max-height: calc(100vh - 84px);
        bottom: 74px;
        right: 16px;
    }

    .sg-chat-bubble {
        width: 48px;
        height: 48px;
        bottom: 14px;
        right: 14px;
    }
}

/* ==========================================================================
   Mobile Design: Fullscreen On Click, Smaller Launcher Icon
   ========================================================================== */

@media (max-width: 640px) {
    /* Smaller launcher icon on mobile */
    .sg-chat-bubble {
        width: 48px !important;
        height: 48px !important;
        bottom: 16px !important;
        right: 16px !important;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28) !important;
    }

    .sg-chat-bubble .sg-favicon-icon {
        width: 26px !important;
        height: 26px !important;
    }

    /* Hide the floating bubble when chat is open fullscreen so it doesn't obstruct content */
    .sg-chat-bubble.sg-is-open {
        display: none !important;
    }

    /* Fullscreen chat window for both Classic and Modern themes */
    .sg-chat-container,
    .sg-chat-container.sg-theme-modern,
    .sg-chat-container.sg-theme-classic {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        width: 100dvw !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-width: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
        margin: 0 !important;
        border: none !important;
        box-shadow: none !important;
        z-index: 999999 !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Fullscreen Mobile Header with iPhone Safe Area */
    .sg-chat-header,
    .sg-modern-header {
        padding-top: max(14px, env(safe-area-inset-top)) !important;
        padding-left: 16px !important;
        padding-right: 16px !important;
        padding-bottom: 14px !important;
        border-radius: 0 !important;
        flex-shrink: 0 !important;
    }

    /* Header close buttons on mobile with comfortable touch target */
    .sg-modern-close-btn,
    .sg-classic-close-btn {
        width: 38px !important;
        height: 38px !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* Mobile messages scroll container */
    .sg-chat-messages,
    .sg-chat-messages.sg-theme-modern {
        flex: 1 1 0% !important;
        padding: 16px 14px !important;
        gap: 14px !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .sg-chat-message {
        max-width: 88% !important;
        font-size: 15px !important;
    }

    /* Fullscreen Mobile Input with iPhone Safe Area */
    .sg-chat-input-area,
    .sg-modern-input-area {
        padding-top: 10px !important;
        padding-left: 14px !important;
        padding-right: 14px !important;
        padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
        border-radius: 0 !important;
        flex-shrink: 0 !important;
    }

    .sg-chat-input-area input,
    .sg-modern-input {
        font-size: 16px !important; /* Prevents auto-zoom in iOS Safari */
    }

    /* Product card and carousel mobile optimization */
    .sg-product-carousel-wrapper {
        margin: 8px 0 2px !important;
    }

    .sg-modern-card-content {
        padding: 12px !important;
        gap: 12px !important;
    }

    .sg-modern-product-image,
    .sg-modern-product-thumb-fallback {
        width: 68px !important;
        height: 68px !important;
        min-width: 68px !important;
    }

    .sg-modern-product-title {
        font-size: 14px !important;
    }

    .sg-modern-product-btn {
        padding: 9px 14px !important;
        font-size: 12px !important;
    }
}



