/* =============================================================
   InfoHub Store — site chrome
   Announcement bar, header (brand, search, support, account, cart),
   category navigation, popovers, footer and the WhatsApp button.
   Loaded on every page after base.css.
   ============================================================= */

:root { --ih-header-height: 121px; }

/* Announcement bar — the one dark strip of the page. */
.ih-topbar {
  background-color: hsl(var(--ih-foreground));
  color: hsl(0 0% 100%);
  font-size: 13px;
}

.ih-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding-top: 6px;
  padding-bottom: 6px;
  text-align: center;
}

.ih-topbar .ih-icon { color: hsl(var(--ih-primary)); filter: brightness(1.35); }

/* Header */
.ih-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: hsl(var(--ih-card));
  border-bottom: 1px solid hsl(var(--ih-border));
}

.admin-bar .ih-header { top: 32px; }

.ih-header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 72px;
}

.ih-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: hsl(var(--ih-foreground)) !important;
  text-decoration: none !important;
}

.ih-store .ih-brand__logo {
  display: block;
  width: auto;
  max-width: 190px;
  height: 40px;
  object-fit: contain;
  object-position: left center;
}

.ih-brand__initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background-color: hsl(var(--ih-primary));
  color: hsl(var(--ih-primary-foreground));
  font-size: 14px;
  font-weight: 700;
}

.ih-brand__name { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; }

/* Search */
.ih-header__search { flex: 1; min-width: 0; max-width: 560px; }

.ih-store .ih-header__search .woocommerce-product-search { position: relative; width: 100%; }

.ih-store .ih-header__search .search-field {
  height: 44px;
  padding: 0 16px 0 44px;
  border-color: transparent;
  border-radius: 9999px;
  background-color: hsl(var(--ih-muted));
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2375757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
  background-position: 16px center;
  background-size: 17px;
  background-repeat: no-repeat;
}

.ih-store .ih-header__search .search-field:focus {
  border-color: hsl(var(--ih-ring));
  background-color: hsl(var(--ih-card));
}

