/* Ephiro - header action icons (Instagram, wishlist, cart, notifications,
   account). One shared stylesheet so the cluster is aligned and styled the
   same in every header: uniform round hit areas, teal icons, gold badges,
   no Bootstrap caret, shell-styled dropdown panels.

   Scoped to `body > header .navbar-nav` (the FIRST navbar only) so the shared
   second nav is never affected. */

body > header .navbar-nav {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    margin: 0;
}

body > header .navbar-nav > .nav-item {
    display: flex;
    align-items: center;
}

/* Uniform 42px round hit area for icon-only actions (Instagram, wishlist,
   cart, bell, account). Text buttons (.btn / .btn-primary / login) are
   explicitly excluded so "Iniciar Sessão" keeps its pill shape. */
body > header .navbar-nav > .nav-item > a:not(.btn):not(.btn-primary):not(.btn-danger):not(.btn-logout) {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50%;
    color: #002424 !important;
    background: transparent;
    font-size: 20px !important;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

body > header .navbar-nav > .nav-item > a:not(.btn):not(.btn-primary):not(.btn-danger):not(.btn-logout):hover,
body > header .navbar-nav > .nav-item > a:not(.btn):not(.btn-primary):not(.btn-danger):not(.btn-logout):focus-visible {
    background: rgba(0, 36, 36, 0.08);
    transform: translateY(-1px);
}

body > header .navbar-nav > .nav-item > a:not(.btn):not(.btn-primary):not(.btn-danger):not(.btn-logout):focus-visible {
    outline: 3px solid rgba(212, 154, 66, 0.55);
    outline-offset: 2px;
}

/* Text buttons (ex.: "Iniciar Sessão") keep the shell pill look — never the
   42px icon circle. Restores Bootstrap padding the icon rule zeroes out. */
body > header .navbar-nav > .nav-item > a.btn,
body > header .navbar-nav > .nav-item > a.btn-primary,
body > header .navbar-nav > .nav-item > a.btn-danger,
body > header .navbar-nav > .nav-item > a.btn-logout {
    display: inline-flex !important;
    width: auto !important;
    height: auto !important;
    min-height: 35px;
    align-items: center;
    justify-content: center;
    margin: 0 0 0 4px !important;
    padding: 8px 16px !important;
    border: 0;
    border-radius: 7px;
    color: #ffffff !important;
    background: #002424 !important;
    font-size: 12px !important;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
}

/* Glyphs: one size, shell colours (overrides the old inline colours) */
body > header .navbar-nav i {
    font-size: 20px !important;
    color: #002424 !important;
    line-height: 1;
}

body > header .navbar-nav i.fa-instagram,
body > header .navbar-nav i.fa-brands.fa-instagram {
    color: #e1306c !important;
}

body > header .navbar-nav i.fa-facebook,
body > header .navbar-nav i.fa-brands.fa-facebook {
    color: #1877f2 !important;
}

/* Icon-only dropdowns: drop Bootstrap's caret, tint the button while open */
body > header .navbar-nav .nav-link.dropdown-toggle::after,
body > header .navbar-nav a.dropdown-toggle::after {
    display: none !important;
}

body > header .navbar-nav .nav-item.dropdown.show > .dropdown-toggle,
body > header .navbar-nav .nav-item.dropdown > .dropdown-toggle[aria-expanded="true"] {
    background: rgba(0, 36, 36, 0.08);
}

/* Gold pill badges, pinned to the icon's top-right */
body > header .navbar-nav .cart-count,
body > header .navbar-nav .notification-count {
    position: absolute;
    top: 1px;
    right: 1px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #fdbe62 !important;
    color: #291800 !important;
    font-size: 10px !important;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 36, 36, 0.25);
}

/* Dropdown panels */
body > header .navbar-nav .dropdown-menu {
    min-width: 220px;
    margin-top: 10px !important;
    padding: 8px;
    border: 1px solid rgba(0, 36, 36, 0.1);
    border-radius: 12px;
    box-shadow: 0 18px 38px rgba(0, 36, 36, 0.16);
}

