/* =====================================================================
   MassDekor custom header / menu
   Namespaced (.md-*) so it can replace the theme menu without collisions.
   ===================================================================== */
@font-face {
	font-family: "Source Sans Pro";
	src: url("../assets/fonts/source-sans/SourceSans3-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Source Sans Pro";
	src: url("../assets/fonts/source-sans/SourceSans3-SemiBold.woff2") format("woff2");
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Source Sans Pro";
	src: url("../assets/fonts/source-sans/SourceSans3-Bold.woff2") format("woff2");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Source Sans Pro";
	src: url("../assets/fonts/source-sans/SourceSans3-Italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}

:root {
  --md-accent: #ee9f22;
  --md-accent-dark: #d98b14;
  --md-ink: #2c2c2c;
  --md-ink-soft: #5a5a5a;
  --md-line: #ececec;
  --md-topbar: #b85835;
  --md-radius: 12px;
  --md-shadow: 0 18px 40px -12px rgba(28, 28, 28, 0.22);
  --md-ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* keep border-box scoped to our components only */
.md-custom-navigation,
.md-custom-navigation *,
.md-drawer,
.md-drawer *,
.md-overlay,
.md-topbar { box-sizing: border-box; }

.md-topbar {
  display: block;
  background: var(--md-topbar);
  color: #fff;
  text-align: center;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.55;
  padding: 18px 12px;
  min-height: 38px;
  height: auto;
}

.md-topbar-inner {
  display: block;
  color: #fff;
}


/* ===============================
   Header
   =============================== */
.md-custom-sticky-wrapper { height: auto !important; }

.md-custom-navigation {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  transition: box-shadow .35s var(--md-ease), border-color .35s var(--md-ease);
}

/* shadow appears once the page is scrolled */
.md-custom-navigation.is-scrolled {
  box-shadow: 0 6px 24px -10px rgba(0, 0, 0, 0.18);
  border-bottom-color: var(--md-line);
}

.md-custom-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 88px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.md-custom-logo {
  flex: 0 0 auto;
  line-height: 0;
  margin-right: auto;
}

.md-custom-logo a { display: inline-flex; align-items: center; }

.md-custom-logo img,
.md-custom-logo-img {
  display: block;
  width: auto;
  height: auto;
  max-width: 150px;
  max-height: 70px;
  object-fit: contain;
}

/* ===============================
   Desktop menu
   =============================== */
.md-custom-menu,
.md-custom-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.md-custom-menu {
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.md-custom-menu > li { position: relative; display: flex; }

.md-custom-menu > li > a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 88px;
  padding: 0 18px;
  color: var(--md-ink);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1px;
  text-decoration: none;
  line-height: 1.2;
  white-space: nowrap;
  transition: color .25s ease;
}

.md-custom-menu > li > a:hover,
.md-custom-menu > li.current-menu-item > a,
.md-custom-menu > li.current_page_item > a,
.md-custom-menu > li.current-menu-ancestor > a { color: var(--md-accent); }

.menu-arrow {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  margin-top: 1px;
  color: inherit;
  transition: transform .3s var(--md-ease);
}

.md-custom-menu > li:hover > a .menu-arrow,
.md-custom-menu > li:focus-within > a .menu-arrow { transform: rotate(180deg); }

/* ---- dropdown card ---- */
.md-custom-menu .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 248px;
  background: #fff;
  border-radius: 0 0 var(--md-radius) var(--md-radius);
  box-shadow: var(--md-shadow);
  padding: 10px;
  z-index: 2000;

  /* animation */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .26s var(--md-ease),
              transform .26s var(--md-ease),
              visibility 0s linear .26s;
}

/* invisible hover bridge so the menu doesn't flicker on the gap */
.md-custom-menu .sub-menu::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

/* orange bar that fills across the dropdown's top edge */
.md-custom-menu .sub-menu::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--md-accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .4s var(--md-ease);
}

.md-custom-menu > li:hover > .sub-menu,
.md-custom-menu > li:focus-within > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(2px);
  transition: opacity .26s var(--md-ease),
              transform .26s var(--md-ease),
              visibility 0s linear 0s;
}

/* fill the bar a beat after the panel appears */
.md-custom-menu > li:hover > .sub-menu::after,
.md-custom-menu > li:focus-within > .sub-menu::after {
  transform: scaleX(1);
  transition-delay: .14s;
}

.md-custom-menu .sub-menu li { position: relative; }

.md-custom-menu .sub-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 8px;
  color: var(--md-ink-soft);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, background .2s ease, padding-left .2s var(--md-ease);
}

