/* ────────────────────────────────────────────────────────
   Melissa Chat Widget — Vercel Chat SDK-Inspired Design
   Dark theme, minimal, production-ready
   ──────────────────────────────────────────────────────── */

:root {
    --mc-bg: #09090b;
    --mc-surface: #18181b;
    --mc-surface-elevated: #1f1f23;
    --mc-surface-hover: #27272a;
    --mc-border: rgba(255, 255, 255, 0.08);
    --mc-border-strong: rgba(255, 255, 255, 0.12);
    --mc-text: #fafafa;
    --mc-text-secondary: #a1a1aa;
    --mc-text-muted: #71717a;
    --mc-accent: #6C63FF;
    --mc-accent-hover: #5a52d5;
    --mc-accent-glow: rgba(108, 99, 255, 0.15);
    --mc-user-msg-bg: #27272a;
    --mc-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 24px 48px -12px rgba(0, 0, 0, 0.5);
    --mc-shadow-sm: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 4px 12px rgba(0, 0, 0, 0.3);
    --mc-shadow-bubble: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06);
    --mc-radius: 20px;
    --mc-radius-sm: 12px;
    --mc-radius-xs: 8px;
    --mc-radius-msg: 18px;
    --mc-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --mc-transition-spring: 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Floating Bubble Button ─── */

.mc-bubble-btn {
    position: fixed;
    z-index: 99998;
    width: 60px;
    height: 60px;
    margin: 10px;
    border-radius: 50%;
    border: 1px solid var(--mc-border-strong);
    background: var(--mc-surface);
    color: #fff;
    cursor: pointer;
    box-shadow: var(--mc-shadow-bubble);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--mc-transition), box-shadow var(--mc-transition), background var(--mc-transition);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.mc-icon-chat {
    justify-content: center;
    display: flex;
}

.mc-bubble-btn:hover {
    transform: scale(1.06);
    background: var(--mc-surface-elevated);
    box-shadow: var(--mc-shadow-bubble), 0 0 20px var(--mc-accent-glow);
}

.mc-bubble-btn:active {
    transform: scale(0.96);
}

.mc-bubble-btn.mc-pos-bottom-right {
    bottom: 85px;
    right: 1px;
}

.mc-bubble-btn.mc-pos-bottom-left {
    bottom: 85px;
    left: 1px;
}

.mc-bubble-btn svg {
    width: 24px;
    height: 24px;
    transition: opacity var(--mc-transition), transform var(--mc-transition);
}

.mc-bubble-btn .mc-icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.mc-bubble-btn.mc-open .mc-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.mc-bubble-btn.mc-open .mc-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.mc-bubble-btn.mc-open {
    background: var(--mc-surface-elevated);
    border-color: var(--mc-border-strong);
}

/* Unread badge */
.mc-bubble-badge {
    position: absolute;
    top: -12px;
    left: -12px;
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--mc-accent);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    line-height: 28px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transform: scale(0);
    transition: all var(--mc-transition-spring);
    overflow: hidden;
}

.mc-bubble-badge.mc-visible {
    opacity: 1;
    transform: scale(1);
}

/* ─── Chat Window ─── */

.mc-window {
    display: flex;
    flex-direction: column;
    background: var(--mc-bg);
    border-radius: var(--mc-radius);
    border: 1px solid var(--mc-border);
    box-shadow: var(--mc-shadow);
    overflow: hidden;
    font-family: var(--mc-font);
    font-size: 14px;
    line-height: 1.6;
    color: var(--mc-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mc-window.mc-bubble-window {
    position: fixed;
    z-index: 99999;
    width: 400px;
    height: 600px;
    max-height: calc(100vh - 120px);
    max-width: calc(100vw - 32px);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition: opacity var(--mc-transition), transform var(--mc-transition-spring);
}

.mc-window.mc-bubble-window.mc-pos-bottom-right {
    bottom: 92px;
    right: 24px;
}

.mc-window.mc-bubble-window.mc-pos-bottom-left {
    bottom: 92px;
    left: 24px;
}

.mc-window.mc-bubble-window.mc-visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.mc-window.mc-inline-window {
    border: 1px solid var(--mc-border);
}

/* ─── Header ─── */

.mc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--mc-bg);
    border-bottom: 1px solid var(--mc-border);
    flex-shrink: 0;
}