body > header .navbar-nav .dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 11px;
    border-radius: 8px;
    color: #1b1c1a;
    font-size: 13.5px;
    font-weight: 600;
    transition: background-color 0.18s ease, color 0.18s ease;
}

body > header .navbar-nav .dropdown-item:hover,
body > header .navbar-nav .dropdown-item:focus {
    color: #002424;
    background: rgba(0, 36, 36, 0.06);
}

body > header .navbar-nav .dropdown-divider {
    margin: 6px 4px;
    opacity: 0.5;
}

/* =====================================================================
   NOTIFICATIONS PANEL
   ---------------------------------------------------------------------
   The panel ships its own scoped .btn reset because two GLOBAL rules
   otherwise destroy the widget's compact action buttons:

     1. Style/ephiro.css:57      .btn { background: var(--brand-terracotta);
                                        color:#fff; border:none; clamp() }
     2. stitch-institutional.css:166
                                 body.ephiro-institutional form .btn {
                                     min-width:112px; min-height:44px;
                                     padding:11px 17px }

   The widget's buttons live inside <form method="POST">, so (2) fires on
   every institutional page (body.ephiro-institutional is set by
   headerEphiro.php:191) and turns each one into a 112x44 orange brick.

   `body > header .dropdown-menu.notifications .btn` = (0,3,2) outranks
   (0,2,2) and (0,1,0), so specificity - not !important - does the work and
   neither global file needs to change. NOTE: header-actions.css loads at
   headerEphiro.php:53, BEFORE stitch-institutional.css:55 and index.css:56,
   so every rule here must win on specificity, never on source order.
   ===================================================================== */

body > header .dropdown-menu.notifications {
    width: min(360px, 92vw);
    max-height: min(70vh, 480px);
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    border-radius: 14px;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 36, 36, 0.25) transparent;
}

body > header .dropdown-menu.notifications::-webkit-scrollbar {
    width: 8px;
}

body > header .dropdown-menu.notifications::-webkit-scrollbar-track {
    background: transparent;
}

body > header .dropdown-menu.notifications::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(0, 36, 36, 0.22);
}

body > header .dropdown-menu.notifications::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 36, 36, 0.4);
}

/* --- sticky panel header ------------------------------------------- */
body > header .dropdown-menu.notifications .notification-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 16px;
    border-bottom: 1px solid rgba(0, 36, 36, 0.08);
    background: #ffffff;
    color: #0d3b3a;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

body > header .dropdown-menu.notifications .notification-head-count {
    padding: 2px 9px;
    border-radius: 999px;
    background: #fdbe62;
    color: #291800;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-size: 10.5px;
    font-weight: 800;
    line-height: 16px;
    letter-spacing: 0.02em;
}

/* --- rows ------------------------------------------------------------ */
body > header .dropdown-menu.notifications .notification-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 14px 11px 16px;
    color: #1b1c1a;
    font-size: 13px;
    line-height: 1.5;
    transition: background-color 0.16s ease;
}

/* separator only BETWEEN rows - head/footer own their own edges */
body > header .dropdown-menu.notifications .notification-item + .notification-item {
    border-top: 1px solid rgba(0, 36, 36, 0.07);
}

body > header .dropdown-menu.notifications .notification-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: transparent;
}

body > header .dropdown-menu.notifications .notification-item.unread {
    background: rgba(253, 190, 98, 0.14);
}

body > header .dropdown-menu.notifications .notification-item.unread::before {
    background: #f0a93a;
}

body > header .dropdown-menu.notifications .notification-item:hover {
    background: rgba(0, 36, 36, 0.045);
}

body > header .dropdown-menu.notifications .notification-item.unread:hover {
    background: rgba(253, 190, 98, 0.26);
}

/* icon bubble - neutralises the `.navbar-nav i !important` header rule */
body > header .dropdown-menu.notifications .notification-bullet {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-top: 1px;
    border-radius: 50%;
    background: rgba(13, 59, 58, 0.09);
    color: #0d3b3a;
    line-height: 1;
}

body > header .dropdown-menu.notifications .notification-item.unread .notification-bullet {
    background: #0d3b3a;
    color: #fdbe62;
}

body > header .dropdown-menu.notifications .notification-bullet i {
    font-size: 13px !important;
    color: inherit !important;
}