/* Enter submits; the button stays available to assistive technology. */
.ih-store .ih-header__search button {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Actions */
.ih-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.ih-header-action {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: hsl(var(--ih-foreground)) !important;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.ih-header-action:hover,
.ih-header-action[aria-expanded="true"] { background-color: hsl(var(--ih-accent)); }

.ih-header-action__text { display: flex; flex-direction: column; line-height: 1.25; }
.ih-header-action__text small { color: hsl(var(--ih-muted-foreground)); font-size: 11px; }

.ih-header-action__text strong {
  max-width: 150px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ih-header-action > .ih-icon:last-child { color: hsl(var(--ih-muted-foreground)); transition: transform 150ms ease; }
.ih-header-action[aria-expanded="true"] > .ih-icon:last-child { transform: rotate(180deg); }

.ih-cart-link__icon { position: relative; display: inline-flex; }

.ih-cart-count {
  position: absolute;
  top: -8px;
  right: -9px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 2px solid hsl(var(--ih-card));
  border-radius: 9999px;
  background-color: hsl(var(--ih-cart));
  color: hsl(var(--ih-cart-foreground));
  font-size: 10px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

.ih-cart-count.is-empty { display: none; }

.ih-secure {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: hsl(var(--ih-muted-foreground));
  font-size: 13px;
  font-weight: 500;
}

/* Popovers (support, account, all categories) */
.ih-popover { position: relative; }

.ih-popover__panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 300px;
  padding: 12px;
  border: 1px solid hsl(var(--ih-border));
  border-radius: 14px;
  background-color: hsl(var(--ih-card));
  box-shadow: 0 16px 40px rgb(15 23 42 / 0.14);
  animation: ih-popover-in 140ms ease-out;
}

.ih-popover__panel[hidden] { display: none; }
.ih-popover__panel--end { right: 0; left: auto; }
.ih-popover__panel--wide { width: min(720px, calc(100vw - 32px)); padding: 16px; }

@keyframes ih-popover-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ih-popover__title { margin: 4px 4px 2px !important; font-size: 14px; font-weight: 600; }
.ih-popover__text { margin: 0 4px 8px !important; color: hsl(var(--ih-muted-foreground)); font-size: 13px; }

.ih-popover__item,
.ih-popover__link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 10px;
  color: hsl(var(--ih-foreground)) !important;
  text-decoration: none !important;
}

a.ih-popover__item:hover,
.ih-popover__link:hover { background-color: hsl(var(--ih-accent)); }

.ih-popover__item > span:last-child { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.ih-popover__item small { color: hsl(var(--ih-muted-foreground)); font-size: 11px; }
.ih-popover__item strong { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; }

.ih-popover__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background-color: hsl(var(--ih-primary) / 0.1);
  color: hsl(var(--ih-primary));
}

.ih-popover__icon--whatsapp { background-color: hsl(142 70% 45% / 0.12); color: hsl(142 72% 32%); }

.ih-popover__link { font-size: 14px; font-weight: 500; }
.ih-popover__link .ih-icon { color: hsl(var(--ih-muted-foreground)); }
.ih-popover__link--danger,
.ih-popover__link--danger .ih-icon { color: hsl(var(--ih-destructive)) !important; }

.ih-popover__panel .ih-btn + .ih-btn { margin-top: 4px; }

/* Category navigation */
.ih-catnav { border-top: 1px solid hsl(var(--ih-border)); }

.ih-catnav__inner {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
}

.ih-catnav__trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 9999px;
  background-color: hsl(var(--ih-primary) / 0.1);
  color: hsl(var(--ih-primary));
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.ih-catnav__trigger:hover,
.ih-catnav__trigger[aria-expanded="true"] { background-color: hsl(var(--ih-primary) / 0.16); }

/* One line of whole items: a category that does not fit wraps to a hidden
   second line instead of being cut. "Todas as categorias" lists them all. */
.ih-catnav__list {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 2px;
  min-width: 0;
  height: 34px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
}

.ih-catnav__list > li { display: flex; align-items: center; height: 34px; }

.ih-catnav__list a {
  display: block;
  padding: 7px 12px;
  border-radius: 8px;
  color: hsl(240 5% 34%);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.ih-catnav__list a:hover { background-color: hsl(var(--ih-accent)); color: hsl(var(--ih-foreground)); text-decoration: none; }

.ih-catnav__list .is-current > a,
.ih-catnav__list .current-menu-item > a { background-color: hsl(var(--ih-accent)); color: hsl(var(--ih-foreground)); }

.ih-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ih-category-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  color: hsl(var(--ih-foreground));
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.ih-category-grid a:hover { background-color: hsl(var(--ih-accent)); text-decoration: none; }
.ih-category-grid small { color: hsl(var(--ih-muted-foreground)); font-size: 12px; font-weight: 400; }

.ih-category-grid__all {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 10px 12px 2px;
  border-top: 1px solid hsl(var(--ih-border));
  font-size: 13px;
  font-weight: 600;
}

/* Footer — four even columns (store, support, links, payment), then the
   social networks centred across the full width. */
.ih-footer {
  margin-top: 24px;
  background-color: hsl(var(--ih-card));
  border-top: 1px solid hsl(var(--ih-border));
  font-size: 13px;
}

.ih-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.25fr) minmax(0, 0.8fr) minmax(0, 1fr);
  gap: 40px;
  padding-top: 44px;
  padding-bottom: 36px;
}

.ih-store .ih-footer__brand .ih-brand__logo { height: 42px; max-width: 210px; }

.ih-footer__about {
  max-width: 340px;
  margin: 16px 0 0 !important;
  color: hsl(var(--ih-muted-foreground));
  line-height: 1.6;
}

.ih-footer__col { min-width: 0; }

.ih-store .ih-footer__heading {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
}

/* Support channels: icon, small label, value. */
.ih-footer__channels,
.ih-footer__links,
.ih-footer__socials {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ih-footer__channels { display: flex; flex-direction: column; gap: 12px; }
.ih-footer__channels li { display: flex; align-items: flex-start; gap: 10px; }

.ih-footer__channel-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background-color: hsl(var(--ih-muted));
  color: hsl(var(--ih-muted-foreground));
}

.ih-footer__channel-icon--whatsapp { background-color: hsl(142 70% 45% / 0.12); color: hsl(142 72% 32%); }

.ih-footer__channel-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; overflow-wrap: anywhere; }
.ih-footer__channel-copy small { color: hsl(var(--ih-muted-foreground)); font-size: 11px; }
.ih-footer__channel-copy a,
.ih-footer__channel-copy > span { color: hsl(var(--ih-foreground)); font-weight: 500; }
.ih-footer__channel-copy a:hover { color: hsl(var(--ih-primary)); text-decoration: none; }

