/* Store-benefits bar, "Deals" menu item, phone bottom bar and WhatsApp button (components/header.php) */

/* ---- Store-benefits bar (top of every page) ---- */
.site-announce {
    background: linear-gradient(90deg, #06223a, #0b4f7a);
    color: #fff;
    font-size: 0.8rem;
    overflow: hidden;
    max-height: 60px;
    transition: max-height 0.3s ease, opacity 0.25s ease;
}

.site-announce-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 28px;
    padding: 7px 16px;
}

.site-announce-item { white-space: nowrap; font-weight: 600; letter-spacing: 0.01em; }
.site-announce-item i { color: #5cc8ff; margin-right: 6px; }

/* Collapses with the rest of the header when it condenses on scroll */
.site-header-wrap.header-condensed .site-announce { max-height: 0; opacity: 0; }

/* Phones: one benefit at a time. Without JavaScript they simply scroll sideways. */
@media (max-width: 991px) {
    .site-announce-inner { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; gap: 24px; }
    .site-announce-inner::-webkit-scrollbar { display: none; }
    .site-announce-inner.is-rotating { justify-content: center; overflow: hidden; }
    .site-announce-inner.is-rotating .site-announce-item { display: none; }
    .site-announce-inner.is-rotating .site-announce-item.is-current { display: inline-block; animation: announceIn 0.35s ease; }
}

@keyframes announceIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ---- "Deals" menu item stands out ---- */
.category-nav-item > a.nav-deals,
.mobile-nav-link.nav-deals { color: #d1303f; }
.category-nav-item > a.nav-deals i,
.mobile-nav-link.nav-deals i { margin-right: 4px; }

/* ---- "Authorized dealer" mentions (tools/trust.php) ---- */
.highlight-card-logos { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.authorized-line { display: inline-flex; align-items: center; gap: 7px; font-size: 0.88rem; font-weight: 600; color: hsl(200, 100%, 28%); background: hsl(200, 100%, 96%); border: 1px solid hsl(200, 60%, 85%); border-radius: 999px; padding: 4px 12px; margin: 2px 0 10px; }
.authorized-line i { color: hsl(200, 100%, 35%); }
.footer-authorized { font-size: 0.88rem; font-weight: 600; opacity: 0.95; }
.footer-authorized i { margin-right: 6px; }

/* ---- Top bar: tidy icons on the new links ---- */
.site-topbar-links a i { margin-right: 5px; }
.site-topbar-contact strong { font-weight: 700; color: #1a1a1a; }

/* ---- Phone bottom bar ---- */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0);
}

.mobile-bottom-nav a {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 9px 4px 8px;
    min-height: 56px;
    color: #44506a;
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
}

.mobile-bottom-nav a i { font-size: 1.15rem; }
.mobile-bottom-nav a.active { color: hsl(200, 100%, 30%); }
.mobile-bottom-nav a.active::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: hsl(200, 100%, 35%); }
.mobile-bottom-nav a:focus-visible { outline: 3px solid #1a1a1a; outline-offset: -3px; }

.mobile-bottom-nav .cart-counter {
    position: absolute;
    top: 4px;
    left: calc(50% + 6px);
    font-size: 0.62rem;
    min-width: 18px;
    padding: 3px 5px;
}

@media (max-width: 991px) {
    body.has-bottom-nav { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
    /* keep toasts and the chat button clear of the bar */
    body.has-bottom-nav .toast { bottom: 84px; }
}

/* ---- WhatsApp chat button + topic menu (shown only when BUSINESS_WHATSAPP is set) ---- */
.wa-chat {
    position: fixed;
    right: 18px;
    bottom: 20px;
    z-index: 1040;
}
.wa-menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    width: min(300px, calc(100vw - 32px));
    background: #fff;
    color: #1a1a1a;
    border-radius: 16px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 14px 10px 10px;
    transform-origin: bottom right;
    animation: waMenuIn 0.16s ease-out;
}
.wa-menu[hidden] { display: none; }
@keyframes waMenuIn { from { opacity: 0; transform: translateY(6px) scale(0.97); } to { opacity: 1; transform: none; } }
.wa-menu-title { margin: 0 6px 2px; font-weight: 700; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }
.wa-menu-title .brand-icon { color: #1fa855; font-size: 1.15rem; }
.wa-menu-sub { margin: 0 6px 8px; font-size: 0.8rem; color: #555; }
.wa-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
}
.wa-menu-item:hover, .wa-menu-item:focus-visible { background: #eefaf2; color: inherit; }
.wa-menu-item:focus-visible { outline: 2px solid #1fa855; outline-offset: -2px; }
.wa-menu-item > i {
    flex: 0 0 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #e3f7ea;
    color: #128c4b;
    font-size: 0.9rem;
}
.wa-menu-item span { min-width: 0; display: flex; flex-direction: column; }
.wa-menu-item strong { font-size: 0.88rem; font-weight: 600; }
.wa-menu-item small {
    font-size: 0.76rem;
    color: #5c5c5c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.whatsapp-float {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #25d366;
    color: #fff;
    font-size: 1.8rem;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.whatsapp-float:hover { color: #fff; background: #1ebe5b; }
.whatsapp-float:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 3px; }

@media (max-width: 991px) {
    body.has-bottom-nav .wa-chat { bottom: 80px; right: 14px; }
    body.has-bottom-nav .whatsapp-float { width: 48px; height: 48px; font-size: 1.6rem; }
}

@media (prefers-reduced-motion: reduce) {
    .site-announce, .site-announce-inner.is-rotating .site-announce-item.is-current, .wa-menu { animation: none; transition: none; }
}
