/* =====================================================================
   CENTRE TÈCNIC — Menú mòbil a pantalla completa (.ctmm-*)
   Botó: widget HTML de la capçalera (només tauleta i mòbil).
   Panell: el construeix assets/ctmm.js a partir del menú de WordPress.
   ===================================================================== */

:root {
  --ctmm-garnet: #751823;
  --ctmm-garnet-900: #3f0c14;
  --ctmm-ink: #1b1417;
  --ctmm-ease: cubic-bezier(.77, 0, .18, 1);
  --ctmm-ease-out: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- Botó hamburguesa ---------- */
.ctmm-toggle,
.ctmm-close {
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box; position: relative;
  width: 48px; height: 48px; padding: 0; margin: 0;
  border-radius: 999px; cursor: pointer;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: #fff; background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .35);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .3s var(--ctmm-ease-out), border-color .3s var(--ctmm-ease-out), color .3s var(--ctmm-ease-out), transform .2s var(--ctmm-ease-out);
  -webkit-tap-highlight-color: transparent;
}
.ctmm-toggle:hover, .ctmm-toggle:focus { background: rgba(255, 255, 255, .2); color: #fff; }
.ctmm-toggle:active, .ctmm-close:active { transform: scale(.94); }
.ctmm-toggle:focus-visible, .ctmm-close:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.ctmm-toggle span {
  display: block; height: 2px; border-radius: 2px; background: currentColor;
  transition: width .35s var(--ctmm-ease-out);
}
.ctmm-toggle span:nth-child(1) { width: 20px; }
.ctmm-toggle span:nth-child(2) { width: 13px; margin-left: 7px; }
.ctmm-toggle:hover span:nth-child(2) { width: 20px; margin-left: 0; }

/* capçalera enganxada (fons blanc) */
.elementor-sticky--effects .ctmm-toggle {
  color: var(--ctmm-ink); background: #fff; border-color: rgba(27, 20, 23, .14);
}
.elementor-sticky--effects .ctmm-toggle:hover { color: var(--ctmm-garnet); }

/* ---------- Panell ---------- */
body.ctmm-lock { overflow: hidden; }

.ctmm {
  --x: 100%; --y: 0%;
  position: fixed; inset: 0; z-index: 100000;
  box-sizing: border-box; overflow-y: auto; overscroll-behavior: contain;
  color: #fff; font-family: 'Hanken Grotesk', 'DM Sans', sans-serif;
  background:
    radial-gradient(120% 70% at 100% 0%, #93263a 0%, rgba(147, 38, 58, 0) 60%),
    linear-gradient(160deg, #751823 0%, #5c111c 55%, var(--ctmm-garnet-900) 100%);
  clip-path: circle(0px at var(--x) var(--y));
  visibility: hidden;
  transition: clip-path .6s var(--ctmm-ease), visibility 0s linear .6s;
}
.ctmm.is-open {
  clip-path: circle(150vmax at var(--x) var(--y));
  visibility: visible;
  transition: clip-path .75s var(--ctmm-ease), visibility 0s;
}
.ctmm *, .ctmm *::before, .ctmm *::after { box-sizing: border-box; }

/* anells decoratius */
.ctmm::before, .ctmm::after {
  content: ""; position: fixed; border-radius: 50%; pointer-events: none;
  border: 1px solid rgba(255, 255, 255, .07);
}
.ctmm::before { width: 520px; height: 520px; right: -260px; bottom: -180px; }
.ctmm::after  { width: 340px; height: 340px; right: -170px; bottom: -90px; }

.ctmm-inner {
  position: relative; z-index: 1;
  min-height: 100%; max-width: 720px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: max(20px, env(safe-area-inset-top, 0px)) max(22px, env(safe-area-inset-right, 0px)) max(26px, env(safe-area-inset-bottom, 0px)) max(22px, env(safe-area-inset-left, 0px));
}

/* barra superior */
.ctmm-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.ctmm-logo { display: inline-flex; line-height: 0; }
.ctmm-logo img { height: 40px; width: auto; max-width: 200px; }

.ctmm-close { gap: 0; }
.ctmm-close:hover { background: #fff; color: var(--ctmm-garnet); border-color: #fff; }
.ctmm-close span {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 2px; margin: -1px 0 0 -10px;
  border-radius: 2px; background: currentColor; transition: transform .45s var(--ctmm-ease) .25s;
  transform: rotate(0deg) scaleX(0);
}
.ctmm.is-open .ctmm-close span:nth-child(1) { transform: rotate(45deg) scaleX(1); }
.ctmm.is-open .ctmm-close span:nth-child(2) { transform: rotate(-45deg) scaleX(1); }

/* enllaços */
.ctmm-nav { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 36px 0 32px; }
.ctmm-eyebrow {
  margin: 0 0 14px; font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
  opacity: 0; transition: opacity .4s var(--ctmm-ease-out);
}
.ctmm.is-open .ctmm-eyebrow { opacity: 1; transition-delay: .3s; }

.ctmm-list { list-style: none; margin: 0; padding: 0; }
.ctmm-list li { overflow: hidden; border-bottom: 1px solid rgba(255, 255, 255, .14); }
.ctmm-list li:first-child { border-top: 1px solid rgba(255, 255, 255, .14); }
.ctmm-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; color: #fff; text-decoration: none;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 500;
  font-size: clamp(23px, 6vw, 32px); line-height: 1.15; letter-spacing: -.02em;
  transform: translateY(105%); opacity: 0;
  transition: transform .7s var(--ctmm-ease-out), opacity .5s var(--ctmm-ease-out), color .25s;
}
.ctmm.is-open .ctmm-list a { transform: none; opacity: 1; transition-delay: var(--d, .3s), var(--d, .3s), 0s; }
.ctmm-list a:hover, .ctmm-list a:focus-visible { color: #fff; outline: none; }
.ctmm-label { position: relative; }
.ctmm-label::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: #fff;
  transform: scaleX(0); transform-origin: left; transition: transform .4s var(--ctmm-ease-out);
}
.ctmm-list a:hover .ctmm-label::after, .ctmm-list a:focus-visible .ctmm-label::after { transform: scaleX(1); }

.ctmm-arrow {
  flex: none; width: 36px; height: 36px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255, 255, 255, .28); color: #fff;
  transition: transform .35s var(--ctmm-ease-out), background .25s, color .25s, border-color .25s;
}
.ctmm-arrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctmm-list a:hover .ctmm-arrow, .ctmm-list a:focus-visible .ctmm-arrow { transform: rotate(-45deg); background: rgba(255, 255, 255, .12); }

/* pàgina actual */
.ctmm-list a.is-current .ctmm-arrow { background: #fff; color: var(--ctmm-garnet); border-color: #fff; }
.ctmm-current {
  font-family: 'Hanken Grotesk', 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: rgba(255, 255, 255, .62); margin-left: auto;
}

/* peu: CTA + dades */
.ctmm-foot {
  display: grid; gap: 22px;
  opacity: 0; transform: translateY(18px);
  transition: opacity .5s var(--ctmm-ease-out), transform .6s var(--ctmm-ease-out);
}
.ctmm.is-open .ctmm-foot { opacity: 1; transform: none; transition-delay: var(--df, .6s); }
.ctmm-ctas { display: flex; flex-wrap: wrap; gap: 10px; }
.ctmm-btn {
  flex: 1 1 170px; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 24px; border-radius: 999px; text-decoration: none;
  font-family: 'Hanken Grotesk', 'DM Sans', sans-serif; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em;
  transition: transform .2s var(--ctmm-ease-out), background .25s, color .25s, box-shadow .25s;
}
.ctmm-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctmm-btn--solid { background: #fff; color: var(--ctmm-garnet); }
.ctmm-btn--solid:hover, .ctmm-btn--solid:focus { color: var(--ctmm-garnet); box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .55); transform: translateY(-2px); }
.ctmm-btn--ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .4); }
.ctmm-btn--ghost:hover, .ctmm-btn--ghost:focus { color: #fff; background: rgba(255, 255, 255, .12); }
.ctmm-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.ctmm-info {
  display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 14.5px; line-height: 1.5; color: rgba(255, 255, 255, .72);
}
.ctmm-info a { color: rgba(255, 255, 255, .72); text-decoration: none; }
.ctmm-info a:hover { color: #fff; }


/* ---------- Blindatge davant dels estils globals del kit (button, a) ---------- */
body .ctmm-toggle, body .ctmm-toggle:focus {
  background: rgba(255, 255, 255, .1) !important; color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .35) !important; box-shadow: none !important;
  padding: 0 !important; min-height: 0 !important; font-size: 0 !important;
}
body .ctmm-toggle:hover { background: rgba(255, 255, 255, .2) !important; color: #fff !important; }
body .elementor-sticky--effects .ctmm-toggle,
body .elementor-sticky--effects .ctmm-toggle:focus { background: #fff !important; color: var(--ctmm-ink) !important; border-color: rgba(27, 20, 23, .14) !important; }
body .elementor-sticky--effects .ctmm-toggle:hover { background: #fff !important; color: var(--ctmm-garnet) !important; }
body .ctmm .ctmm-close, body .ctmm .ctmm-close:focus {
  background: rgba(255, 255, 255, .1) !important; color: #fff !important;
  border: 1px solid rgba(255, 255, 255, .35) !important; box-shadow: none !important;
  padding: 0 !important; min-height: 0 !important; font-size: 0 !important;
}
body .ctmm .ctmm-close:hover { background: #fff !important; color: var(--ctmm-garnet) !important; border-color: #fff !important; }
body .ctmm a.ctmm-btn--solid, body .ctmm a.ctmm-btn--solid:hover, body .ctmm a.ctmm-btn--solid:focus { background: #fff !important; color: var(--ctmm-garnet) !important; }
body .ctmm a.ctmm-btn--ghost, body .ctmm a.ctmm-btn--ghost:focus { background: transparent !important; color: #fff !important; }
body .ctmm a.ctmm-btn--ghost:hover { background: rgba(255, 255, 255, .12) !important; color: #fff !important; }
body .ctmm .ctmm-list a, body .ctmm .ctmm-list a:hover { color: #fff !important; }
body .ctmm .ctmm-logo { background: none !important; }

/* només tauleta i mòbil */
@media (min-width: 1025px) {
  .ctmm, .ctmm-toggle { display: none !important; }
}
@media (max-height: 640px) {
  .ctmm-list a { font-size: 21px; padding: 10px 0; }
  .ctmm-nav { padding: 20px 0; }
  .ctmm-arrow { width: 32px; height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .ctmm, .ctmm.is-open { clip-path: none; transition: opacity .2s, visibility 0s linear .2s; opacity: 0; }
  .ctmm.is-open { opacity: 1; transition: opacity .2s; }
  .ctmm-list a, .ctmm-foot, .ctmm-eyebrow { transform: none !important; opacity: 1 !important; transition: none !important; }
}
