/* 
 * Redesign do cabeçalho em estilo Amazon
 * Implementação responsiva com abordagem mobile-first
 */

/* Estilos gerais do cabeçalho Amazon */
.amazon-header {
    background-color: #fff;
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
    padding: 8px 0;
}

/* Barra superior com menu, logo e ícones */
.amazon-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    margin-bottom: 8px;
}

/* Parte esquerda: Menu hamburguer e logo */
.amazon-header-left {
    display: flex;
    align-items: center;
}

/* Menu hamburguer */
.amazon-menu-button {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #333;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    margin-right: 5px;
}

/* Logo TLS */
.amazon-logo {
    display: block;
    text-decoration: none;
}

.amazon-logo img {
    width: 120px;
    height: 35px;
    object-fit: contain;
}

/* Parte direita: Ícones de usuário e ações */
.amazon-header-right {
    display: flex;
    align-items: center;
}

/* Ícones no cabeçalho */
.amazon-header-icon {
    display: flex;
    align-items: center;
    padding: 8px;
    color: #333;
    text-decoration: none;
    font-size: 20px;
    position: relative;
    margin-left: 5px;
}

.amazon-header-text {
    font-size: 14px;
    margin-left: 5px;
    white-space: nowrap;
}

/* Badge para notificações */
.amazon-header-badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #f28000;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Botão de anunciar */
.amazon-post-button {
    background-color: #f28000;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-weight: bold;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    font-size: 14px;
}

.amazon-post-button:hover {
    background-color: #e67700;
    color: white;
    text-decoration: none;
}

/* Barra de busca expansível */
.amazon-search-container {
    padding: 0 10px;
    margin-bottom: 8px;
}

.amazon-search-form {
    display: flex;
    width: 100%;
    align-items: stretch; /* Garante que todos os elementos tenham a mesma altura */
}

.amazon-search-input-container {
    flex: 1;
    position: relative;
}

.amazon-search-input {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    padding: 8px 12px;
    font-size: 14px;
    padding-right: 12px; /* Reduzido para não sobrepor o botão */
    box-sizing: border-box; /* Garante que padding não aumente a largura */
}

/* Compatibilidade com scripts existentes */
.search-input-container {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    height: 40px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    padding: 8px 12px;
    font-size: 14px;
    padding-right: 12px;
    box-sizing: border-box;
}

.amazon-search-input:focus {
    border-color: #7030a0;
    outline: none;
    box-shadow: 0 0 0 2px rgba(112, 48, 160, 0.2);
}

.amazon-search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 1000;
    display: none;
}

.amazon-search-button {
    width: 45px;
    height: 40px;
    background-color: #f28000;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    min-width: 45px; /* Aumentado para garantir visibilidade */
    flex-shrink: 0; /* Impede que o botão encolha */
    z-index: 2; /* Garante que o botão fique acima do campo de busca */
}

/* Compatibilidade com scripts existentes */
.search-button {
    width: 45px;
    height: 40px;
    background-color: #f28000;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    min-width: 45px;
    flex-shrink: 0;
    z-index: 2;
}

/* Compatibilidade com contadores de notificações */
.icon-counter {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #f28000;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Compatibilidade com dropdown de categorias */
.category-dropdown-container {
    position: relative;
    display: none; /* Oculto em mobile, mas mantido para compatibilidade */
}

.category-dropdown-button,
.category-dropdown-menu,
.category-dropdown-item {
    display: none; /* Oculto em mobile, mas mantido para compatibilidade */
}

/* Ocultar mensagem de erro */
.alert-danger {
    display: none !important;
}

/* Menu de categorias com scroll horizontal */
.amazon-categories {
    background-color: #f8f9fa;
    border-bottom: 1px solid #ddd;
    padding: 8px 0;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.amazon-categories-scroll {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    padding: 0 10px;
    scroll-behavior: smooth; /* Rolagem suave */
    position: relative;
    -ms-overflow-style: none; /* IE e Edge */
    white-space: nowrap;
    gap: 10px; /* Espaçamento entre itens */
    scroll-snap-type: x mandatory; /* Snap para itens */
    width: 100%;
}

.amazon-categories-scroll::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.amazon-category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    padding: 0 5px;
    text-decoration: none;
    color: #333;
    text-align: center;
    scroll-snap-align: start; /* Snap para início do item */
    transition: transform 0.2s ease;
}

.amazon-category-item:hover {
    transform: translateY(-2px);
}

.amazon-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 5px;
    color: #7030a0;
    font-size: 18px;
    transition: background-color 0.2s ease;
}