.mc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mc-header-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--mc-accent), #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mc-header-icon svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.mc-header-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-header-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--mc-text);
}

.mc-header-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--mc-text-muted);
    background: var(--mc-surface);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--mc-border);
}

.mc-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mc-header-btn {
    background: none;
    border: none;
    color: var(--mc-text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--mc-transition), background var(--mc-transition);
}

.mc-header-btn:hover {
    color: var(--mc-text);
    background: var(--mc-surface);
}

.mc-header-btn svg {
    width: 16px;
    height: 16px;
}

.mc-header-close {
    display: none;
}

.mc-bubble-window .mc-header-close {
    display: flex;
}

/* ─── Messages Area ─── */

.mc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
    background: var(--mc-bg);
    overscroll-behavior: contain;
}

.mc-messages::-webkit-scrollbar {
    width: 4px;
}

.mc-messages::-webkit-scrollbar-track {
    background: transparent;
}

.mc-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
}

.mc-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ─── Suggestion Chips ─── */

.mc-suggestions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 0;
}

.mc-suggestions-label {
    font-size: 12px;
    color: var(--mc-text-muted);
    font-weight: 500;
    margin-bottom: 4px;
}

.mc-suggestions-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mc-suggestion-chip {
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius-xs);
    padding: 8px 14px;
    font-size: 13px;
    color: var(--mc-text-secondary);
    cursor: pointer;
    transition: all var(--mc-transition);
    font-family: var(--mc-font);
    line-height: 1.4;
}

.mc-suggestion-chip:hover {
    background: var(--mc-surface-elevated);
    border-color: var(--mc-border-strong);
    color: var(--mc-text);
}

.mc-suggestion-chip:active {
    transform: scale(0.98);
}

/* ─── Message Bubbles ─── */

.mc-msg {
    display: flex;
    gap: 12px;
    animation: mcFadeIn 0.3s ease;
    max-width: 100%;
}

@keyframes mcFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mc-msg.mc-user {
    justify-content: flex-end;
    padding-left: 40px;
}

.mc-msg.mc-bot {
    padding-right: 20px;
}

.mc-msg-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--mc-surface-elevated);
    border: 1px solid var(--mc-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 1px;
}

.mc-msg-icon svg {
    width: 14px;
    height: 14px;
    color: var(--mc-text-secondary);
}

.mc-msg-content {
    min-width: 0;
    flex: 1;
}

.mc-msg-text {
    word-break: break-word;
    overflow-wrap: anywhere;
}

.mc-msg.mc-bot .mc-msg-text {
    color: var(--mc-text);
    font-size: 14px;
    line-height: 1.65;
}

.mc-msg.mc-user .mc-msg-text {
    background: var(--mc-user-msg-bg);
    color: var(--mc-text);
    padding: 10px 16px;
    border-radius: var(--mc-radius-msg);
    border-bottom-right-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
    display: inline-block;
}

.mc-msg.mc-user .mc-msg-content {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.mc-msg-time {
    font-size: 11px;
    color: var(--mc-text-muted);
    margin-top: 6px;
    opacity: 0;
    transition: opacity var(--mc-transition);
}

.mc-msg:hover .mc-msg-time {
    opacity: 1;
}

/* Continuation messages */
.mc-msg.mc-continuation {
    margin-top: -16px;
}

.mc-msg.mc-continuation .mc-msg-icon {
    visibility: hidden;
}

/* ─── Typing Indicator ─── */

.mc-typing {
    display: none;
    gap: 12px;
    align-items: flex-start;
    animation: mcFadeIn 0.3s ease;
}

.mc-typing.mc-visible {
    display: flex;
}

.mc-typing-bubble {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--mc-surface);
    border-radius: var(--mc-radius-sm);
    border: 1px solid var(--mc-border);
}

.mc-typing-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--mc-text-muted);
    animation: mcPulse 1.4s ease-in-out infinite;
}

.mc-typing-dot:nth-child(2) { animation-delay: 0.15s; }
.mc-typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes mcPulse {
    0%, 60%, 100% { opacity: 0.3; transform: scale(1); }
    30% { opacity: 1; transform: scale(1.2); }
}

/* ─── Input Area ─── */

