/* ============================================
    HEADER MED - Medicamentos
    fox.headerMed.css
    ============================================ */

/* ============================================
    TICKER BAR - Barra verde superior
    ============================================ */

.headermed-ticker {
    background-color: var(--foxb2c-primary);
    color: #fff;
    padding: 0.4rem 0;
    overflow: hidden;
    white-space: nowrap;
}

.headermed-ticker-track {
    display: inline-flex;
    animation: ticker-slide 30s linear infinite;
    white-space: nowrap;
}

.headermed-ticker-track:hover {
    animation-play-state: paused;
}

.headermed-ticker-item {
    display: inline-block;
    padding: 0 2.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.headermed-ticker-item::before {
    content: "•";
    margin-right: 0.5rem;
    opacity: 0.7;
}

.headermed-ticker {padding: 0.2rem 0;}
.headermed-ticker-track{display: none;}

@keyframes ticker-slide {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ============================================
    HEADER MAIN - Logo + Busca + Ícones
    ============================================ */

.headermed {
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.headermed-main {
    padding: 0.85rem 0;
    border-bottom: 1px solid #e8e8e8;
    background: var(--foxb2c-gradient-branco-01);
}

/* Logo */
.headermed-logo img {
    max-width: 190px;
    max-width: 155px;
    height: auto;
    transition: transform 0.3s;
}

.headermed-logo:hover img {
    transform: scale(1.04);
}

/* Search */
.headermed-search-form {
    position: relative;
    width: 100%;
}

.headermed-search-form input {
    width: 100%;
    border-radius: 25px;
    padding: 0.7rem 3.5rem 0.7rem 1.4rem;
    border: 1px solid #e8e8e8;
    font-size: 0.95rem;
    transition: all 0.3s;
    background: #f4f8ff;
}

.headermed-search-form input:focus {
    outline: none;
    border-color: var(--foxb2c-primary, #0066cc);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
    border-radius: 25px;
}

.headermed-search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--foxb2c-primary, #0066cc);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.headermed-search-form button:hover {
    background: #0052a3;
    transform: translateY(-50%) scale(1.05);
}

/* Ícones direita */
.headermed-icons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.headermed-icon-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: #333;
    padding: 0.4rem 0.65rem;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.headermed-icon-btn:hover {
    color: var(--foxb2c-primary, #0066cc);
    text-decoration: none;
}

/* Ícone - lado esquerdo */
.headermed-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.headermed-icon-wrap i {
    font-size: 1.7rem;
    color: var(--foxb2c-accent, #0066cc);
    display: block;
    transition: color 0.2s;
}

.headermed-icon-btn:hover .headermed-icon-wrap i {
    color: #2e7d32;
}

/* Texto - lado direito (2 linhas) */
.headermed-icon-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.headermed-icon-sub {
    font-size: 0.7rem;
    color: #888;
    font-weight: 400;
}

.headermed-icon-title {
    font-size: 0.85rem;
    color: #222;
    font-weight: 600;
}

.headermed-icon-btn:hover .headermed-icon-title {
    color: var(--foxb2c-primary, #0066cc);
}

/* Divisor vertical entre ícones */
.headermed-icon-divider {
    display: inline-block;
    width: 1px;
    height: 36px;
    background: #e0e0e0;
    align-self: center;
    flex-shrink: 0;
}

/* Cart badge */
.headermed-cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #dc3545;
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ============================================
    NAVIGATION BAR
    ============================================ */

.headermed-nav-bar {
    background: var(--foxb2c-primary, #0066cc);
    background-color: var(--foxb2c-header);
    position: relative;
}

.headermed-nav {
    display: flex;
    align-items: stretch;
    list-style: none;
    margin: 0;
    padding: 0;
}

.headermed-nav > li {
    position: relative;
}

.headermed-nav > li > a {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    color: var(--header-menu-link);
    text-decoration: none;
    text-transform: capitalize;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s;
}

.headermed-nav > li:first-child > a {
    padding-left: 0;
}

.headermed-nav > li > a:hover,
.headermed-nav > li.active > a {
    background: rgba(255,255,255,0.15);
    color: var(--header-menu-hover);
}

.headermed-nav > li > a i.chevron {
    font-size: 0.65rem;
    opacity: 0.8;
    transition: transform 0.2s;
}

.headermed-nav > li:hover > a i.chevron {
    transform: rotate(180deg);
}

/* Dropdown padrão */
.headermed-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    list-style: none;
    padding: 0.5rem 0;
    z-index: 1050;
    border-top: 3px solid #2e7d32;
}

.headermed-nav > li:hover .headermed-dropdown {
    display: block;
}

.headermed-dropdown li a {
    display: block;
    padding: 0.55rem 1.25rem;
    color: #333;
    text-decoration: none;
    text-transform: capitalize;
    font-size: 0.88rem;
    transition: all 0.2s;
}

.headermed-dropdown li a:hover {
    background: #f0f7ff;
    color: var(--foxb2c-primary, #0066cc);
    padding-left: 1.6rem;
}

/* ============================================
    DROPDOWN COLUNAS (com ou sem imagem)
    ============================================ */

.headermed-dropdown.colunas {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    border-top: 3px solid #2e7d32;
    z-index: 1050;
    padding: 1rem;
    min-width: 360px;
    flex-direction: row;
    gap: 1rem;
}

.headermed-nav > li:hover .headermed-dropdown.colunas {
    display: flex;
}

/* Coluna esquerda: imagem */
.hmd-col-imagem {
    flex: 0 0 auto;
    max-width: 180px;
    display: flex;
    align-items: flex-start;
}

.hmd-col-imagem img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

/* Coluna direita: lista de grupos em até 3 colunas */
.hmd-col-grupos {
    flex: 1 1 auto;
}

.hmd-col-grupos ul {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 3;
    column-gap: 0;
}

.hmd-col-grupos ul li a {
    display: block;
    padding: 0.4rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
    transition: all 0.2s;
}

.hmd-col-grupos ul li a:hover {
    background: #f0f7ff;
    color: var(--foxb2c-primary, #0066cc);
    padding-left: 1.3rem;
}

/* ============================================
    MENU MARCAS
    ============================================ */

.headermed-dropdown.brand {
   padding: 0;
}

.brand-inner > ul {
    min-width: 150px;
    max-width: 150px;
    list-style: none;
    padding: 0.5rem 0;
}

.brand-inner {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    padding: 0 1rem;
}

/* ============================================
    MEGA MENU - Último item
    ============================================ */

.headermed-nav > li.has-megamenu {
    position: static;
}

.headermed-megamenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,0.13);
    border-top: 3px solid #2e7d32;
    border-radius: 0 0 8px 8px;
    z-index: 1050;
    padding: 1.5rem 0;
    max-height: 520px;
    overflow-y: auto;
    overflow-x: hidden;
}

.headermed-nav > li.has-megamenu:hover .headermed-megamenu {
    display: block;
}

.headermed-megamenu-inner {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    padding: 0 1rem;
}

.headermed-megamenu-col {
    padding: 0 1rem;
    border-right: 1px solid #eee;
}

.headermed-megamenu-col:last-child {
    border-right: none;
}

.headermed-megamenu-col h6 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #2e7d32;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #e8f5e9;
}

.headermed-megamenu-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.headermed-megamenu-col ul li a {
    display: block;
    padding: 0.35rem 0;
    color: #444;
    text-decoration: none;
    text-transform: capitalize;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.headermed-megamenu-col ul li a:hover {
    color: var(--foxb2c-primary, #0066cc);
    padding-left: 0.5rem;
}

/* Grupos standalone — após os departamentos, mesmo formato de colunas */
.headermed-megamenu-groups {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    padding: 0 1rem;
}

.headermed-megamenu-groups--separator {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px dashed #ddd;
}

/* Mega menu banner opcional */
.headermed-megamenu-banner {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid #eee;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.headermed-megamenu-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.headermed-megamenu-tag:hover {
    background: #2e7d32;
    color: #fff;
}

/* ============================================
    MOBILE TOGGLE
    ============================================ */

.headermed-mobile-toggle {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    padding: 0.5rem;
    display: none;
}

/* ============================================
    MOBILE SIDEBAR
    ============================================ */

.headermed-mobile-sidebar {
    display: none;
}

.headermed-mobile-overlay {
    display: none;
}

/* ============================================
    RESPONSIVE
    ============================================ */

@media (max-width: 1366px) {
    .headermed-nav > li.has-megamenu{
        display: none;
    }
}

@media (max-width: 991px) {

    .headermed-cart-badge{
        top: 13px;
        right: initial;
    }
    
    .headermed-mobile-toggle {
        display: block;
    }

    .headermed-nav-bar .container > nav {
        display: none;
    }

    /* Mobile Sidebar */
    .headermed-mobile-sidebar {
        display: block;
        position: fixed;
        top: 0;
        left: -100%;
        width: 290px;
        height: 100vh;
        background: #fff;
        box-shadow: 4px 0 16px rgba(0,0,0,0.15);
        transition: left 0.3s ease;
        overflow-y: auto;
        z-index: 1100;
        padding: 4rem 0 2rem;
    }

    .headermed-mobile-sidebar.active {
        left: 0;
    }

    .headermed-mobile-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1099;
    }

    .headermed-mobile-overlay.active {
        display: block;
    }

    .headermed-mobile-close {
        position: absolute;
        top: 1rem;
        right: 1rem;
        background: transparent;
        border: none;
        font-size: 1.5rem;
        color: #444;
        cursor: pointer;
    }

    .headermed-mobile-sidebar .headermed-logo {
        display: block;
        padding: 0 1.25rem;
        position: absolute;
        top: 0.9rem;
        left: 0;
    }

    .headermed-mobile-sidebar .headermed-logo img {
        max-width: 140px;
    }

    .headermed-mobile-nav {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .headermed-mobile-nav li {
        border-bottom: 1px solid #f0f0f0;
    }

    .headermed-mobile-nav li a {
        display: block;
        padding: 0.85rem 1.5rem;
        color: #333;
        text-decoration: none;
        font-size: 0.92rem;
        font-weight: 500;
    }

    .headermed-mobile-nav li a:hover {
        background: #f4f8ff;
        color: var(--foxb2c-primary, #0066cc);
    }

    .headermed-mobile-nav .mobile-submenu {
        display: none;
        background: #f8f8f8;
        padding: 0;
    }

    .headermed-mobile-nav .mobile-submenu.show {
        display: block;
    }

    .headermed-mobile-nav .mobile-submenu li a {
        padding-left: 2.5rem;
        font-size: 0.87rem;
        font-weight: 400;
        color: #555;
    }

    .headermed-icon-text {
        display: none;
    }

    .headermed-icon-divider {
        display: none;
    }

    .headermed-icon-btn {
        padding: 0.4rem 0.5rem;
    }

    .headermed-icons {
        gap: 0.75rem;
    }

    .headermed-main {
        padding: 0.65rem 0;
    }

    .headermed-logo img {
        max-width: 150px;
    }
}

@media (max-width: 576px) {
    .headermed-ticker-item {
        font-size: 0.75rem;
        padding: 0 1.5rem;
    }

    .headermed-search-form input {
        font-size: 0.88rem;
        padding: 0.6rem 3rem 0.6rem 1.1rem;
    }

    .headermed-search-form button {
        width: 36px;
        height: 36px;
    }

    .headermed-icon-btn i {
        font-size: 1.25rem;
    }
}