.md-custom-menu .sub-menu a:hover {
  color: var(--md-accent-dark);
  background: #fbf3e3;
  padding-left: 20px;
}

/* language flags */
.wpml-ls-menu-item > a { gap: 9px; }
.wpml-ls-flag {
  width: 22px;
  height: auto;
  display: inline-block;
  vertical-align: middle;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06);
}
.wpml-ls-native { display: inline-block; }

/* ===============================
   Cart
   =============================== */
.md-custom-cart {
  flex: 0 0 auto;
  position: relative;
  margin-left: 10px;
}

.md-cart-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  color: var(--md-ink);
  text-decoration: none;
  font-size: 21px;
  line-height: 1;
  transition: background .25s ease, transform .25s var(--md-ease);
}

.md-cart-link:hover { background: #f4f4f4; transform: translateY(-1px); }

.md-cart-count {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--md-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 19px;
  text-align: center;
  box-shadow: 0 0 0 2px #fff;
}

/* ===============================
   Hamburger (animated)
   =============================== */
.md-custom-mobile-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background .25s ease;
}
.md-custom-mobile-toggle:hover { background: #f4f4f4; }

.md-custom-mobile-toggle .bar {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 2.5px;
  border-radius: 3px;
  background: var(--md-ink);
  transform: translateX(-50%);
  transition: transform .35s var(--md-ease), opacity .2s ease, top .35s var(--md-ease);
}
.md-custom-mobile-toggle .bar:nth-child(1) { top: 15px; }
.md-custom-mobile-toggle .bar:nth-child(2) { top: 21px; }
.md-custom-mobile-toggle .bar:nth-child(3) { top: 27px; }

body.md-menu-open .md-custom-mobile-toggle .bar:nth-child(1) { top: 21px; transform: translateX(-50%) rotate(45deg); }
body.md-menu-open .md-custom-mobile-toggle .bar:nth-child(2) { opacity: 0; }
body.md-menu-open .md-custom-mobile-toggle .bar:nth-child(3) { top: 21px; transform: translateX(-50%) rotate(-45deg); }

/* ===============================
   Off-canvas drawer + overlay
   =============================== */
/* lock the page behind the drawer */
body.md-menu-open { overflow: hidden; }

.md-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 16, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  z-index: 4000;
  transition: opacity .4s var(--md-ease), visibility 0s linear .4s;
}
body.md-menu-open .md-overlay {
  opacity: 1;
  visibility: visible;
  transition: opacity .4s var(--md-ease), visibility 0s linear 0s;
}

.md-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 86%;
  max-width: 360px;
  background: #fff;
  z-index: 4500;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform .42s var(--md-ease);
  box-shadow: 0 0 60px rgba(0,0,0,.3);
  overflow: hidden;
}
body.md-menu-open .md-drawer { transform: translateX(0); }

.md-drawer-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--md-line);
}
.md-drawer-header img { max-height: 48px; width: auto; }

