/**
 * BookRivo CSS Module 02: Global Layout, Header, Navigation & Footer
 *
 * Top announcement bar, Header, Desktop Navigation & Dropdowns, Mobile Hamburger Drawer,
 * Collapsible Submenu Accordions, Mobile Bottom Bar, and Footer with co-located responsive rules.
 *
 * @package BookRivo
 * @since 1.0.0
 */
/* ==========================================================================
   TOP ANNOUNCEMENT BAR
   ========================================================================== */
.bookrivo-top-announcement {
  background-color: #f1f3ec;
  border-bottom: 1px solid #e7e9de;
  padding: 9px 12px;
  text-align: center;
  font-size: 11px;
  color: #345648;
}

.bookrivo-top-announcement strong {
  font-weight: 800;
}

/* ==========================================================================
   HEADER & NAVIGATION (MINIMAL SEARCH-FIRST DESIGN)
   ========================================================================== */
.bookrivo-header {
  background-color: var(--bookrivo-white);
  border-bottom: 1px solid var(--bookrivo-border, #e8e3d7);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(18, 55, 45, 0.04);
}

.header-main-row {
  display: grid;
  grid-template-columns: auto minmax(280px, 600px) auto;
  justify-content: space-between;
  gap: 28px;
  align-items: center;
  min-height: var(--bookrivo-header-height, 76px);
  padding-top: 8px;
  padding-bottom: 8px;
}

.bookrivo-branding {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.bookrivo-branding .custom-logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

.bookrivo-branding .custom-logo-link:focus:not(:focus-visible),
.footer-logo .custom-logo-link:focus:not(:focus-visible) {
  outline: none !important;
  box-shadow: none !important;
}

.bookrivo-branding .custom-logo-link:focus-visible,
.footer-logo .custom-logo-link:focus-visible {
  outline: 2px solid var(--bookrivo-forest, #12372d) !important;
  outline-offset: 4px;
  border-radius: 6px;
}

.bookrivo-branding .custom-logo-link img,
.bookrivo-branding img.custom-logo {
  max-width: var(--bookrivo-logo-width, 170px);
  max-height: 50px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.bookrivo-branding .bookrivo-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.bookrivo-brand-icon {
  width: 44px;
  height: 44px;
  background-color: var(--bookrivo-forest);
  color: #edd9b2;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
}

.bookrivo-brand-icon svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5;
}

.bookrivo-site-title {
  display: block;
  font-family: var(--bookrivo-font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--bookrivo-forest);
  line-height: 1.25;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.bookrivo-site-desc {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.8px;
  color: var(--bookrivo-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.bookrivo-header-search {
  max-width: 580px;
  width: 100%;
  margin: 0 auto;
}

.bookrivo-search-form {
  position: relative;
  display: flex;
  height: 42px;
  background-color: #f8f9f6;
  border: 1px solid #dce3d9;
  border-radius: 9px;
  overflow: hidden;
  align-items: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.bookrivo-search-form:focus-within {
  background-color: var(--bookrivo-white);
  border-color: var(--bookrivo-forest);
  box-shadow: 0 0 0 3px rgba(18, 55, 45, 0.08);
}

.bookrivo-search-form .search-icon {
  margin-left: 14px;
  color: #6c7d70;
  display: flex;
  align-items: center;
  pointer-events: none;
  flex-shrink: 0;
}

.bookrivo-search-form .search-icon svg {
  width: 17px;
  height: 17px;
}

.bookrivo-search-form .search-field {
  min-width: 0;
  flex: 1;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 12px;
  font-size: 13.5px;
  font-family: var(--bookrivo-font-body);
  color: var(--bookrivo-ink);
}

.bookrivo-search-form .search-field::placeholder {
  color: #7c8b80;
}

.bookrivo-search-form .search-submit {
  border: 0;
  background-color: var(--bookrivo-forest);
  color: var(--bookrivo-white);
  padding: 0 22px;
  height: 100%;
  font-size: 12.5px;
  font-weight: 700;
  font-family: var(--bookrivo-font-body);
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.bookrivo-search-form .search-submit:hover {
  background-color: var(--bookrivo-forest-light);
}

.bookrivo-header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.bookrivo-tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--bookrivo-forest);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 12px;
  min-height: 40px;
  font-size: 12.5px;
  font-weight: 600;
  position: relative;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.bookrivo-tool-btn:hover {
  background-color: #f4f7f2;
  border-color: #e2e8de;
  color: var(--bookrivo-forest);
}

.bookrivo-tool-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bookrivo-tool-btn .tool-icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bookrivo-tool-btn .tool-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bookrivo-ink);
  white-space: nowrap;
  line-height: 1.2;
}

.bookrivo-cart-btn .bookrivo-cart-count {
  position: absolute;
  top: -7px;
  right: -9px;
  background-color: var(--bookrivo-forest);
  color: var(--bookrivo-white);
  border: 2px solid var(--bookrivo-white);
  border-radius: 999px;
  font-family: var(--bookrivo-font-body);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.bookrivo-cart-btn .bookrivo-cart-count.has-items {
  background-color: var(--bookrivo-sale-red);
}

.bookrivo-mobile-trigger,
.mobile-search-toggle {
  display: none;
}

/* Primary Navigation Bar (Row 2) */
.bookrivo-primary-nav {
  border-top: 1px solid #eef1ea;
  background-color: var(--bookrivo-white);
}

.nav-inner-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
}

/* Primary Navigation Alignment */
.bookrivo-primary-nav.nav-align-left .nav-inner-row {
  justify-content: flex-start;
}
.bookrivo-primary-nav.nav-align-left .bookrivo-nav-menu {
  margin-right: auto;
  margin-left: 0;
  justify-content: flex-start;
}

.bookrivo-primary-nav.nav-align-center .nav-inner-row {
  justify-content: center;
}
.bookrivo-primary-nav.nav-align-center .bookrivo-nav-menu {
  margin: 0 auto;
  justify-content: center;
}

.bookrivo-primary-nav.nav-align-right .nav-inner-row {
  justify-content: flex-end;
}
.bookrivo-primary-nav.nav-align-right .bookrivo-nav-menu {
  margin-left: auto;
  margin-right: 0;
  justify-content: flex-end;
}

.bookrivo-nav-menu {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.bookrivo-nav-menu > li {
  position: relative;
}

.bookrivo-nav-menu > li > a {
  font-size: 13.5px;
  font-weight: 600;
  color: #2f4238;
  padding: 11px 0;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  position: relative;
  text-decoration: none;
  transition: color 0.18s ease;
}

.bookrivo-nav-menu > li > a:hover,
.bookrivo-nav-menu > li.current-menu-item > a,
.bookrivo-nav-menu > li.current-menu-ancestor > a,
.bookrivo-nav-menu > li.current_page_item > a {
  color: var(--bookrivo-forest);
}

/* Desktop Header Navigation Focus: suppress yellow rectangular box on mouse clicks; preserve accessible keyboard ring */
.bookrivo-primary-nav .bookrivo-nav-menu a:focus,
.bookrivo-primary-nav .bookrivo-nav-menu a:active {
  outline: none;
  box-shadow: none;
}

.bookrivo-primary-nav .bookrivo-nav-menu a:focus-visible {
  outline: 2px solid var(--bookrivo-forest);
  outline-offset: -2px;
  border-radius: 4px;
}

/* Active Menu Item Indicators */
.bookrivo-primary-nav.nav-indicator-gold-underline .bookrivo-nav-menu > li.current-menu-item > a::before,
.bookrivo-primary-nav.nav-indicator-gold-underline .bookrivo-nav-menu > li.current-menu-ancestor > a::before,
.bookrivo-primary-nav.nav-indicator-gold-underline .bookrivo-nav-menu > li.current_page_item > a::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background-color: var(--bookrivo-gold);
  border-radius: 2px 2px 0 0;
}

.bookrivo-primary-nav.nav-indicator-soft-pill .bookrivo-nav-menu > li > a {
  padding: 6px 12px;
  margin: 5px 0;
  border-radius: 6px;
}

.bookrivo-primary-nav.nav-indicator-soft-pill .bookrivo-nav-menu > li.current-menu-item > a,
.bookrivo-primary-nav.nav-indicator-soft-pill .bookrivo-nav-menu > li.current-menu-ancestor > a {
  background-color: #f2f6ef;
  color: var(--bookrivo-forest);
  font-weight: 700;
}

.bookrivo-primary-nav.nav-indicator-bold-text .bookrivo-nav-menu > li.current-menu-item > a,
.bookrivo-primary-nav.nav-indicator-bold-text .bookrivo-nav-menu > li.current-menu-ancestor > a {
  color: var(--bookrivo-gold);
  font-weight: 800;
}

/* Dropdown Menu Arrow Indicator */
.bookrivo-nav-menu li.menu-item-has-children > a::after {
  content: '';
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.bookrivo-nav-menu li.menu-item-has-children:hover > a::after,
.bookrivo-nav-menu li.menu-item-has-children:focus-within > a::after {
  transform: rotate(180deg);
}

/* Dropdown Sub-menus */
.bookrivo-nav-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--bookrivo-white);
  border: 1px solid var(--bookrivo-line);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(18, 55, 45, 0.12);
  padding: 8px 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 1000;
  pointer-events: none;
}

.bookrivo-nav-menu li:hover > .sub-menu,
.bookrivo-nav-menu li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.bookrivo-nav-menu .sub-menu li {
  position: relative;
  width: 100%;
  margin: 0;
  padding: 0;
}

.bookrivo-nav-menu .sub-menu li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--bookrivo-ink);
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.bookrivo-nav-menu .sub-menu li a:hover,
.bookrivo-nav-menu .sub-menu li.current-menu-item > a {
  background-color: #f4f7f2;
  color: var(--bookrivo-forest);
  font-weight: 600;
}

.bookrivo-nav-menu .sub-menu li.menu-item-has-children > a::after {
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 4px solid currentColor;
  border-right: 0;
  margin-left: 10px;
  transform: none;
}

/* 3rd Level Sub-menu */
.bookrivo-nav-menu .sub-menu .sub-menu {
  top: -4px;
  left: 100%;
  margin-left: 2px;
}


/* ==========================================================================
   FOOTER SOCIAL LINKS
   ========================================================================== */
.footer-social-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.footer-social-links .social-link {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #173d2d;
  color: #e2c58d;
  transition: all 0.2s ease;
  text-decoration: none;
}

.footer-social-links .social-link svg {
  width: 16px;
  height: 16px;
}

.footer-social-links .social-link:hover {
  background: var(--bookrivo-gold, #c79a57);
  color: #12372d;
  transform: translateY(-2px);
}

/* ==========================================================================
   FOOTER (CANONICAL PROTOTYPE)
   ========================================================================== */
.footer,
.bookrivo-footer {
  background: #10281f;
  color: #dce8dd;
  padding: 55px 0 28px;
}

.footer-logo {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.footer-logo .custom-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.footer-logo img.custom-logo {
  width: var(--bookrivo-footer-logo-width, 160px);
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.footer-logo.has-badge .custom-logo-link {
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: inline-flex;
}

.footer-logo.has-badge img.custom-logo {
  max-height: 48px;
}

.bookrivo-footer-brand-text {
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.2px;
}

.footer-tagline {
  color: #9cb1a4;
  font-size: 13px;
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 320px;
}

.footer-contact-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #b8cbbd;
  margin-bottom: 14px;
}

.footer-contact-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #e2c58d;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
}

.footer-contact-item:hover {
  color: #ffffff;
  text-decoration: underline;
}

.footer-contact-sep {
  color: rgba(255, 255, 255, 0.25);
}

.foot-cols,
.footer-content-row {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.1fr;
  gap: 40px;
}

.footer-col-title {
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0 0 16px;
}

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

.footer-nav-list li {
  margin: 0;
  padding: 0;
}

.foot-cols a.small-link,
.footer-links li a,
.footer-nav-list li a {
  display: block;
  color: #b8cbbd;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
  text-decoration: none;
  transition: color 0.15s ease;
}

.foot-cols a.small-link:hover,
.footer-links li a:hover,
.footer-nav-list li a:hover {
  color: #ffffff;
}

.footer-address-block {
  font-style: normal;
  font-size: 12.5px;
  line-height: 1.6;
  color: #b8cbbd;
}

.footer-office-title {
  color: #ffffff;
  font-weight: 600;
  margin: 0 0 6px;
}

.footer-office-address {
  margin: 0 0 8px;
  color: #9cb1a4;
}

.footer-delivery-note {
  margin: 0;
  font-size: 11.5px;
  color: #7b9986;
}

.foot-bottom,
.footer-bottom-row {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  margin-top: 42px;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
  color: #8aab97;
  gap: 16px;
}

.footer-copyright-text {
  color: #8faea0;
}

.footer-credit-text {
  color: #6d8e7d;
}

/* Mobile Fixed Bottom Navigation */
.bookrivo-mobile-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bookrivo-white);
  border-top: 1px solid #dce4d8;
  z-index: 95;
  height: calc(var(--bookrivo-mobile-nav-height, 56px) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.06);
  align-items: stretch;
  justify-content: space-around;
}

.bookrivo-bottom-item,
button.bookrivo-bottom-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 600;
  color: var(--bookrivo-muted);
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
}

.bookrivo-bottom-item.is-active {
  color: var(--bookrivo-forest);
  font-weight: 800;
}

.bookrivo-bottom-item svg {
  width: 20px;
  height: 20px;
}

.bookrivo-bottom-item .bookrivo-cart-count {
  position: absolute;
  top: 4px;
  right: calc(50% - 16px);
  background-color: var(--bookrivo-sale-red);
  color: var(--bookrivo-white);
  font-size: 9px;
  font-weight: 800;
  border-radius: 10px;
  padding: 1px 5px;
}

/* ==========================================================================
   MOBILE ADD-TO-CART SUCCESS TOAST & FLY-TO-CART ANIMATION
   ========================================================================== */
.bookrivo-mobile-cart-toast {
  display: none;
}

@media (max-width: 767px) {
  .bookrivo-mobile-cart-toast {
    display: inline-flex;
    position: fixed;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    left: 50%;
    transform: translateX(-50%) translateY(14px) scale(0.96);
    background: #12372d;
    color: #ffffff;
    padding: 10px 18px 10px 14px;
    border-radius: 9999px;
    box-shadow: 0 8px 24px rgba(18, 55, 45, 0.32), 0 2px 6px rgba(0, 0, 0, 0.12);
    align-items: center;
    gap: 10px;
    z-index: 99999;
    font-family: var(--bookrivo-font-bengali, 'Noto Sans Bengali', sans-serif);
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.1px;
    border: 1px solid rgba(199, 154, 87, 0.38);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
    white-space: nowrap;
    max-width: calc(100vw - 32px);
  }

  .bookrivo-mobile-cart-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
  }

  .bookrivo-mobile-cart-toast.is-fading {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px) scale(0.98);
  }

  .bookrivo-mobile-cart-toast .toast-icon {
    width: 22px;
    height: 22px;
    background: var(--bookrivo-gold, #c79a57);
    color: #12372d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .bookrivo-mobile-cart-toast .toast-icon svg {
    width: 13px;
    height: 13px;
    stroke: #12372d;
    stroke-width: 3;
  }

  .bookrivo-mobile-cart-toast .toast-msg {
    color: #f7f9f6;
    line-height: 1.2;
  }

  /* Fly-to-Cart Animation Badge */
  .bookrivo-cart-flyer {
    position: fixed;
    z-index: 100000;
    pointer-events: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #12372d;
    border: 1.5px solid var(--bookrivo-gold, #c79a57);
    box-shadow: 0 4px 12px rgba(18, 55, 45, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    will-change: transform, opacity;
    transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.25, 1), opacity 0.45s ease;
  }

  .bookrivo-cart-flyer svg {
    width: 14px;
    height: 14px;
    stroke: var(--bookrivo-gold, #c79a57);
    stroke-width: 2.8;
  }

  /* Target Cart Icon Pulse */
  .bookrivo-cart-pulse {
    animation: bookrivoCartPulse 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }

  @keyframes bookrivoCartPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.24); color: var(--bookrivo-gold, #c79a57); }
    100% { transform: scale(1); }
  }
}

@media (min-width: 768px) {
  .bookrivo-mobile-cart-toast,
  .bookrivo-cart-flyer {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bookrivo-mobile-cart-toast {
    transition: none !important;
    transform: translateX(-50%) !important;
  }
  .bookrivo-cart-flyer {
    display: none !important;
  }
  .bookrivo-cart-pulse {
    animation: none !important;
  }
}

/* ==========================================================================
   FLOATING ACTION CONTROLS (WhatsApp Support Button)
   ========================================================================== */
.whatsapp-sticky-icon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 90;
  width: var(--bookrivo-whatsapp-size, 54px);
  height: var(--bookrivo-whatsapp-size, 54px);
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35), 0 2px 6px rgba(0, 0, 0, 0.12);
  transition: bottom 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              right 0.28s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.2s ease,
              opacity 0.2s ease,
              visibility 0.2s ease,
              box-shadow 0.2s ease;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.whatsapp-sticky-icon:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45), 0 3px 8px rgba(0, 0, 0, 0.15);
}

