/* =========================================
   Carnaval Delivery Insight - BH (Ao Gosto)
   Versão: 3.2 - Edition "Clean & Sharp"
   ========================================= */

:root {
    --ag-brand: #FF5500;
    --ag-brand-hover: #E64D00;
    --ag-text: #1F2937;
    --ag-text-sub: #6B7280;
    --ag-bg: #FFFFFF;
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.12);
    --shadow-hover: 0 15px 35px rgba(255, 85, 0, 0.2);
    --font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- CONTAINER PRINCIPAL --- */
.ag-cw {
    position: fixed;
    z-index: 999999;
    font-family: var(--font-stack);
    bottom: 24px;
    right: 24px;
    color: var(--ag-text);
    display: block;
}

.ag-cw * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }
.ag-cw__hidden { display: none !important; opacity: 0; pointer-events: none; }

/* -------------------------------------------
   ESTADO 1: Pílula Compacta (Botão Flutuante)
   ------------------------------------------- */
.ag-cw__compact {
    background: var(--ag-bg);
    border-radius: 99px;
    padding: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 24px rgba(255, 85, 0, 0.25);
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.05);
    max-width: 320px;
}

.ag-cw__compact:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* Ícone com Gradiente */
.ag-cw__icon-wrap {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B35, #FF4500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    flex-shrink: 0;
}

.ag-cw__info { display: flex; flex-direction: column; padding-right: 12px; }
.ag-cw__title { font-weight: 800; font-size: 13px; color: var(--ag-text); line-height: 1.2; }
.ag-cw__sub { font-size: 10px; color: var(--ag-brand); font-weight: 700; text-transform: uppercase; margin-top: 2px; }

.ag-cw__cta-icon {
    margin-right: 6px;
    color: var(--ag-brand);
    display: flex; align-items: center;
}

/* Botão de fechar (X) do modo compacto - Oculto no desktop para limpeza */
.ag-cw__compact-close { display: none; }


/* -------------------------------------------
   ESTADO 2: Janela Principal (Sheet)
   ------------------------------------------- */
.ag-cw__sheet {
    background: #fff;
    width: 360px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
    border: 1px solid rgba(0,0,0,0.05);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- NOVO CABEÇALHO (Barra Fixa no Topo) --- */
.ag-cw__header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: white;
    border-bottom: 1px solid #f3f4f6;
    z-index: 20;
}

.ag-cw__h-title {
    font-weight: 800;
    font-size: 14px;
    color: var(--ag-text);
}

.ag-cw__close-sheet {
    background: #F3F4F6;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #666;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.ag-cw__close-sheet:hover { background: #e5e7eb; color: var(--ag-brand); }


/* --- ÁREA DO MAPA --- */
.ag-cw__mapWrap {
    position: relative;
    width: 100%;
    height: 300px;
    background: #eee;
}
.ag-cw__map { width: 100%; height: 100%; }

/* --- NAVEGAÇÃO DE DATAS (Flutuante no Mapa) --- */
.ag-cw__nav-container {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 60px; /* Espaço para o botão GPS */
    z-index: 10;
    pointer-events: none; /* Permite clicar no mapa onde não tem botão */
}

.ag-cw__nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    pointer-events: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.ag-cw__nav::-webkit-scrollbar { display: none; }

.ag-cw__day-btn {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 12px;
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    white-space: nowrap;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.ag-cw__day-btn:hover { transform: translateY(-1px); }

.ag-cw__day-btn.active {
    background: var(--ag-text);
    color: white;
    border-color: var(--ag-text);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Indicadores de Cor (Bolinhas) */
.ag-cw__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
}
.ag-cw__dot--green { background: #10B981; }
.ag-cw__dot--orange { background: #F59E0B; }
.ag-cw__dot--red { background: #EF4444; }

/* Bolinha fica branca quando o botão está ativo */
.ag-cw__day-btn.active .ag-cw__dot { background: white; }


/* --- BOTÃO GPS --- */
.ag-cw__gps {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}
.ag-cw__gps:hover { transform: scale(1.05); color: var(--ag-brand); }


/* --- CORPO (STATUS E AÇÃO) --- */
.ag-cw__body {
    padding: 16px;
    background: white;
    position: relative;
    z-index: 20;
}

.ag-cw__status {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #FFF7ED;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 12px;
    border: 1px solid rgba(255, 85, 0, 0.1);
}

.ag-cw__status-icon { font-size: 18px; }
.ag-cw__status-text {
    font-size: 12px;
    color: #9A3412;
    font-weight: 500;
    line-height: 1.35;
}

.ag-cw__btn-main {
    width: 100%;
    border: none;
    background: var(--ag-brand);
    color: white;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    box-shadow: 0 5px 15px rgba(255, 85, 0, 0.25);
    transition: background 0.2s, transform 0.2s;
}

.ag-cw__btn-main:hover {
    background: var(--ag-brand-hover);
    transform: translateY(-1px);
}

/* Oculta Rodapé/Toggle antigo */
.ag-cw__footer { display: none !important; }


/* =========================================
   AJUSTES MOBILE (Responsividade)
   ========================================= */
@media (max-width: 768px) {
    .ag-cw {
        right: 16px;
        left: auto;
        bottom: 90px !important; /* FLUTUA ACIMA DO MENU FIXO */
        width: auto;
        display: flex;
        justify-content: flex-end;
    }

    .ag-cw__compact {
        width: 50px;
        height: 50px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    /* Esconde textos no mobile, deixa só o ícone */
    .ag-cw__info, .ag-cw__cta-icon { display: none; }
    
    .ag-cw__icon-wrap {
        width: 100%;
        height: 100%;
        font-size: 22px;
        box-shadow: none;
    }

    /* Modal ocupa quase toda largura */
    .ag-cw__sheet {
        position: fixed;
        bottom: 90px;
        right: 16px;
        width: calc(100vw - 32px);
        max-width: 400px;
    }
}