.mc-input-area {
    padding: 12px 16px 16px;
    background: var(--mc-bg);
    flex-shrink: 0;
}

.mc-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius-sm);
    padding: 4px 4px 4px 16px;
    transition: border-color var(--mc-transition), box-shadow var(--mc-transition);
}

.mc-input-container:focus-within {
    border-color: var(--mc-border-strong);
    box-shadow: 0 0 0 2px var(--mc-accent-glow);
}

.mc-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 8px 0;
    font-family: var(--mc-font);
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    outline: none;
    max-height: 120px;
    color: var(--mc-text);
    -webkit-font-smoothing: antialiased;
}

.mc-input::placeholder {
    color: var(--mc-text-muted);
}

.mc-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: var(--mc-accent);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--mc-transition), transform var(--mc-transition), opacity var(--mc-transition);
}

.mc-send-btn:hover {
    background: var(--mc-accent-hover);
}

.mc-send-btn:active {
    transform: scale(0.92);
}

.mc-send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: var(--mc-surface-hover);
}

.mc-send-btn svg {
    width: 16px;
    height: 16px;
}

/* ─── Powered By ─── */

.mc-powered {
    text-align: center;
    font-size: 11px;
    color: var(--mc-text-muted);
    padding: 0 0 12px;
    background: var(--mc-bg);
}

.mc-powered a {
    color: var(--mc-text-muted);
    text-decoration: none;
    transition: color var(--mc-transition);
}

.mc-powered a:hover {
    color: var(--mc-text-secondary);
}

/* ─── Markdown Rendering ─── */

.mc-msg.mc-bot .mc-msg-text p {
    margin: 0 0 8px;
}

.mc-msg.mc-bot .mc-msg-text p:last-child {
    margin-bottom: 0;
}

.mc-msg.mc-bot .mc-msg-text .mc-md-h1,
.mc-msg.mc-bot .mc-msg-text .mc-md-h2,
.mc-msg.mc-bot .mc-msg-text .mc-md-h3,
.mc-msg.mc-bot .mc-msg-text .mc-md-h4 {
    font-weight: 600;
    margin: 12px 0 6px;
    line-height: 1.3;
    color: var(--mc-text);
}

.mc-msg.mc-bot .mc-msg-text .mc-md-h1 { font-size: 17px; }
.mc-msg.mc-bot .mc-msg-text .mc-md-h2 { font-size: 16px; }
.mc-msg.mc-bot .mc-msg-text .mc-md-h3 { font-size: 15px; }
.mc-msg.mc-bot .mc-msg-text .mc-md-h4 { font-size: 14px; }

.mc-msg.mc-bot .mc-msg-text .mc-md-h1:first-child,
.mc-msg.mc-bot .mc-msg-text .mc-md-h2:first-child,
.mc-msg.mc-bot .mc-msg-text .mc-md-h3:first-child,
.mc-msg.mc-bot .mc-msg-text .mc-md-h4:first-child {
    margin-top: 0;
}

.mc-msg.mc-bot .mc-msg-text .mc-md-list {
    margin: 8px 0;
    padding-left: 20px;
}

.mc-msg.mc-bot .mc-msg-text .mc-md-list li {
    margin-bottom: 4px;
    line-height: 1.55;
    color: var(--mc-text-secondary);
}

.mc-msg.mc-bot .mc-msg-text .mc-md-list li:last-child {
    margin-bottom: 0;
}

.mc-msg.mc-bot .mc-msg-text .mc-md-code {
    background: var(--mc-surface-elevated);
    border: 1px solid var(--mc-border);
    padding: 2px 6px;
    border-radius: 5px;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 12.5px;
    color: var(--mc-text);
}

.mc-msg.mc-bot .mc-msg-text .mc-md-codeblock {
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius-xs);
    padding: 14px 16px;
    margin: 10px 0;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--mc-text-secondary);
    overflow-x: auto;
    white-space: pre;
}

.mc-msg.mc-bot .mc-msg-text a {
    color: var(--mc-accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--mc-transition);
}

.mc-msg.mc-bot .mc-msg-text a:hover {
    opacity: 0.8;
}

.mc-msg.mc-bot .mc-msg-text strong {
    font-weight: 600;
    color: var(--mc-text);
}

