/*
 * Makerique Boutique theme for OpenCart 4
 * Copyright (c) 2026 Heliopsy. All Rights Reserved.
 * https://makerique.com
 * SPDX-License-Identifier: LicenseRef-Proprietary
 * Proprietary and confidential. Unauthorized copying, distribution, or
 * modification of this file, by any means, is strictly prohibited.
 */

/* =========================================================================
   Makerique Boutique — Header, Navigation & Footer components
   Layout/structure ONLY. Colours, fonts, radius, shadow all come from the
   --mr-* tokens defined in makerique.css (do not redefine them here).
   Base header/footer colour rules live in makerique.css §4/§9.
   ========================================================================= */

/* ---- Page container -------------------------------------------------- */
/* OpenCart's core stylesheet.css ships `#container { position:absolute;
   min-height:100%; margin-bottom:300px }`. That stray 300px margin created dead
   scrollable space below the footer (you could scroll past the page end), and
   the absolute positioning takes the whole page out of flow for no benefit.
   Restore normal document flow so the body ends at the footer. */
#container {
  position: static;
  min-height: 0;
  margin-bottom: 0;
}

/* ---- Utility top bar ------------------------------------------------- */
.mr-topbar {
  background: var(--mr-surface-2);
  border-bottom: 1px solid var(--mr-border);
  font-size: .85rem;
}
.mr-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
}
.mr-topbar-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0;
}
.mr-topbar-links .dropdown-toggle { color: var(--mr-text); }
.mr-topbar-links .dropdown-toggle:hover { color: var(--mr-primary); }
.mr-topbar-note a { color: var(--mr-text); }
.mr-topbar-note a:hover { color: var(--mr-primary); }
.mr-topbar #form-currency,
.mr-topbar #form-language { margin: 0; }

/* ---- Main header ----------------------------------------------------- */
.mr-header { padding: 1rem 0; }
.mr-header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.mr-nav-toggle {
  background: transparent;
  border: 1px solid var(--mr-border-strong);
  border-radius: var(--mr-radius-sm);
  color: var(--mr-heading);
  width: 46px;
  height: 46px;
  font-size: 1.25rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--mr-transition), color var(--mr-transition);
}
.mr-nav-toggle:hover { background: var(--mr-surface-2); color: var(--mr-primary); }

.mr-logo { flex: 0 0 auto; margin: 0; }
.mr-logo img { max-height: var(--mr-logo-max, 56px); width: auto; max-width: 100%; height: auto; }
.mr-logo-text {
  font-family: var(--mr-font-heading);
  font-weight: 600;
  font-size: 1.75rem;
  color: var(--mr-heading);
  letter-spacing: -.01em;
}
/* The text logo is an <a>, so without this it inherits the generic a:hover link
   colour and the wordmark flips to the (often bright) link-hover colour on hover.
   Keep the brand wordmark its heading colour on hover/focus instead. */
.mr-logo-text:hover,
.mr-logo-text:focus { color: var(--mr-heading); }

/* Search — override OC's default input-group mb-3 spacing */
.mr-header-search { flex: 1 1 auto; max-width: 560px; }
.mr-header-search .input-group { margin-bottom: 0 !important; }
.mr-header-search .form-control {
  border-right: 0;
  border-radius: var(--mr-radius-pill) 0 0 var(--mr-radius-pill);
}
.mr-header-search .btn {
  border-radius: 0 var(--mr-radius-pill) var(--mr-radius-pill) 0;
  border: 1px solid var(--mr-border-strong);
  border-left: 0;
  background: var(--mr-surface-2);
  color: var(--mr-heading);
}
.mr-header-search .btn:hover { background: var(--mr-primary); color: #fff; border-color: var(--mr-primary); }
.mr-header-search--mobile { max-width: none; margin-top: .9rem; }

/* Actions: account / wishlist / cart */
.mr-header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: .35rem;
  margin-left: auto;
}
.mr-action {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-width: 46px;
  min-height: 46px;
  padding: 0 .6rem;
  justify-content: center;
  color: var(--mr-heading);
  font-size: 1.15rem;
  border-radius: var(--mr-radius-sm);
  transition: background var(--mr-transition), color var(--mr-transition);
}
.mr-action:hover { background: var(--mr-surface-2); color: var(--mr-primary); }
.mr-action-label { font-size: .95rem; font-weight: 500; }
.mr-account .dropdown-menu { border-radius: var(--mr-radius-sm); border-color: var(--mr-border); box-shadow: var(--mr-shadow); }

