/**
 * Novo Header - Baseado no modelo fornecido
 */

/* Header principal */
.header {
    background: linear-gradient(135deg, #1a5943 0%, #2d7a5f 100%);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px;
    overflow: visible !important;
}

/* Logo estilizada */
.logo {
    white-space: nowrap;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.3s;
}

.logo a:hover {
    opacity: 0.9;
}

.logo img {
    height: 55px;
    width: auto;
}

/* Container da busca */
.search-container {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    flex: 1;
    max-width: 500px;
    height: 50px;
}

/* Select estilizado */
.search-type-selector {
    background: #f8f9fa;
    border: none;
    padding: 0 15px 0 20px;
    height: 100%;
    font-size: 14px;
    font-weight: 600;
    color: #1a5943;
    cursor: pointer;
    border-right: 2px solid #e9ecef;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a5943' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
    transition: background-color 0.2s;
}

.search-type-selector:hover {
    background: #e9ecef;
}

.search-type-selector:focus {
    background: #e0e5e9;
}

/* Ajustar campo de busca do Drupal dentro do container */
.search-container .search-input-wrapper,
.search-container form {
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.search-container form > div:first-child {
    width: 76%;
}

.search-container input[type="text"] {
    flex: 1;
    border: none !important;
    padding: 0 5px !important;
    font-size: 15px !important;
    outline: none !important;
    color: #333 !important;
    background: transparent !important;
    box-shadow: none !important;
    height: 100%;
    margin: 0 !important;
}

.search-container input[type="text"]::placeholder {
    color: #999;
}

.search-container button[type="submit"],
.search-container .search-icon-btn {
    background: #2d7a5f !important;
    border: none !important;
    padding: 0 25px !important;
    height: 50px !important;
    min-height: 50px !important;
    color: white !important;
    font-size: 18px !important;
    cursor: pointer !important;
    transition: background 0.3s !important;
    border-radius: 0 25px 25px 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.search-container button[type="submit"]:hover,
.search-container .search-icon-btn:hover {
    background: #1a5943 !important;
}

.search-container button[type="submit"]:active,
.search-container .search-icon-btn:active {
    background: #0f3d2a !important;
}

/* Botões da direita (Curtir, Salvar, Compartilhar) */
.right-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: visible;
}

.share-wrapper {
    position: relative;
    overflow: visible;
}

.action-btn {
    background: white;
    border: 1px solid #dee2e6;
    color: #1a5943;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
}

.action-btn:hover {
    background: #f8f9fa;
    border-color: #1a5943;
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn svg,
.action-btn i {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.action-btn.liked,
.action-btn.active {
    color: #28a745;
    border-color: #28a745;
}

.action-btn.saved {
    color: #007bff;
    border-color: #007bff;
}

.action-btn.favorito-saved {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.action-btn.favorito-saved:hover {
    background: #218838;
    border-color: #218838;
}

.action-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.like-count {
    font-size: 13px;
    color: #666;
}


/* ============================================
    EFEITO 3: BOUNCE PERIÓDICO (CALL ATTENTION)
============================================ */
#shareBtn.action-btn {
    transition: all 0.3s;
    animation: gentleBounce 3s ease-in-out infinite;
}

.btn-share-bounce {
    background: white;
    border: 2px solid #e0e0e0;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--dark-gray);
    transition: all 0.3s;
    animation: gentleBounce 3s ease-in-out infinite;
}

@keyframes gentleBounce {
    0%, 90%, 100% {
        transform: translateY(0);
    }
    92%, 96% {
        transform: translateY(-4px);
    }
    94%, 98% {
        transform: translateY(-2px);
    }
}

.btn-share-bounce:hover {
    background: var(--secondary-green);
    color: white;
    border-color: var(--secondary-green);
    transform: scale(1.05) translateY(0) !important;
    animation: none;
}

/* Botões do centro (Minha Conta, Sair, Carrinho) */
.center-buttons {
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: visible;
}

.account-wrapper {
    position: relative;
    overflow: visible;
}

.header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.header-btn:active {
    transform: translateY(0);
}

.header-btn svg,
.header-btn i {
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.cart-badge {
    background: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: 4px;
}

/* Dropdown de conta */
.account-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 8px;
    min-width: 200px;
    z-index: 10000 !important;
    border: 1px solid #dee2e6;
}

.account-dropdown[style*="display: block"],
.account-dropdown.show {
    display: block !important;
}

.account-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: background 0.2s;
    width: 100%;
    font-size: 14px;
}

.account-option:hover {
    background: #f8f9fa;
}

.account-option i {
    font-size: 18px;
    color: #1a5943;
    width: 20px;
    text-align: center;
}

/* Dropdown de compartilhamento */
.share-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px;
    min-width: 320px;
    z-index: 10000;
    border: 1px solid #dee2e6;
}

.share-dropdown[style*="display: block"] {
    display: grid !important;
}

.share-dropdown-header {
    font-weight: 600;
    color: #333;
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 8px;
    grid-column: 1 / -1;
}

/* Container em grid para as opções */
.share-dropdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: background 0.2s;
}

.share-option:hover {
    background: #f8f9fa;
}

.share-option i {
    font-size: 20px;
    color: #1a5943;
}

/* Cores específicas para cada rede social */
.share-option[data-share="whatsapp"] i {
    color: #25D366;
}

.share-option[data-share="facebook"] i {
    color: #1877F2;
}

.share-option[data-share="twitter"] i {
    color: #1DA1F2;
}

.share-option[data-share="linkedin"] i {
    color: #0A66C2;
}

.share-option[data-share="email"] i {
    color: #EA4335;
}

.share-option[data-share="copy"] i {
    color: #666;
}

/* Modal de Compartilhamento por E-mail */
.email-share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.email-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 20001;
}

