/* --- Mia Concierge 2.0: Premium Aesthetic --- */

:root {
    --mia-glass: rgba(255, 255, 255, 0.75);
    --mia-glass-border: rgba(255, 255, 255, 0.4);
    --mia-shadow: 0 20px 60px rgba(34, 27, 26, 0.12);
    --mia-accent: #c5a075; /* Gold from main theme */
}

/* Floating Pill Trigger */
.mia-pill-trigger {
    position: fixed;
    bottom: 100px;
    right: 25px;
    background: var(--mia-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--mia-glass-border);
    border-radius: 50px;
    padding: 8px 24px 8px 8px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--mia-shadow);
    z-index: 1000;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(150px);
    opacity: 0;
}

.mia-pill-trigger.active {
    transform: translateY(0);
    opacity: 1;
}

.mia-pill-trigger:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 25px 80px rgba(34, 27, 26, 0.18);
}

.mia-pill-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mia-pill-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mia-pill-text {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    letter-spacing: -0.01em;
}

/* Premium Slide-up Overlay */
.mia-chat-overlay {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 85vh;
    max-height: 800px;
    background: var(--mia-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border-radius: 32px 32px 0 0;
    box-shadow: 0 -30px 100px rgba(34, 27, 26, 0.2);
    z-index: 2100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(100%);
    transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    border-top: 1px solid var(--mia-glass-border);
}

.mia-chat-overlay.open {
    transform: translateY(0);
}

/* Overlay Header */
.mia-overlay-header {
    padding: 24px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.mia-header-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mia-header-brand img {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50%;
    border: 2px solid white;
    object-fit: cover;
}

.mia-header-copy h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 4px;
}

.mia-header-copy span {
    font-size: 0.8rem;
    color: #4CAF50;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.close-mia-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0,0,0,0.04);
    border: none;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.close-mia-btn:hover {
    background: rgba(0,0,0,0.08);
    transform: rotate(90deg);
}

/* Messages Area */
.chat-messages {
    flex: 1;
    padding: 20px 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
    min-height: 200px;
}

.msg {
    max-width: 80%;
    animation: miaFadeIn 0.4s ease both;
}

.msg-bubble {
    padding: 18px 22px;
    border-radius: 22px;
    font-size: 1.05rem;
    line-height: 1.5;
}

.msg-mia {
    margin-right: auto;
    margin-left: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.msg-mia .msg-bubble {
    background: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-radius: 4px 22px 22px 22px;
    color: var(--text);
}

.msg-user {
    margin-left: auto;
    margin-right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.msg-user .msg-bubble {
    background: var(--title, #221b1a) !important;
    color: white !important;
    border-radius: 18px 18px 4px 18px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Input Bar */
.chat-input-area {
    padding: 24px 30px 45px;
    background: white;
    border-top: 1px solid rgba(0,0,0,0.05);
    display: flex;
    gap: 14px;
}

.chat-input-area input {
    flex: 1;
    background: #f8f8f8;
    border: 1px solid #eee;
    padding: 16px 24px;
    border-radius: 100px;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

.chat-input-area input:focus {
    background: white;
    border-color: var(--mia-accent);
    box-shadow: 0 0 0 4px rgba(197, 160, 117, 0.1);
}

.btn-send {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--title);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-send:hover {
    background: var(--mia-accent);
    transform: scale(1.05);
}

/* Desktop sizing */
@media (min-width: 768px) {
    .mia-chat-overlay {
        width: 450px;
        right: 30px;
        bottom: 30px;
        height: 600px;
        max-height: 800px;
        border-radius: 30px;
        border: 1px solid var(--mia-glass-border);
        transform: translateY(calc(100% + 50px));
    }
    
    .chat-input-area {
        padding-bottom: 90px; /* Space for the bottom-dock on mobile */
    }
}

@keyframes miaFadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Standalone Page Styles */
.mia-chat-app {
    background: white;
    border-radius: 30px;
    box-shadow: var(--shadow-card);
    height: 700px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Typing indicator */
.typing-indicator .msg-bubble {
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 14px 20px;
}
.typing-indicator .msg-bubble span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    animation: typingBounce 1.2s infinite;
}
.typing-indicator .msg-bubble span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator .msg-bubble span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); background: var(--mia-accent); }
}

/* Product cards in chat (Horizontal Carousel) */
.mia-product-cards {
    display: flex;
    gap: 12px;
    flex-wrap: nowrap;
    margin-top: 10px;
    padding: 10px 5px 25px;
    overflow-x: auto;
    height: 290px !important;
    min-height: 290px !important;
    align-items: flex-start;
    -webkit-overflow-scrolling: touch;
}
.mia-product-cards::-webkit-scrollbar {
    height: 4px;
}
.mia-product-cards::-webkit-scrollbar-thumb {
    background: #e0d0c0;
    border-radius: 10px;
}
.mia-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 160px !important;
    width: 160px !important;
    height: 260px !important;
    min-height: 260px !important;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #f0e8e0;
    background: white;
    text-decoration: none;
    color: var(--text);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.mia-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.1); }
.mia-card img {
    height: 150px !important;
    min-height: 150px !important;
    display: block;
    object-fit: cover;
    background-color: #f8f4f0;
    border-bottom: 1px solid #f0e8e0;
}
.mia-card-body { padding: 10px; }
.mia-card-body strong { display: block; font-size: 0.8rem; margin-bottom: 4px; line-height: 1.3; }
.mia-card-body span { font-size: 0.75rem; color: var(--mia-accent); font-weight: 700; }

/* Inline Components from Global: Premium Refinement */
.mia-wa-btn { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; color: #4caf50; background: #e8f5e9; border-radius: 50%; margin-right: 8px; flex-shrink: 0; transition: all 0.3s ease; }
.mia-wa-btn:hover { background: #c8e6c9; transform: scale(1.1); }

.mia-inline-form { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.mia-inline-form input { 
    width: 100%; 
    padding: 14px 18px; 
    border-radius: 12px; 
    border: 1px solid rgba(0,0,0,0.08); 
    background: #fbfbfb;
    font-size: 0.95rem; 
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.3s ease;
}
.mia-inline-form input:focus {
    border-color: var(--mia-accent);
    background: white;
    box-shadow: 0 4px 15px rgba(197, 160, 117, 0.1);
}
.btn-mia-inline { 
    background: var(--title, #221b1a); 
    color: white; 
    border: none; 
    padding: 15px; 
    border-radius: 12px; 
    font-weight: 600; 
    font-family: 'Inter', sans-serif;
    cursor: pointer; 
    transition: all 0.3s ease; 
    font-size: 0.95rem;
    margin-top: 5px;
    letter-spacing: 0.02em;
}
.btn-mia-inline:hover { 
    background: var(--mia-accent); 
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(197, 160, 117, 0.25);
}
.btn-mia-inline:disabled { background: #ccc; cursor: not-allowed; transform: none; }
