/* Custom menu styles */
.main-menu { display: block; }

/* === MEDICALIKZ – Footer: banda link NERA === */

/* Colora il wrapper della banda link (vince su trasparent !important del tema) */
body.shop-id-2 #footer-container-main .footer-top,
body.shop-id-2 #footer-container-main .footer-widgets {
  background-color: #000000 !important;
}

/* Colora il blocco Link (qualsiasi variante del nome classe) */
body.shop-id-2 footer .block-links[class*="block-iqitlinksmanager"] {
  background-color: #000000 !important;
  color: #ffffff !important;
}

/* Evita rientri bianchi nei wrapper interni */
body.shop-id-2 footer .block-links[class*="block-iqitlinksmanager"] .block-content,
body.shop-id-2 footer .block-links[class*="block-iqitlinksmanager"] .row,
body.shop-id-2 footer .block-links[class*="block-iqitlinksmanager"] [class*="col-"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Testi e link nella banda */
body.shop-id-2 footer .block-links[class*="block-iqitlinksmanager"] .block-title { color: #f28500 !important; }
body.shop-id-2 footer .block-links[class*="block-iqitlinksmanager"] a { color: #ffffff !important; }
body.shop-id-2 footer .block-links[class*="block-iqitlinksmanager"] a:hover { color: #ffffff !important; text-decoration: underline; }

/* === KETOZONA – Footer: banda link GRIGIA === */

body.shop-id-1 #footer-container-main .footer-top,
body.shop-id-1 #footer-container-main .footer-widgets {
  background-color: #3c3c3c !important;
}

body.shop-id-1 footer .block-links[class*="block-iqitlinksmanager"] {
  background-color: #3c3c3c !important;
  color: #eeeeee !important;
}

body.shop-id-1 footer .block-links[class*="block-iqitlinksmanager"] .block-content,
body.shop-id-1 footer .block-links[class*="block-iqitlinksmanager"] .row,
body.shop-id-1 footer .block-links[class*="block-iqitlinksmanager"] [class*="col-"] {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

body.shop-id-1 footer .block-links[class*="block-iqitlinksmanager"] .block-title { color: #f28500 !important; }
body.shop-id-1 footer .block-links[class*="block-iqitlinksmanager"] a { color: #eeeeee !important; }
body.shop-id-1 footer .block-links[class*="block-iqitlinksmanager"] a:hover { color: #ffffff !important; }
/* ===== MEDICALIKZ — footer NERO “hard override” ===== */

/* Colora interamente il footer (wrapper + righe + colonne) */
body.shop-id-2 footer,
body.shop-id-2 #footer-container-main,
body.shop-id-2 footer .container,
body.shop-id-2 footer .row,
body.shop-id-2 footer [class*="col-"],
body.shop-id-2 footer .block,
body.shop-id-2 footer .block-content {
  background-color: #000000 !important;
}

/* Testi e link chiari nel footer */
body.shop-id-2 footer,
body.shop-id-2 footer a,
body.shop-id-2 footer .block-title {
  color: #ffffff !important;
}
body.shop-id-2 footer .block-title { color: #f28500 !important; } /* titoli arancio come prima */
body.shop-id-2 footer a:hover { color: #ffffff !important; text-decoration: underline; }
/* ===== KETOZONA — footer GRIGIO “hard override” ===== */

body.shop-id-1 footer,
body.shop-id-1 #footer-container-main,
body.shop-id-1 footer .container,
body.shop-id-1 footer .row,
body.shop-id-1 footer [class*="col-"],
body.shop-id-1 footer .block,
body.shop-id-1 footer .block-content {
  background-color: #3c3c3c !important;
}

body.shop-id-1 footer,
body.shop-id-1 footer a,
body.shop-id-1 footer .block-title {
  color: #eeeeee !important;
}
body.shop-id-1 footer .block-title { color: #f28500 !important; }
body.shop-id-1 footer a:hover { color: #ffffff !important; }

/* DEBUG evidente */
body.shop-id-2 footer { outline: 6px solid red !important; }
/* HOTFIX footer band */
body.shop-id-2 #footer-container-main.footer-style-1 > .container > .row + .row {background:#000!important;}
body.shop-id-1 #footer-container-main.footer-style-1 > .container > .row + .row {background:#3c3c3c!important;}
/* Banda link = tutte le row dalla seconda in poi */
body.shop-id-2 #footer-container-main.footer-style-1 > .container > .row:nth-of-type(n+2){
  background:#000 !important;
}
/* testi/link dentro i blocchi link */
body.shop-id-2 #footer-container-main .block-iqitlinksmanager a{color:#fff!important;}
body.shop-id-2 #footer-container-main .block-iqitlinksmanager .block-title{color:#f28500!important;}


/* Hide legacy/fake inputs immediately */
#authentication input#ff_psgdpr,
#authentication input[name="psgdpr"],
#authentication span#ff_psgdpr,
.page-authentication input#ff_psgdpr,
.page-authentication input[name="psgdpr"],
.page-authentication span#ff_psgdpr {
  display: none !important;
}

/* Hide the phantom container if it doesn't contain the real GDPR checkbox */
#authentication .custom-checkbox.label:not(:has(input[name^="psgdpr_consent_checkbox_"])),
.page-authentication .custom-checkbox.label:not(:has(input[name^="psgdpr_consent_checkbox_"])) {
  display: none !important;
}

/* Also hide the entire row that wraps that phantom container */
#authentication .form-group:has(.custom-checkbox.label:not(:has(input[name^="psgdpr_consent_checkbox_"]))),
.page-authentication .form-group:has(.custom-checkbox.label:not(:has(input[name^="psgdpr_consent_checkbox_"]))) {
  display: none !important;
}
/* Nasconde la riga finta GDPR SOLO su medicalikz (shop-id-2) */
body.shop-id-2 #authentication .form-group:has(input#ff_psgdpr),
body.shop-id-2 #authentication .form-group:has(input[name="psgdpr"]),
body.shop-id-2 .page-authentication .form-group:has(input#ff_psgdpr),
body.shop-id-2 .page-authentication .form-group:has(input[name="psgdpr"]) {
  display: none !important;
}


/* disattiva i “finti” before/after fuori dal checkout */
body:not(#checkout) .custom-checkbox label::before,
body:not(#checkout) .custom-checkbox label::after{
  content:none !important;
}

/* ===================== REGISTRAZIONE — tieni SOLO la checkbox GDPR vera ===================== */
(function () {
  function isRegistration() {
    const b = document.body;
    return b && (b.id === 'authentication' || b.classList.contains('page-authentication'));
  }
  function holderOf(el) {
    return el.closest('.psgdpr_consent_message, .custom-checkbox, .form-group, .form-group.row, label, p, div') || el.parentElement;
  }
  function run() {
    if (!isRegistration()) return;

    const root =
      document.querySelector('#registration_fields') ||
      document.querySelector('form#customer-form') ||
      document.querySelector('form.js-customer-form') ||
      document;

    /* A) Rimuovi il BLOCCO FINTO (ff_psgdpr / name="psgdpr") */
    root.querySelectorAll('#ff_psgdpr, input[name="psgdpr"]').forEach(function (inp) {
      const blk = holderOf(inp);
      if (blk) blk.remove(); else inp.remove();
    });

    /* B) Trova la checkbox GDPR VERA (del modulo) */
    const real = root.querySelector('input[type="checkbox"][name^="psgdpr_consent_checkbox_"]');
    if (!real) return;

    /* C) Rendi la checkbox vera ben visibile */
    real.style.position = 'static';
    real.style.opacity  = '1';
    real.style.width    = 'auto';
    real.style.height   = 'auto';
    real.style.marginRight = '6px';
    real.style.webkitAppearance = 'auto';
    real.style.appearance      = 'auto';
    /* Nasconde la riga finta GDPR SOLO su medicalikz */
body.shop-id-2 #authentication input#ff_psgdpr,
body.shop-id-2 #authentication input[name="psgdpr"],
body.shop-id-2 .page-authentication input#ff_psgdpr,
body.shop-id-2 .page-authentication input[name="psgdpr"] {
  display:none !important;
}

body.shop-id-2 #authentication input#ff_psgdpr,
body.shop-id-2 #authentication input[name="psgdpr"] {
  pointer-events:none !important;
}