.ih-footer__links { display: flex; flex-direction: column; gap: 9px; }
.ih-footer__links a { color: hsl(var(--ih-muted-foreground)); }
.ih-footer__links a:hover { color: hsl(var(--ih-foreground)); text-decoration: none; }

/* Payment methods and security seal. */
.ih-footer__badges { display: flex; flex-wrap: wrap; gap: 8px; }

.ih-footer__badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid hsl(var(--ih-border));
  border-radius: 8px;
  color: hsl(var(--ih-foreground));
  font-size: 12px;
  font-weight: 600;
}

.ih-footer__badge--pix .ih-icon { color: #32bcad; }

.ih-footer__seal { display: flex; align-items: center; gap: 10px; margin-top: 18px; color: hsl(142 72% 29%); }
.ih-footer__seal p { display: flex; flex-direction: column; margin: 0; line-height: 1.2; }
.ih-footer__seal small { color: hsl(var(--ih-muted-foreground)); font-size: 10px; }
.ih-footer__seal strong { color: hsl(var(--ih-foreground)); font-size: 13px; font-weight: 700; }

/* Social networks: one centred row that takes any number of icons. */
.ih-footer__social-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 16px;
  padding: 20px 0;
  border-top: 1px solid hsl(var(--ih-border));
}

.ih-footer__social-label { color: hsl(var(--ih-muted-foreground)); font-weight: 500; }

.ih-footer__socials { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

.ih-footer__socials a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: hsl(var(--ih-muted));
  color: hsl(var(--ih-foreground));
  transition: background-color 150ms ease, color 150ms ease;
}

.ih-footer__socials a:hover {
  background-color: hsl(var(--ih-primary));
  color: hsl(var(--ih-primary-foreground));
}

.ih-footer__bar { border-top: 1px solid hsl(var(--ih-border)); }

.ih-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 24px;
  padding-top: 16px;
  padding-bottom: 16px;
  color: hsl(var(--ih-muted-foreground));
  font-size: 12px;
  text-align: center;
}

.ih-store .ih-footer__legal { margin: 0; }

.ih-footer__nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.ih-footer__nav a { color: hsl(var(--ih-muted-foreground)); }
.ih-footer__nav a:hover { color: hsl(var(--ih-foreground)); text-decoration: none; }

.ih-footer--compact { margin-top: 0; }

/* Floating buttons: cart above WhatsApp, bottom right on every screen. */
.ih-fabs {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ih-fab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transition: transform 150ms ease;
}

.ih-fab:hover { transform: scale(1.06); text-decoration: none; }

.ih-whatsapp-fab {
  background-color: #25d366;
  color: #fff !important;
  box-shadow: 0 8px 24px rgb(37 211 102 / 0.4);
}

.ih-cart-fab {
  background-color: hsl(var(--ih-cart));
  color: hsl(var(--ih-cart-foreground)) !important;
  box-shadow: 0 8px 24px hsl(var(--ih-cart) / 0.35);
}

.ih-cart-fab .ih-cart-count {
  top: -2px;
  right: -2px;
  min-width: 22px;
  height: 22px;
  border-color: hsl(var(--ih-cart));
  background-color: hsl(var(--ih-card));
  color: hsl(var(--ih-foreground));
  font-size: 11px;
  line-height: 18px;
}

/* Responsive */
@media (max-width: 1100px) {
  .ih-header-action__text { display: none; }
  .ih-header-action > .ih-icon:last-child { display: none; }
  .ih-header-action { padding: 0 10px; }
}

@media (max-width: 782px) {
  .admin-bar .ih-header { top: 0; }
}

