/* Keep z-index sane and consistent */
#nx_cookie_banner, #nx_cookie_panel, #nx_cookie_fab { z-index: 2147483647 !important; }
#nx_cookie_backdrop { z-index: 2147483646 !important; }

/* ===== Mobile button layout tidy-up ===== */
@media (max-width: 520px) {
  .nx-panel-actions > div:first-child { width: 100%; display: flex; flex-wrap: wrap; gap: 10px; }
  #nx_panel_save { width: 100%; order: 1; }
  #nx_panel_accept, #nx_panel_reject { width: calc(50% - 5px); order: 2; }
  .nx-panel-actions > div:last-child { width: 100%; order: 3; }
}

/* ===== Banner (step 1) ===== */
#nx_cookie_banner { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); display: none; opacity: 1 !important; }
#nx_cookie_banner, #nx_cookie_banner * { opacity: 1 !important; }

.nx-banner-inner { padding: 16px; }
.nx-banner-title { margin: 0 0 6px; font-size: 18px; }
.nx-banner-text { margin: 0 0 12px; line-height: 1.45; font-size: 14px; }

.nx-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nx-btn { border: 1px solid rgba(0,0,0,0.25); background: #fff; padding: 9px 12px; border-radius: 8px; cursor: pointer; line-height: 1; }
.nx-btn.primary { border-color: rgba(0,0,0,0.35); font-weight: 700; }

.nx-links { margin-top: 10px; font-size: 13px; }
.nx-links a { text-decoration: underline; }
.nx-sep { margin: 0 8px; opacity: 0.6; }

/* ===== Modal backdrop (step 2) ===== */
#nx_cookie_backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: none; }

/* ===== Preferences panel (step 2) ===== */
#nx_cookie_panel { position: fixed; left: 16px; right: 16px; top: 50%; transform: translateY(-50%); max-width: 860px; margin: 0 auto; background: #fff; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.25); display: none; opacity: 1 !important; filter: none !important; }
#nx_cookie_panel, #nx_cookie_panel * { opacity: 1 !important; }

.nx-panel-inner { padding: 18px; }
.nx-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.nx-panel-head h2 { margin: 0; font-size: 22px; }
.nx-panel-head p { margin: 8px 0 0; line-height: 1.45; }

.nx-close { border: 1px solid rgba(0,0,0,0.25); background: #fff; padding: 8px 10px; border-radius: 8px; cursor: pointer; line-height: 1; white-space: nowrap; }

.nx-acc { margin-top: 14px; border-top: 1px solid rgba(0,0,0,0.10); }

details.nx-item { border-bottom: 1px solid rgba(0,0,0,0.10); padding: 10px 0; }
details.nx-item summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 16px; }
details.nx-item summary::-webkit-details-marker { display: none; }

.nx-status { font-size: 14px; font-weight: 700; color: #2f7d2f; white-space: nowrap; }

.nx-desc { margin: 10px 0 0; font-size: 14px; line-height: 1.5; opacity: 0.9; padding-right: 70px; }

/* Toggle switch */
.nx-switch { position: relative; width: 54px; height: 30px; flex: 0 0 auto; }
.nx-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.nx-slider { position: absolute; inset: 0; background: rgba(0,0,0,0.18); border-radius: 999px; cursor: pointer; transition: background 0.15s ease; }
.nx-slider:before { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; box-shadow: 0 2px 10px rgba(0,0,0,0.25); transition: transform 0.15s ease; }
.nx-switch input:checked + .nx-slider { background: rgba(0,0,0,0.75); }
.nx-switch input:checked + .nx-slider:before { transform: translateX(24px); }

.nx-panel-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* ===== Floating cookie button ===== */
#nx_cookie_fab { position: fixed; left: 16px; bottom: 16px; width: 52px; height: 52px; border-radius: 999px; border: 0; background: #f36f21; color: #fff; display: none; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 24px rgba(0,0,0,0.25); padding: 0; }
#nx_cookie_fab:focus { outline: 2px solid rgba(0,0,0,0.35); outline-offset: 3px; }

.nx-cookie-icn { width: 24px; height: 24px; display: block; }