.md-drawer-close {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: #f4f4f4;
  color: var(--md-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .2s ease, transform .2s var(--md-ease);
}
.md-drawer-close:hover { background: #ebebeb; transform: rotate(90deg); }

.md-drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 24px;
}

/* drawer menu (built from the desktop menu via JS) */
.md-drawer .md-drawer-menu,
.md-drawer .md-drawer-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.md-drawer-menu > li { border-bottom: 1px solid #f3f3f3; }

.md-drawer-menu > li > a,
.md-drawer-menu .md-acc-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 22px;
  color: var(--md-ink);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  border: 0;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: color .2s ease, background .2s ease;
}
.md-drawer-menu > li > a:hover,
.md-drawer-menu .md-acc-trigger:hover { color: var(--md-accent); background: #fbfbfb; }

.md-acc-trigger { justify-content: space-between; }
.md-acc-trigger .md-acc-label { display: inline-flex; align-items: center; gap: 10px; }

.md-acc-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  position: relative;
}
/* chevron pointing down, flips up when the section is open */
.md-acc-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 9px;
  height: 9px;
  border-right: 2.5px solid var(--md-accent);
  border-bottom: 2.5px solid var(--md-accent);
  border-radius: 1px;
  transform: translate(-50%, -70%) rotate(45deg);
  transition: transform .35s var(--md-ease);
}
.md-drawer-menu li.is-open > .md-acc-trigger .md-acc-icon::before {
  transform: translate(-50%, -30%) rotate(-135deg);
}

/* smooth accordion via grid-rows trick */
.md-drawer-menu .sub-menu {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .38s var(--md-ease);
  background: #fafafa;
}
.md-drawer-menu li.is-open > .sub-menu { grid-template-rows: 1fr; }

.md-drawer-menu .sub-menu > div {
  overflow: hidden;
  min-height: 0;
}

.md-drawer-menu .sub-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px 13px 40px;
  color: var(--md-ink-soft);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: color .2s ease, background .2s ease, padding-left .2s var(--md-ease);
}
.md-drawer-menu .sub-menu a:hover {
  color: var(--md-accent-dark);
  background: #f3ece0;
  padding-left: 46px;
}

.md-drawer-footer {
  flex: 0 0 auto;
  padding: 16px 22px 22px;
  border-top: 1px solid var(--md-line);
}
.md-drawer-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border-radius: 10px;
  background: var(--md-accent);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  transition: background .2s ease, transform .2s var(--md-ease);
}
.md-drawer-cart:hover { background: var(--md-accent-dark); transform: translateY(-1px); }

/* ===============================
   Responsive switch
   =============================== */
@media (max-width: 992px) {
  .md-custom-menu { display: none; }
  .md-custom-mobile-toggle { display: inline-flex; }

  .md-custom-nav-container {
    min-height: 72px;
    padding: 8px 18px;
    gap: 8px;
  }
  .md-custom-logo img,
  .md-custom-logo-img { max-width: 140px; max-height: 56px; }
  .md-custom-cart { margin-left: 0; }
}

@media (min-width: 993px) {
  .md-overlay, .md-drawer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .md-custom-navigation *,
  .md-drawer *,
  .md-overlay { transition: none !important; }
}

/* ---- Drawer submenu: smooth open/close (JS-driven height) ----
   Closed by default via max-height:0. massdekor-menu.js sets an inline
   max-height (= the submenu's scrollHeight) on open and back to 0 on close,
   so it animates to the exact height and works regardless of markup/browser. */
.md-drawer-menu .menu-item-has-children > .sub-menu {
	display: block !important;
	background: #fafafa;
	margin: 0 !important;
	padding: 0 !important;
	max-height: 0;
	overflow: hidden;
	transition: max-height .35s var(--md-ease);
}

/* Open via the .is-open class so it works from CSS alone (the JS also sets an
   exact inline max-height when present, which overrides this generous value). */
.md-drawer-menu .menu-item-has-children.is-open > .sub-menu {
	max-height: 1000px;
}

.md-drawer-menu .sub-menu li {
	border: 0 !important;
}

.md-drawer-menu .sub-menu a {
	font-size: 18px;
	font-weight: 400;
	padding: 14px 22px 14px 40px;   /* 40px left = clearly indented right of the 22px parent */
}