.mc-msg.mc-bot .mc-msg-text em {
    color: var(--mc-text-secondary);
}

.mc-msg.mc-bot .mc-msg-text .mc-md-img-link {
    display: block;
    margin: 10px 0;
}

.mc-msg.mc-bot .mc-msg-text .mc-md-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--mc-radius-sm);
    object-fit: cover;
    border: 1px solid var(--mc-border);
    transition: opacity var(--mc-transition);
}

.mc-msg.mc-bot .mc-msg-text .mc-md-img:hover {
    opacity: 0.9;
}

/* ─── Rich Card (Generative UI) ─── */

.mc-rich-card {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: var(--mc-radius-sm);
    padding: 20px;
    margin: 10px 0;
    color: #fff;
    overflow: hidden;
    position: relative;
}

.mc-rich-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.mc-rich-card-title {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.85;
    margin-bottom: 8px;
}

.mc-rich-card-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.mc-rich-card-subtitle {
    font-size: 12px;
    opacity: 0.75;
    margin-top: 4px;
}

/* ─── Separator line (new conversation) ─── */

.mc-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--mc-text-muted);
    font-size: 11px;
}

.mc-separator::before,
.mc-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--mc-border);
}

/* ─── Mobile Responsive ─── */

@media (max-width: 480px) {
    .mc-window.mc-bubble-window {
        width: calc(100vw - 16px);
        height: calc(100vh - 100px);
        bottom: 84px;
        right: 8px;
        left: 8px;
        border-radius: var(--mc-radius-sm);
    }

    .mc-window.mc-bubble-window.mc-pos-bottom-left {
        right: 8px;
    }

    .mc-bubble-btn {
        width: 50px;
        height: 50px;
    }

    .mc-bubble-btn.mc-pos-bottom-right,
    .mc-bubble-btn.mc-pos-bottom-left {
        bottom: 16px;
    }

    .mc-bubble-btn.mc-pos-bottom-right { right: 16px; }
    .mc-bubble-btn.mc-pos-bottom-left { left: 16px; }

    .mc-messages {
        padding: 16px 14px 8px;
    }

    .mc-msg.mc-user {
        padding-left: 24px;
    }
}

/* ─── Animations ─── */

@keyframes mcShimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.mc-loading-shimmer {
    background: linear-gradient(90deg,
        var(--mc-surface) 25%,
        var(--mc-surface-elevated) 50%,
        var(--mc-surface) 75%
    );
    background-size: 400px 100%;
    animation: mcShimmer 1.5s ease-in-out infinite;
}

/* Block shimmer placeholder */
.mc-block-shimmer {
    border: 1px solid var(--mc-border);
    margin-top: 12px;
}

/* Block entrance animation */
.mc-block-enter {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.mc-block-enter.mc-block-entered {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Inline blocks within messages */
.mc-msg-content > .mc-product-card,
.mc-msg-content > .mc-product-grid,
.mc-msg-content > .mc-cart-view,
.mc-msg-content > .mc-quick-actions,
.mc-msg-content > .mc-order-card {
    margin-top: 12px;
}

.mc-msg-content > .mc-quick-actions {
    margin-top: 14px;
}

/* ─── Welcome State ─── */

.mc-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px 24px 16px;
    gap: 16px;
}

.mc-welcome-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--mc-accent), #9333ea);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-welcome-icon svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.mc-welcome-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--mc-text);
}

.mc-welcome-subtitle {
    font-size: 13px;
    color: var(--mc-text-muted);
    line-height: 1.5;
    max-width: 280px;
}

/* ════════════════════════════════════════════════════════
   GENERATIVE UI — Interactive Components
   ════════════════════════════════════════════════════════ */

/* ─── Block Message Container ─── */

.mc-msg.mc-block-msg {
    padding-right: 0;
}

.mc-msg.mc-block-msg .mc-msg-content {
    max-width: 340px;
}

/* When a regular bot message gets inline blocks, expand its content area */
.mc-msg.mc-bot .mc-msg-content:has(.mc-product-card),
.mc-msg.mc-bot .mc-msg-content:has(.mc-product-grid),
.mc-msg.mc-bot .mc-msg-content:has(.mc-cart-view),
.mc-msg.mc-bot .mc-msg-content:has(.mc-order-card) {
    max-width: 100%;
}