/* Cart module button — restyle OC's btn-dark to fit the boutique */
.mr-header-cart .btn,
.mr-header-cart .btn-dark {
  background: var(--mr-primary);
  border-color: var(--mr-primary);
  color: #fff;
  border-radius: var(--mr-radius-pill);
  padding: .55rem 1.05rem;
  font-size: .95rem;
}
.mr-header-cart .btn:hover,
.mr-header-cart .btn-dark:hover { background: var(--mr-primary-600); border-color: var(--mr-primary-600); }
.mr-header-cart .dropdown-menu { border-radius: var(--mr-radius); border-color: var(--mr-border); box-shadow: var(--mr-shadow); min-width: 300px; }

/* ---- Primary navigation --------------------------------------------- */
.mr-menu {
  background: var(--mr-surface);
  border-top: 1px solid var(--mr-border);
  border-bottom: 1px solid var(--mr-border);
  padding: 0;
}
.mr-menu-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  margin: 0;
}
.mr-menu .nav-link {
  font-family: var(--mr-font-nav);
  font-weight: 500;
  color: var(--mr-heading);
  padding: .85rem 1rem;
  position: relative;
}
.mr-menu .nav-link:hover,
.mr-menu .nav-item.dropdown:hover > .nav-link { color: var(--mr-primary); }

/* Override OpenCart core #menu (blue, ID-selector) — needs id-level specificity */
#menu.mr-menu {
  background: var(--mr-surface);
  border-top: 1px solid var(--mr-border);
  border-bottom: 1px solid var(--mr-border);
  min-height: 0;
}
#menu.mr-menu .nav-link,
#menu .navbar-nav > li > a { color: var(--mr-heading); background: transparent; }
#menu.mr-menu .nav-link:hover,
#menu .navbar-nav > li > a:hover,
#menu .navbar-nav > li > a:focus { color: var(--mr-primary); background: transparent; }
.mr-menu-dropdown {
  border-radius: var(--mr-radius-sm);
  border-color: var(--mr-border);
  box-shadow: var(--mr-shadow);
  padding: .5rem;
  min-width: 240px;
}
.mr-menu-dropdown .dropdown-item { border-radius: var(--mr-radius-sm); padding: .5rem .8rem; }
.mr-menu-dropdown .dropdown-item:hover { background: var(--mr-surface-2); color: var(--mr-primary); }
.mr-menu-all { font-weight: 600; color: var(--mr-primary); }

/* Off-canvas panel (mobile) */
.mr-menu-panel { background: var(--mr-surface); }
.mr-menu-panel .offcanvas-header { border-bottom: 1px solid var(--mr-border); }
.mr-menu-panel .offcanvas-title { font-family: var(--mr-font-heading); color: var(--mr-heading); }
@media (max-width: 991.98px) {
  .mr-menu { border: 0; background: transparent; }
  .mr-menu-panel { width: min(84vw, 340px); }
  .mr-menu-panel .nav-link { padding: .8rem .25rem; border-bottom: 1px solid var(--mr-border); }
  .mr-menu-panel .dropdown-menu {
    border: 0; box-shadow: none; padding: 0 0 .5rem .75rem;
    background: transparent;
  }
  .mr-menu-panel .dropdown-toggle::after { float: right; margin-top: .6rem; }
}

/* ---- Footer ---------------------------------------------------------- */
/* OpenCart core stylesheet.css sets `footer { position: absolute }` (demo-theme
   leftover) — it floats up and overlaps content on short pages (e.g. an empty
   category). Force normal flow so the footer always sits below the content. */