body > header .dropdown-menu.notifications .notification-body {
    flex: 1 1 auto;
    min-width: 0;
}

body > header .dropdown-menu.notifications .notification-item p {
    margin: 0;
    color: #1b1c1a;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

body > header .dropdown-menu.notifications .notification-item.unread p {
    font-weight: 600;
}

body > header .dropdown-menu.notifications .notification-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 10px;
    margin-top: 4px;
}

body > header .dropdown-menu.notifications .notification-meta small {
    color: #7b8483;
    font-size: 11px;
    line-height: 1.4;
}

/* --- empty state ------------------------------------------------------ */
body > header .dropdown-menu.notifications .notification-empty {
    display: block;
    padding: 34px 22px;
    background: transparent;
    color: #7b8483;
    text-align: center;
}

body > header .dropdown-menu.notifications .notification-empty i {
    display: block;
    margin-bottom: 10px;
    color: rgba(13, 59, 58, 0.32) !important;
    font-size: 26px !important;
}

/* --- ACTION BUTTONS: the scoped reset --------------------------------
   min-width/min-height 0 kills stitch-institutional's 112x44 brick;
   transparent background kills ephiro.css's terracotta fill. Hover rules
   repeat the full selector to out-rank ephiro.css `.btn:hover` and
   index.css `.btn-link:hover` / `.btn-outline-primary:hover`. */
body > header .dropdown-menu.notifications .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    margin: 0;
    padding: 4px 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: #0d3b3a;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: none;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

body > header .dropdown-menu.notifications .btn:hover,
body > header .dropdown-menu.notifications .btn:focus-visible {
    background: rgba(13, 59, 58, 0.09);
    color: #0d3b3a;
    text-decoration: none;
    transform: none;
    box-shadow: none;
}

/* "Marcar como lida" - quiet inline text action, always visible */
body > header .dropdown-menu.notifications .btn-link {
    padding-right: 6px;
    padding-left: 6px;
    color: #0d3b3a;
    font-weight: 700;
}

body > header .dropdown-menu.notifications .btn-link:hover,
body > header .dropdown-menu.notifications .btn-link:focus-visible {
    background: transparent;
    color: #0a2e2d;
    text-decoration: underline;
}

/* footer: compact ghost outlines instead of solid blocks */
body > header .dropdown-menu.notifications .btn-outline-primary {
    border-color: rgba(13, 59, 58, 0.3);
    background: #ffffff;
    color: #0d3b3a;
}

body > header .dropdown-menu.notifications .btn-outline-primary:hover,
body > header .dropdown-menu.notifications .btn-outline-primary:focus-visible {
    border-color: #0d3b3a;
    background: #0d3b3a;
    color: #ffffff;
}

body > header .dropdown-menu.notifications .btn-outline-danger {
    border-color: rgba(178, 58, 58, 0.32);
    background: #ffffff;
    color: #b23a3a;
}

body > header .dropdown-menu.notifications .btn-outline-danger:hover,
body > header .dropdown-menu.notifications .btn-outline-danger:focus-visible {
    border-color: #b23a3a;
    background: #b23a3a;
    color: #ffffff;
}

/* --- sticky footer --------------------------------------------------- */
body > header .dropdown-menu.notifications .notification-mark {
    display: inline-flex;
    margin: 0;
}

body > header .dropdown-menu.notifications .notification-foot {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid rgba(0, 36, 36, 0.08);
    background: #ffffff;
}

@media (max-width: 575.98px) {
    body > header .dropdown-menu.notifications .notification-foot {
        flex-direction: column;
        align-items: stretch;
    }

    body > header .dropdown-menu.notifications .notification-foot .btn {
        width: 100%;
    }
}

/* Mobile: keep the cluster tidy inside the collapsed menu */
@media (max-width: 991.98px) {
    body > header .navbar-nav {
        flex-wrap: wrap;
        gap: 2px;
    }

    body > header .collapse.navbar-collapse.show .navbar-nav,
    body > header .collapse.navbar-collapse.collapsing .navbar-nav {
        padding: 8px 2px 12px;
    }
}