/* ─── Product Card ─── */

.mc-product-card {
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: 12px;
    overflow: hidden;
    margin: 8px 0;
    max-width: 320px;
    transition: border-color var(--mc-transition), box-shadow var(--mc-transition);
}

.mc-product-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* Carousel */
.mc-carousel {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--mc-surface-elevated);
}

.mc-carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.mc-carousel-slide {
    min-width: 100%;
    height: 100%;
}

.mc-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mc-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--mc-transition);
    z-index: 2;
}

.mc-carousel:hover .mc-carousel-arrow {
    opacity: 1;
}

.mc-carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.7);
}

.mc-carousel-arrow svg {
    width: 14px;
    height: 14px;
}

.mc-carousel-prev { left: 8px; }
.mc-carousel-next { right: 8px; }

.mc-carousel-dots {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
    z-index: 2;
}

.mc-carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all var(--mc-transition);
}

.mc-carousel-dot.mc-active {
    background: #fff;
    width: 16px;
    border-radius: 3px;
}

/* No-image placeholder */
.mc-product-no-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--mc-surface-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--mc-text-muted);
}

.mc-product-no-img svg {
    width: 40px;
    height: 40px;
    opacity: 0.4;
}

/* Product Body */
.mc-product-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mc-product-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.mc-product-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--mc-text);
    text-decoration: none;
    line-height: 1.4;
    overflow: hidden;
    transition: color var(--mc-transition);
}

a.mc-product-name:hover {
    color: var(--mc-accent);
}

.mc-product-price-group {
    flex-shrink: 0;
}

.mc-product-price {
    font-size: 18px;
    font-weight: 700;
    color: var(--mc-accent);
    white-space: nowrap;
}

.mc-product-price-sale {
    color: #22c55e;
}

.mc-product-price-original {
    font-size: 12px;
    color: var(--mc-text-muted);
    text-decoration: line-through;
    display: block;
}

/* Rating */
.mc-product-rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--mc-text-muted);
}

.mc-product-stars {
    display: flex;
    gap: 1px;
}

.mc-product-stars svg {
    width: 13px;
    height: 13px;
}

.mc-star-filled { color: #eab308; }
.mc-star-half { color: #eab308; }
.mc-star-empty { color: var(--mc-surface-hover); }

/* Stock badge */
.mc-product-stock {
    font-size: 11px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
}

.mc-product-stock.mc-in-stock {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
}

.mc-product-stock.mc-out-of-stock {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Description */
.mc-product-desc {
    font-size: 12px;
    color: var(--mc-text-muted);
    line-height: 1.5;
}

.mc-product-readmore {
    color: var(--mc-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    white-space: nowrap;
    transition: opacity var(--mc-transition);
}

.mc-product-readmore:hover {
    opacity: 0.8;
}

/* ─── Variation Selectors ─── */

.mc-variation-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-variation-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--mc-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mc-variation-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Pill-style variation buttons */
.mc-variation-pill {
    padding: 6px 14px;
    border-radius: 4px;
    border: 1px solid var(--mc-border-strong);
    background: transparent;
    color: var(--mc-text-secondary);
    font-size: 13px;
    font-weight: 500;
    font-family: var(--mc-font);
    cursor: pointer;
    transition: all var(--mc-transition);
    line-height: 1.4;
    position: relative;
}

.mc-variation-pill:hover {
    border-color: var(--mc-text-muted);
    color: var(--mc-text);
    background: var(--mc-surface-hover);
}

.mc-variation-pill.mc-selected {
    border-color: var(--mc-accent);
    background: var(--mc-accent-glow);
    color: var(--mc-text);
    font-weight: 600;
}

/* Color swatch variation */
.mc-color-swatch {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all var(--mc-transition);
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.mc-color-swatch:hover {
    transform: scale(1.1);
}

.mc-color-swatch.mc-selected {
    border-color: var(--mc-accent);
    box-shadow: 0 0 0 2px var(--mc-bg), 0 0 0 4px var(--mc-accent);
}

.mc-color-swatch.mc-unavailable {
    opacity: 0.3;
    cursor: not-allowed;
}

.mc-color-swatch.mc-unavailable::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -2px;
    right: -2px;
    height: 1px;
    background: var(--mc-text-muted);
    transform: rotate(-45deg);
}

/* ─── Quantity Selector ─── */

.mc-qty-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mc-qty-selector {
    display: flex;
    align-items: center;
    border: 1px solid var(--mc-border-strong);
    border-radius: 8px;
    overflow: hidden;
}

.mc-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    color: var(--mc-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-family: var(--mc-font);
    transition: all var(--mc-transition);
}

.mc-qty-btn:hover {
    background: var(--mc-surface-hover);
    color: var(--mc-text);
}

.mc-qty-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.mc-qty-value {
    width: 32px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text);
    border-left: 1px solid var(--mc-border);
    border-right: 1px solid var(--mc-border);
    padding: 5px 0;
}

/* ─── Action Buttons ─── */

.mc-product-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.mc-atc-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: none;
    font-family: var(--mc-font);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    transition: all var(--mc-transition);
}

.mc-atc-btn svg {
    width: 15px;
    height: 15px;
}

.mc-atc-btn-primary {
    background: var(--mc-accent);
    color: #fff;
}

.mc-atc-btn-primary:hover {
    background: var(--mc-accent-hover);
}

.mc-atc-btn-primary:active {
    transform: scale(0.98);
}

.mc-atc-btn-secondary {
    background: transparent;
    color: var(--mc-text-secondary);
    border: 1px solid var(--mc-border-strong);
}

.mc-atc-btn-secondary:hover {
    background: var(--mc-surface);
    color: var(--mc-text);
    border-color: var(--mc-text-muted);
}

.mc-atc-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.mc-atc-btn.mc-loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.mc-atc-btn.mc-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mcSpin 0.6s linear infinite;
}

@keyframes mcSpin {
    to { transform: rotate(360deg); }
}

.mc-atc-btn.mc-success {
    background: #22c55e;
    color: #fff;
}

/* ─── Product Grid ─── */

.mc-product-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}