.mr-footer { position: static; padding-top: 3rem; }

/* Brand / about blurb (admin-controlled, ADMIN.md footer) */
.mr-footer-brand {
  padding-bottom: 1.75rem;
  margin-bottom: 1.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.mr-footer-about {
  color: var(--mr-footer-text, #C9BEB0);
  font-size: .95rem;
  line-height: 1.6;
  max-width: 62ch;
  margin: 0;
}

.mr-footer-cols { padding-bottom: 2rem; }
.mr-footer-links { margin: 0; }
.mr-footer-links li { margin-bottom: .5rem; }
.mr-footer-links a { font-size: .95rem; }

.mr-footer-nl-heading {
  color: var(--mr-footer-heading, #E9E1D7);
  font-family: var(--mr-font-heading);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: .35rem;
}
.mr-footer-blurb { color: var(--mr-footer-text, #C9BEB0); font-size: .92rem; margin-bottom: 1rem; }
.mr-footer-subscribe { margin-bottom: 1rem; }
.mr-footer-wishlink { display: inline-block; margin-left: 1rem; font-size: .92rem; }
.mr-footer-wishlink i { color: var(--mr-primary); }

.mr-footer-social { display: flex; gap: .6rem; margin-top: 1.1rem; }
.mr-footer-social a {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mr-radius-pill);
  background: rgba(255, 255, 255, .08);
  color: var(--mr-footer-heading, #E9E1D7);
  font-size: 1.05rem;
  transition: background var(--mr-transition), color var(--mr-transition);
}
.mr-footer-social a:hover { background: var(--mr-accent); color: var(--mr-heading); }

.mr-footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
}
.mr-footer-copyright { color: var(--mr-footer-text, #C9BEB0); font-size: .9rem; }
.mr-footer-pay i { color: var(--mr-accent); margin-right: .35rem; }

@media (max-width: 767.98px) {
  .mr-footer-bottom-inner { justify-content: center; text-align: center; }
  .mr-footer-pay-methods { justify-content: center; }
}

/* Mobile header fit — the actions row used to overflow the viewport because the
   cart button rendered its full "0 item(s) - $0.00" text. Collapse the cart to
   an icon and tighten spacing so the header stays within screen width. */
@media (max-width: 991.98px) {
  /* Visually hide the cart's "0 item(s)" text but KEEP it in the accessibility
     tree, so the icon-only button still has an accessible name (display:none
     would strip the name and fail the a11y audit). */
  .mr-cart-toggle-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
  }
  /* Icon-only on mobile. The cart button lives in `.mr-cart.d-grid`, which
     stretches it to fill the container (that is why it stayed wide and pushed
     the actions row off the right edge). Undo the grid stretch so the button
     sizes to its icon, drop the dropdown caret, and tighten padding. */
  .mr-cart-toggle.dropdown-toggle::after { display: none; }
  #cart .mr-cart { display: inline-block; }
  #cart .mr-cart-toggle { padding-left: .6rem; padding-right: .6rem; }
  .mr-header-actions { gap: .35rem; min-width: 0; }
  .mr-header-actions .mr-header-cart { min-width: 0; }
}
@media (max-width: 575.98px) {
  .mr-header-inner { gap: .6rem; }
  .mr-logo-text { font-size: 1.4rem; }
  .mr-header-actions { margin-left: auto; }
}

/* Top-bar Login / Register links (hdr_show_auth) */
.mr-topbar-end { display: flex; align-items: center; gap: 1.25rem; margin-left: auto; }
.mr-topbar-auth { display: flex; gap: 1rem; margin: 0; padding: 0; }
.mr-topbar-auth a { color: var(--mr-text); text-decoration: none; font-weight: 600; }
.mr-topbar-auth a:hover, .mr-topbar-auth a:focus-visible { color: var(--mr-primary); }
.mr-topbar-auth i { margin-right: .3em; color: var(--mr-primary); }