.whatsapp-sticky-icon:active {
  transform: scale(0.96);
}

.whatsapp-sticky-icon svg {
  display: block;
  width: 32px;
  height: 32px;
  fill: #ffffff;
}

@media (max-width: 768px) {
  .whatsapp-sticky-icon {
    width: var(--bookrivo-whatsapp-size, 50px) !important;
    height: var(--bookrivo-whatsapp-size, 50px) !important;
    bottom: calc(
      var(--bookrivo-mobile-nav-height, 56px) +
      env(safe-area-inset-bottom, 0px) +
      var(--bookrivo-whatsapp-spacing-bottom, 20px)
    ) !important;
    right: var(--bookrivo-whatsapp-spacing-right, 16px) !important;
    z-index: 92 !important;
  }

  .whatsapp-sticky-icon svg {
    width: 28px !important;
    height: 28px !important;
  }

  /* Single Product Template: mobile navigation rail is hidden */
  body.single-product .whatsapp-sticky-icon {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Single Product with sticky purchase rail active */
  body.single-product.pdp-sticky-active .whatsapp-sticky-icon,
  body.pdp-sticky-active .whatsapp-sticky-icon {
    bottom: calc(78px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Campaign Landing Page with sticky bar active */
  body:has(.clp-mobile-sticky-bar.is-active) .whatsapp-sticky-icon,
  .clp-mobile-sticky-bar.is-active ~ .whatsapp-sticky-icon {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Layering & Drawer Obscurity Prevention:
   Hide floating WhatsApp button when any drawer, modal or overlay is active */
body.cart-drawer-open .whatsapp-sticky-icon,
body.drawer-open .whatsapp-sticky-icon,
body.is-drawer-open .whatsapp-sticky-icon,
body.bookrivo-filter-drawer-open .whatsapp-sticky-icon,
body:has(.bookrivo-cart-drawer.is-open) .whatsapp-sticky-icon,
body:has(.bookrivo-cart-drawer-overlay.is-visible) .whatsapp-sticky-icon,
body:has(.bookrivo-drawer.is-open) .whatsapp-sticky-icon,
body:has(.bookrivo-overlay.is-visible) .whatsapp-sticky-icon,
body:has(#bookrivoCartDrawer.is-open) .whatsapp-sticky-icon,
body:has(#bookrivoCartDrawerOverlay.is-visible) .whatsapp-sticky-icon,
.whatsapp-sticky-icon.drawer-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(0.7) translateY(16px) !important;
  transition: opacity 0.18s ease, visibility 0.18s ease, transform 0.18s ease !important;
}

/* ==========================================================================
   DRAWER & OVERLAY (CANONICAL PROTOTYPE)
   ========================================================================== */
.bookrivo-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(19, 45, 35, 0.55);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.bookrivo-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.bookrivo-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto;
  width: min(380px, 100%);
  background-color: var(--bookrivo-white);
  z-index: 99999;
  transform: translateX(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s;
  box-shadow: 0 0 50px rgba(18, 44, 29, 0.25);
  display: flex;
  flex-direction: column;
}

.bookrivo-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--bookrivo-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h3,
.drawer-header .drawer-header-title {
  margin: 0;
  font-family: var(--bookrivo-font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--bookrivo-forest);
}

.drawer-close-btn {
  background: #eef2ea;
  border: 0;
  color: var(--bookrivo-forest);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background 0.15s ease;
}

.drawer-close-btn:hover {
  background: #e1e7dc;
}

.drawer-content {
  padding: 18px 20px 30px;
  overflow-y: auto;
  flex: 1;
}

.mobile-search-panel {
  margin-bottom: 18px;
}

.mobile-search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.mobile-search-input {
  width: 100%;
  height: 44px;
  padding: 0 42px 0 14px;
  border: 1px solid #dfe5dc;
  border-radius: 8px;
  background: #f8f9f5;
  font-size: 13px;
  outline: none;
}

.mobile-search-input:focus {
  border-color: var(--bookrivo-gold);
}

.mobile-search-form button {
  position: absolute;
  right: 6px;
  background: none;
  border: 0;
  color: var(--bookrivo-forest);
  padding: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
}

.mobile-nav-links a {
  display: block;
  padding: 13px 4px;
  font-size: 14px;
  font-weight: 700;
  color: #24352d;
  border-bottom: 1px solid #f0f2ed;
  text-decoration: none;
  transition: color 0.15s ease;
}

.mobile-nav-links a:hover,
.mobile-nav-links li.current-menu-item > a,
.mobile-nav-links li.current-menu-item > .mobile-item-row > a {
  color: var(--bookrivo-gold);
}

.mobile-nav-links a.mobile-nav-account,
.mobile-nav-links a.mobile-nav-cart,
.mobile-nav-links a.mobile-nav-checkout {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-nav-links a.mobile-nav-account svg,
.mobile-nav-links a.mobile-nav-cart svg,
.mobile-nav-links a.mobile-nav-checkout svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--bookrivo-forest);
}

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

.mobile-menu-list li {
  position: relative;
}

.mobile-menu-list li a {
  display: block;
  padding: 13px 4px;
  font-size: 14px;
  font-weight: 700;
  color: #24352d;
  border-bottom: 1px solid #f0f2ed;
  text-decoration: none;
}

.mobile-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f0f2ed;
}

.mobile-item-row > a {
  flex: 1;
  border-bottom: 0 !important;
  padding-right: 12px !important;
}

.mobile-submenu-toggle {
  width: 38px;
  height: 38px;
  border: 0;
  background: #f4f6f1;
  color: var(--bookrivo-forest);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 6px;
  transition: background 0.18s ease, color 0.18s ease, transform 0.2s ease;
}

.mobile-submenu-toggle:hover,
.mobile-submenu-toggle[aria-expanded="true"] {
  background: var(--bookrivo-forest);
  color: #ffffff;
}

.mobile-submenu-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform 0.2s ease;
}

.mobile-submenu-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.mobile-menu-list .sub-menu {
  display: none;
  list-style: none;
  padding: 4px 0 4px 16px;
  margin: 0;
  background: #fbfcf9;
  border-bottom: 1px solid #f0f2ed;
}

.mobile-menu-list .sub-menu.is-expanded {
  display: block;
}

.mobile-menu-list .sub-menu li a {
  font-size: 13px;
  font-weight: 500;
  color: #55685c;
  padding: 9px 4px;
  border-bottom: 1px solid #f5f6f2;
}

.mobile-menu-list .sub-menu .mobile-item-row {
  border-bottom: 1px solid #f5f6f2;
}

.mobile-menu-list .sub-menu .mobile-submenu-toggle {
  width: 32px;
  height: 32px;
}

.mobile-drawer-divider {
  height: 1px;
  background: var(--bookrivo-line);
  margin: 16px 0 8px;
}

.mobile-nav-cart,
.mobile-nav-checkout {
  font-weight: 800 !important;
  color: var(--bookrivo-forest) !important;
}

.mobile-nav-checkout {
  color: #ba6549 !important;
}


/* ==========================================================================
   HEADER, NAVIGATION & FOOTER RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1200px) {
  .header-main-row {
    gap: 24px;
  }
}

@media (max-width: 1050px) {
  .header-main-row {
    gap: 18px;
    grid-template-columns: auto minmax(220px, 1fr) auto;
  }
  .bookrivo-nav-menu {
    gap: 22px;
  }
  .footer-content-row,
  .foot-cols {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header-main-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 62px;
    gap: 10px;
    padding-top: 6px;
    padding-bottom: 6px;
  }
  .bookrivo-branding {
    min-width: 0;
    flex-shrink: 1;
  }
  .bookrivo-branding .custom-logo-link img,
  .bookrivo-branding img.custom-logo {
    max-width: min(145px, var(--bookrivo-logo-width, 170px));
    max-height: 40px;
    width: auto;
    height: auto;
  }
  .bookrivo-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
  }
  .bookrivo-brand-icon svg {
    width: 22px;
    height: 22px;
  }
  .bookrivo-site-title {
    font-size: 16px;
    letter-spacing: -0.35px;
  }
  .bookrivo-site-desc {
    font-size: 6.5px;
    letter-spacing: 1.3px;
  }
  .bookrivo-header-search {
    display: none !important;
  }
  .bookrivo-header-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
  }
  .bookrivo-tool-btn,
  .bookrivo-mobile-trigger,
  .mobile-search-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--bookrivo-forest);
  }
  .bookrivo-tool-btn svg,
  .bookrivo-mobile-trigger svg,
  .mobile-search-toggle svg {
    width: 20px;
    height: 20px;
  }
  .bookrivo-tool-btn .tool-label {
    display: none !important;
  }
  .bookrivo-cart-btn .bookrivo-cart-count {
    top: -6px;
    right: -7px;
    min-width: 16px;
    height: 16px;
    font-size: 9.5px;
  }
  .desktop-only {
    display: none !important;
  }
  .bookrivo-primary-nav {
    display: none !important;
  }

  .footer,
  .bookrivo-footer {
    padding: 39px 0 80px;
  }
  .foot-cols,
  .footer-content-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 18px;
  }
  .foot-cols > div:first-child,
  .footer-content-row > div:first-child {
    grid-column: 1 / -1;
  }
  .foot-bottom,
  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .mobile-bottom,
  .bookrivo-mobile-bottom-bar {
    display: flex !important;
    align-items: stretch;
    justify-content: space-around;
  }
  body.single-product .mobile-bottom,
  body.single-product .bookrivo-mobile-bottom-bar {
    display: none !important;
  }
  body {
    padding-bottom: 60px;
  }
}

@media (max-width: 767px) {
  .footer,
  .bookrivo-footer {
    padding-top: 36px;
    padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
  .foot-cols,
  .footer-content-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 22px !important;
  }
  .footer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
  }
  .footer-logo {
    justify-content: center;
    margin-bottom: 12px;
  }
  .footer-logo.has-badge .custom-logo-link {
    padding: 6px 14px;
  }
  .footer-logo img.custom-logo {
    max-width: min(150px, var(--bookrivo-footer-logo-width, 160px));
    height: auto;
  }
  .footer-tagline {
    max-width: 320px;
    margin: 0 auto 12px;
    text-align: center;
    font-size: 12.5px;
    line-height: 1.5;
  }
  .footer-contact-info {
    justify-content: center;
    text-align: center;
    gap: 8px 12px;
    margin-bottom: 12px;
  }
  .footer-contact-item {
    justify-content: center;
  }
  .footer-social-links {
    justify-content: center;
    margin-top: 4px;
  }
  .footer-col-title {
    text-align: center;
    margin: 0 0 10px;
    font-size: 13.5px;
  }
  .foot-cols a.small-link,
  .footer-links li a,
  .footer-nav-list li a {
    text-align: center;
    margin-bottom: 8px;
    padding: 4px 12px;
    display: inline-block;
    font-size: 12.5px;
  }
  .footer-address-block {
    text-align: center;
  }
  .footer-office-title,
  .footer-office-address,
  .footer-delivery-note {
    text-align: center;
  }
  .foot-bottom,
  .footer-bottom-row {
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    margin-top: 24px;
    padding-top: 16px;
    gap: 6px;
  }
  .footer-copyright-text,
  .footer-credit-text {
    text-align: center;
    display: block;
  }
}

@media (max-width: 414px) {
  .bookrivo-branding .custom-logo-link img,
  .bookrivo-branding img.custom-logo {
    max-width: min(132px, var(--bookrivo-logo-width, 170px));
    max-height: 36px;
  }
  .bookrivo-site-title {
    font-size: 16px;
  }
  .bookrivo-site-desc {
    font-size: 7px;
  }
}

@media (max-width: 380px) {
  .header-main-row {
    gap: 8px;
    min-height: 58px;
  }
  .bookrivo-branding .custom-logo-link img,
  .bookrivo-branding img.custom-logo {
    max-width: min(122px, var(--bookrivo-logo-width, 170px));
    max-height: 34px;
  }
  .bookrivo-header-tools {
    gap: 3px;
  }
  .bookrivo-tool-btn,
  .bookrivo-mobile-trigger,
  .mobile-search-toggle {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
  }
  .bookrivo-site-title {
    font-size: 14px;
  }
  .bookrivo-site-desc {
    font-size: 6px;
  }
  .bookrivo-brand-icon {
    width: 34px;
    height: 34px;
  }
}

@media (max-width: 340px) {
  .header-main-row {
    gap: 6px;
    min-height: 56px;
  }
  .bookrivo-branding .custom-logo-link img,
  .bookrivo-branding img.custom-logo {
    max-width: 108px;
    max-height: 30px;
  }
  .bookrivo-header-tools {
    gap: 2px;
  }
  .bookrivo-tool-btn,
  .bookrivo-mobile-trigger,
  .mobile-search-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
  }
  .bookrivo-tool-btn svg,
  .bookrivo-mobile-trigger svg,
  .mobile-search-toggle svg {
    width: 19px;
    height: 19px;
  }
  .bookrivo-site-title {
    font-size: 13px;
  }
  .bookrivo-brand-icon {
    width: 32px;
    height: 32px;
  }
}