.mc-product-grid-item {
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    transition: all var(--mc-transition);
}

.mc-product-grid-item:hover {
    border-color: var(--mc-border-strong);
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.mc-product-grid-item-img {
    width: 100px;
    min-height: 100px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--mc-surface-elevated);
}

.mc-product-grid-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.mc-product-grid-item-body {
    padding: 12px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.mc-product-grid-item-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text);
    line-height: 1.35;
    margin-bottom: 2px;
}

.mc-product-grid-item-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--mc-accent);
}

.mc-product-grid-item-desc {
    font-size: 11px;
    color: var(--mc-text-secondary);
    line-height: 1.3;
    margin-top: 2px;
}

.mc-product-grid-item-action {
    display: flex;
    padding: 8px 14px 12px;
    gap: 6px;
}

.mc-product-grid-item-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 8px;
    border: none;
    background: var(--mc-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.01em;
    font-family: var(--mc-font);
    cursor: pointer;
    transition: all var(--mc-transition);
}

.mc-product-grid-item-btn:hover {
    background: var(--mc-accent-hover);
    transform: translateY(-1px);
}

.mc-product-grid-item-btn.mc-secondary {
    background: transparent;
    border: 1px solid var(--mc-border-strong);
    color: var(--mc-text-secondary);
}

.mc-product-grid-item-btn.mc-secondary:hover {
    border-color: var(--mc-accent);
    color: var(--mc-accent);
    background: transparent;
}

/* ─── Cart View ─── */

.mc-cart-view {
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius-sm);
    overflow: hidden;
    margin: 8px 0;
}

.mc-cart-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--mc-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text);
}

.mc-cart-header svg {
    width: 16px;
    height: 16px;
    color: var(--mc-text-secondary);
}

.mc-cart-count {
    font-weight: 400;
    color: var(--mc-text-muted);
    margin-left: auto;
    font-size: 12px;
}

.mc-cart-items {
    max-height: 240px;
    overflow-y: auto;
}

.mc-cart-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--mc-border);
    transition: background var(--mc-transition);
}

.mc-cart-item:last-child {
    border-bottom: none;
}

.mc-cart-item:hover {
    background: var(--mc-surface-elevated);
}

.mc-cart-item-img {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--mc-surface-elevated);
}

.mc-cart-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mc-cart-item-info {
    flex: 1;
    min-width: 0;
}