@media (max-width: 768px) {
  :root { --ih-header-height: 0px; }

  .ih-header { position: relative; }

  .ih-header__inner {
    flex-wrap: wrap;
    gap: 0 8px;
    height: auto;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .ih-store .ih-brand__logo { max-width: 150px; height: 32px; }

  .ih-header__search {
    flex: 1 0 100%;
    order: 3;
    max-width: none;
    margin-top: 10px;
  }

  .ih-header-action { height: 40px; padding: 0 8px; }

  /* Panels open under the whole header instead of next to the trigger. */
  .ih-popover { position: static; }

  .ih-popover__panel,
  .ih-popover__panel--end,
  .ih-popover__panel--wide {
    top: 100%;
    right: 12px;
    left: 12px;
    width: auto;
    margin-top: 4px;
  }

  .ih-catnav__inner { height: 46px; }

  /* Touch screens scroll the categories sideways. */
  .ih-catnav__list { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .ih-catnav__list::-webkit-scrollbar { display: none; }
  /* Every category visible at once, in two columns: no hidden scrolling
     inside the panel — the page itself scrolls if the list is long. */
  .ih-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 4px; }
  .ih-category-grid a { padding: 10px; font-size: 13px; line-height: 1.3; }
  .ih-category-grid small { display: none; }

  .ih-footer__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px 20px; padding-top: 32px; padding-bottom: 28px; }
  .ih-footer__brand,
  .ih-footer__brand + .ih-footer__col { grid-column: 1 / -1; }

  .ih-fabs { right: 16px; bottom: 16px; gap: 10px; }
  .ih-fab { width: 52px; height: 52px; }
}


/* Category menu allowed to wrap (Loja › Menu): every category stays visible. */
@media (min-width: 769px) {
  .ih-catnav--wrap .ih-catnav__inner { align-items: flex-start; height: auto; padding-top: 7px; padding-bottom: 7px; }
  .ih-catnav--wrap .ih-catnav__list { height: auto; overflow: visible; gap: 2px; }
}

/* Phones: only the "Todas as categorias" button, full width; the header
   panels open right under the logo row, over the search field. */
@media (max-width: 768px) {
  .ih-header__inner { position: relative; }

  .ih-header__inner .ih-popover__panel,
  .ih-header__inner .ih-popover__panel--end { top: 54px; right: var(--ih-gutter); left: var(--ih-gutter); margin-top: 0; }

  .ih-catnav__inner { position: relative; }
  .ih-catnav__all { flex: 1; }
  .ih-catnav__trigger { justify-content: center; width: 100%; height: 38px; }
  .ih-catnav__all ~ .ih-catnav__list { display: none; }
  .ih-catnav__inner .ih-popover__panel { right: var(--ih-gutter); left: var(--ih-gutter); }
}

/* Categories as pills: light border, clearly clickable. */
.ih-catnav__list { gap: 0 8px; height: 36px; }
.ih-catnav__list > li { height: 36px; }

.ih-catnav__list a {
  padding: 6px 14px;
  border: 1px solid hsl(var(--ih-border));
  border-radius: 9999px;
  background-color: hsl(var(--ih-card));
  font-size: 13px;
  line-height: 1.4;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.ih-catnav__list a:hover {
  border-color: hsl(var(--ih-primary) / 0.5);
  background-color: hsl(var(--ih-primary) / 0.08);
  color: hsl(var(--ih-foreground));
}

.ih-catnav__list .is-current > a,
.ih-catnav__list .current-menu-item > a {
  border-color: hsl(var(--ih-primary));
  background-color: hsl(var(--ih-primary) / 0.1);
  color: hsl(var(--ih-primary));
}

.ih-catnav__inner { gap: 8px; height: 52px; }

/* Wrapping menu: the button and the pills share one flow, so the following
   lines start at the left edge, under "Todas as categorias". */
@media (min-width: 769px) {
  .ih-catnav--wrap .ih-catnav__inner { flex-wrap: wrap; align-items: center; gap: 8px; height: auto; padding-top: 9px; padding-bottom: 9px; }
  .ih-catnav--wrap .ih-catnav__list { display: contents; }
  .ih-catnav--wrap .ih-catnav__list > li { height: auto; }
}