.amazon-category-item:hover .amazon-category-icon {
    background-color: #e8d5f7;
}

.amazon-category-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Menu lateral estilo Amazon */
.amazon-side-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100%;
    background-color: white;
    z-index: 2000;
    overflow-y: auto;
    transition: left 0.3s ease;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.2);
}

.amazon-side-menu.active {
    left: 0;
}

/* Cabeçalho do menu lateral */
.amazon-side-menu-header {
    background-color: #7030a0;
    color: white;
    padding: 15px;
    position: relative;
}

.amazon-side-menu-user {
    display: flex;
    align-items: center;
}

.amazon-side-menu-user i {
    font-size: 24px;
    margin-right: 10px;
}

.amazon-side-menu-user span {
    font-size: 16px;
    font-weight: bold;
}

.amazon-side-menu-close {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 20px;
    background: none;
    border: none;
    cursor: pointer;
}

/* Conteúdo do menu lateral */
.amazon-side-menu-content {
    padding-bottom: 20px;
}

/* Seções do menu lateral */
.amazon-side-menu-section {
    border-bottom: 1px solid #ddd;
    padding: 10px 0;
}

.amazon-side-menu-section-title {
    font-size: 16px;
    font-weight: bold;
    padding: 10px 15px;
    color: #333;
}

.amazon-side-menu-item {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    position: relative;
}

.amazon-side-menu-item:hover {
    background-color: #f8f9fa;
}

.amazon-side-menu-item i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
    color: #7030a0;
}

.amazon-side-menu-badge {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #f28000;
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay para o menu lateral */
.amazon-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    display: none;
}

.amazon-menu-overlay.active {
    display: block;
}

/* Botão de anunciar fixo para mobile */
.amazon-mobile-post-button {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #f28000;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    text-decoration: none;
    font-size: 24px;
}

.amazon-mobile-post-button:hover {
    background-color: #e67700;
    color: white;
    text-decoration: none;
}

/* Responsividade para tablets */
@media (min-width: 576px) {
    .amazon-logo img {
        width: 150px;
        height: 44px;
    }
    
    .amazon-search-input {
        height: 44px;
        font-size: 16px;
    }
    
    .amazon-search-button {
        width: 44px;
        height: 44px;
    }
    
    .amazon-category-item {
        min-width: 80px;
    }
    
    .amazon-category-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .amazon-category-name {
        font-size: 12px;
    }
}

/* Responsividade para desktop */
@media (min-width: 992px) {
    .amazon-header-top {
        padding: 0 15px;
        margin-bottom: 10px;
    }
    
    .amazon-logo img {
        width: 170px;
        height: 50px;
    }
    
    .amazon-menu-button {
        margin-right: 10px;
    }
    
    .amazon-search-container {
        padding: 0 15px;
        margin-bottom: 10px;
    }
    
    .amazon-search-input {
        height: 48px;
        font-size: 16px;
        padding: 10px 15px;
    }
    
    .amazon-search-button {
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
    
    .amazon-post-button {
        padding: 10px 20px;
        font-size: 16px;
    }
    
    .amazon-categories {
        padding: 10px 0;
    }
    
    .amazon-categories-scroll {
        padding: 0 15px;
        overflow-x: auto; /* Manter rolagem mesmo em desktop */
        justify-content: flex-start; /* Alinhar à esquerda para permitir rolagem */
        gap: 15px; /* Mais espaço entre itens em desktop */
    }
    
    .amazon-category-item {
        min-width: 80px;
        padding: 0 5px;
    }
    
    .amazon-category-icon {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }
    
    .amazon-category-name {
        font-size: 12px;
    }
    
    /* Esconder botão de anunciar fixo em desktop */
    .amazon-mobile-post-button {
        display: none;
    }
}

/* Indicadores de rolagem nas laterais */
.amazon-categories::before,
.amazon-categories::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 30px;
    pointer-events: none;
    z-index: 1;
}

.amazon-categories::before {
    left: 0;
    background: linear-gradient(to right, rgba(248, 249, 250, 0.9), rgba(248, 249, 250, 0));
}

.amazon-categories::after {
    right: 0;
    background: linear-gradient(to left, rgba(248, 249, 250, 0.9), rgba(248, 249, 250, 0));
}