.email-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #e9ecef;
    background: linear-gradient(135deg, #1a5943 0%, #2d7a5f 100%);
    border-radius: 12px 12px 0 0;
}

.email-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.email-modal-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.email-modal-close:hover {
    opacity: 0.7;
}

.email-modal-form {
    padding: 25px;
}

.email-modal-form .form-group {
    margin-bottom: 20px;
}

.email-modal-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.email-modal-form .form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.email-modal-form .form-control:focus {
    outline: none;
    border-color: #1a5943;
    box-shadow: 0 0 0 3px rgba(26, 89, 67, 0.1);
}

.email-modal-form .form-control:read-only {
    background: #f8f9fa;
    cursor: default;
}

.email-modal-form textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.email-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.email-modal-actions button {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.email-modal-actions .btn-cancel {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
}

.email-modal-actions .btn-cancel:hover {
    background: #e9ecef;
}

.email-modal-actions .btn-send {
    background: #1a5943;
    color: white;
}

.email-modal-actions .btn-send:hover {
    background: #0f3d2a;
    transform: translateY(-1px);
}

.email-modal-actions .btn-send:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.email-share-feedback {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
}

.email-share-feedback.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.email-share-feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 1200px) {
    .header {
        flex-wrap: wrap;
    }

    .right-buttons,
    .center-buttons {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .logo img {
        height: 32px;
    }

    .search-container {
        width: 100%;
        max-width: 100%;
    }

    .center-buttons,
    .right-buttons {
        width: 100%;
        justify-content: center;
        gap: 10px;
    }

    .search-type-selector {
        font-size: 13px;
        padding: 0 10px 0 15px;
        padding-right: 25px;
    }

    .search-container input[type="text"] {
        font-size: 14px !important;
        padding: 0 15px !important;
    }

    .search-container button[type="submit"],
    .search-container .search-icon-btn {
        padding: 0 20px !important;
    }

    .action-btn,
    .header-btn {
        font-size: 13px;
        padding: 8px 14px;
    }

    /* Dropdown de compartilhamento em uma coluna no mobile */
    .share-dropdown {
        grid-template-columns: 1fr;
        min-width: 240px;
    }

    /* Mostrar botão hambúrguer no mobile */
    .mobile-menu-toggler {
        display: flex !important;
    }

}

/* Media query adicional para tablets */
@media (max-width: 992px) {
    .center-buttons {
        overflow: visible !important;
    }

    .account-wrapper {
        position: relative;
        overflow: visible !important;
    }

    .account-dropdown {
        position: absolute;
        min-width: 200px;
    }
}


/* Botão hambúrguer mobile */
.mobile-menu-toggler {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
}

.mobile-menu-toggler:hover {
    background: rgba(255, 255, 255, 0.25);
}

.toggler-icon {
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: relative;
    transition: all 0.3s;
}

.toggler-icon::before,
.toggler-icon::after {
    content: '';
    display: block;
    width: 24px;
    height: 2px;
    background: white;
    position: absolute;
    left: 0;
    transition: all 0.3s;
}

.toggler-icon::before {
    top: -8px;
}

.toggler-icon::after {
    top: 8px;
}

/* Mobile Account Menu */
.mobile-account-menu {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    z-index: 20000;
    padding: 20px 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-account-menu.show {
    display: block;
    transform: translateX(0);
}

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    font-size: 16px;
}

.mobile-menu-link:hover {
    background: #f8f9fa;
    color: #1a5943;
    text-decoration: none;
}

.mobile-menu-link i {
    font-size: 22px;
    color: #1a5943;
    width: 28px;
    text-align: center;
}

/* Overlay para fechar o menu ao clicar fora */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 19999;
}

.mobile-menu-overlay.show {
    display: block;
}

/* Feedback visual */
.search-container.artigos-mode {
    border: 2px solid #287258;
}

.search-container.peticoes-mode {
    border: 2px solid #287258;
}