.mc-cart-item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--mc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-cart-item-meta {
    font-size: 11px;
    color: var(--mc-text-muted);
    margin-top: 2px;
}

.mc-cart-item-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text);
    white-space: nowrap;
}

.mc-cart-item-remove {
    background: none;
    border: none;
    color: var(--mc-text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    transition: all var(--mc-transition);
}

.mc-cart-item-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.mc-cart-item-remove svg {
    width: 14px;
    height: 14px;
}

.mc-cart-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--mc-border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mc-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mc-cart-total-label {
    font-size: 13px;
    color: var(--mc-text-muted);
}

.mc-cart-total-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--mc-text);
}

.mc-checkout-btn {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: none;
    background: var(--mc-accent);
    color: #fff;
    font-family: var(--mc-font);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all var(--mc-transition);
    text-decoration: none;
}

.mc-checkout-btn:hover {
    background: var(--mc-accent-hover);
}

.mc-checkout-btn svg {
    width: 14px;
    height: 14px;
}

.mc-cart-empty {
    text-align: center;
    padding: 24px 16px;
    color: var(--mc-text-muted);
    font-size: 13px;
}

/* ─── Quick Actions ─── */

.mc-quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 0;
}

.mc-quick-action-btn {
    padding: 7px 14px;
    border-radius: 8px;
    border: 1px solid var(--mc-border-strong);
    background: transparent;
    color: var(--mc-text-secondary);
    font-size: 12px;
    font-weight: 500;
    font-family: var(--mc-font);
    cursor: pointer;
    transition: all var(--mc-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.mc-quick-action-btn:hover {
    border-color: var(--mc-accent);
    color: var(--mc-text);
    background: var(--mc-accent-glow);
}

.mc-quick-action-btn:active {
    transform: scale(0.97);
}

.mc-quick-action-btn svg {
    width: 13px;
    height: 13px;
}

/* ─── Order Confirmation ─── */

.mc-order-card {
    background: var(--mc-surface);
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius-sm);
    overflow: hidden;
    margin: 8px 0;
}

.mc-order-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: rgba(34, 197, 94, 0.08);
    border-bottom: 1px solid var(--mc-border);
}

.mc-order-header-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #22c55e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-order-header-icon svg {
    width: 14px;
    height: 14px;
    color: #fff;
}

.mc-order-header-text {
    flex: 1;
}

.mc-order-header-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--mc-text);
}

.mc-order-header-id {
    font-size: 11px;
    color: var(--mc-text-muted);
}

.mc-order-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-order-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.mc-order-row-label {
    color: var(--mc-text-muted);
}

.mc-order-row-value {
    color: var(--mc-text);
    font-weight: 500;
}

/* ─── Toast Notification ─── */

.mc-toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--mc-surface-elevated);
    border: 1px solid var(--mc-border-strong);
    color: var(--mc-text);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--mc-font);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-toast.mc-toast-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.mc-toast.mc-toast-success {
    border-color: rgba(34, 197, 94, 0.3);
}

.mc-toast.mc-toast-error {
    border-color: rgba(239, 68, 68, 0.3);
}

.mc-toast svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.mc-toast-success svg { color: #22c55e; }
.mc-toast-error svg { color: #ef4444; }

/* ─── Out-of-stock variation pills — red X cross ─── */

.mc-variation-pill.mc-variation-oos {
    opacity: 0.55;
    cursor: not-allowed;
    color: var(--mc-text-muted);
    position: relative;
}

.mc-variation-pill.mc-variation-oos::before,
.mc-variation-pill.mc-variation-oos::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80%;
    height: 1.5px;
    background: #ef4444;
    border-radius: 1px;
}

.mc-variation-pill.mc-variation-oos::before {
    transform: translate(-50%, -50%) rotate(25deg);
}

.mc-variation-pill.mc-variation-oos::after {
    transform: translate(-50%, -50%) rotate(-25deg);
}

.mc-variation-pill.mc-variation-oos:hover {
    background: transparent;
    border-color: var(--mc-border-strong);
    color: var(--mc-text-muted);
}

/* ─── Mobile adjustments for components ─── */

@media (max-width: 480px) {
    .mc-msg.mc-block-msg .mc-msg-content {
        max-width: 100%;
    }

    .mc-product-grid {
        gap: 8px;
    }
}
