.gc-banner, .gc-banner *, .gc-modal, .gc-modal *, .gc-floating-prefs, .gc-floating-prefs * { box-sizing: border-box; }

/* ======================== BANNER ======================== */
.gc-banner{position:fixed;left:0;right:0;bottom:0;background:#111;color:#fff;padding:14px 16px;z-index:2147483600;font:14px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;box-shadow:0 -2px 10px rgba(0,0,0,.2)}
.gc-banner-inner{max-width:1200px;margin:0 auto;display:flex;gap:20px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.gc-banner-text{flex:1 1 320px;min-width:0}
.gc-banner-text .gc-privacy-link{color:#9cc7ff;text-decoration:underline;margin-left:6px}
.gc-banner-actions{display:flex;gap:8px;flex-wrap:nowrap;align-items:center;flex-shrink:0}
.gc-banner-actions button{padding:9px 16px;border:0;border-radius:6px;cursor:pointer;font:inherit;font-weight:500;white-space:nowrap;transition:background-color .15s ease, color .15s ease, border-color .15s ease}

.gc-reject-all{background:var(--gc-reject);color:var(--gc-reject-text)}
.gc-reject-all:hover{background:var(--gc-reject-bg-hover);color:var(--gc-reject-text-hover)}

.gc-open-modal{background:var(--gc-save-bg);color:var(--gc-save-text)}
.gc-open-modal:hover{background:var(--gc-save-bg-hover);color:var(--gc-save-text-hover)}

.gc-accept-all{background:var(--gc-accept);color:var(--gc-accept-text)}
.gc-accept-all:hover{background:var(--gc-accept-bg-hover);color:var(--gc-accept-text-hover)}

/* ======================== FLOATING COG BUTTON ======================== */
.gc-floating-prefs{
  position:fixed;
  width:46px;
  height:46px;
  border-radius:50%;
  background:var(--gc-cog-bg);
  color:var(--gc-cog-icon);
  border:0;
  cursor:pointer;
  z-index:2147483599;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  box-shadow:0 4px 12px rgba(0,0,0,.25);
  transition:transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
  -webkit-tap-highlight-color:transparent; /* elimina overlay-ul albastru la tap pe iOS */
}

/* Hover styles doar pe device-uri cu mouse real (hover: hover).
   Pe touch devices (mobile, tabletă), CSS hover persistă dupa tap pana la
   urmatorul tap in alta zona — evitam asta complet prin @media query.
   Pe desktop cu mouse, hover funcționează normal. */
@media (hover: hover) and (pointer: fine) {
  .gc-floating-prefs:hover{
    background:var(--gc-cog-hover);
    color:var(--gc-cog-icon-hover);
    transform:scale(1.08) rotate(20deg);
    box-shadow:0 6px 16px rgba(0,0,0,.3);
  }
}

.gc-floating-prefs svg{pointer-events:none;display:block;stroke:currentColor}

.gc-floating-prefs--bottom-left  { bottom:20px; left:20px;  top:auto;   right:auto; }
.gc-floating-prefs--bottom-right { bottom:20px; right:20px; top:auto;   left:auto;  }
.gc-floating-prefs--top-left     { top:20px;    left:20px;  bottom:auto;right:auto; }
.gc-floating-prefs--top-right    { top:20px;    right:20px; bottom:auto;left:auto;  }

/* ======================== MODAL ======================== */
.gc-modal{position:fixed;inset:0;z-index:2147483601;display:none;font:14px/1.55 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.gc-modal-backdrop{position:absolute;inset:0;background:rgba(0,0,0,.55)}
.gc-modal-card{
  position:relative;
  max-width:720px;
  width:calc(100% - 32px);
  margin:6vh auto;
  background:var(--gc-modal-bg);
  color:#222;
  border-radius:10px;
  overflow:hidden;
  box-shadow:0 20px 60px rgba(0,0,0,.35);
  display:flex;
  flex-direction:column;
  /* Fallback vh pentru browsere vechi, dvh (dynamic viewport) pentru
     Safari/Chrome moderne — `dvh` exclude bara URL care apare/dispare pe mobil. */
  max-height:88vh;
  max-height:88dvh;
}

.gc-modal-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:24px 28px 8px}
.gc-modal-title{margin:0;font-size:22px;font-weight:700;color:#222;line-height:1.3}
/* Butonul × este desenat cu 2 pseudo-elements rotate (CSS pur).
   Garanteaza centrare geometrica perfecta — glifa × din fonturi standard
   NU e geometric centrata (design typografic), iar asta creeaza offset vizual.
   Linii de 14×2px rotate la ±45° produc un X perfect simetric.

   IMPORTANT: folosim selectorul "button.gc-close-modal" ca sa NU afectam
   backdrop-ul (div.gc-modal-backdrop.gc-close-modal) care foloseste aceeasi
   clasa pentru JS click-to-close, dar trebuie sa ramana full-screen transparent. */
button.gc-close-modal,
button.gc-close-modal:hover,
button.gc-close-modal:focus,
button.gc-close-modal:active{
  background:var(--gc-close-bg) !important;
  background-color:var(--gc-close-bg) !important;
  background-image:none !important;
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
  text-decoration:none !important;
  color:var(--gc-close-color) !important;
}
button.gc-close-modal{
  position:relative;
  cursor:pointer;
  padding:0;
  margin:0;
  width:32px;
  height:32px;
  flex-shrink:0;
  border-radius:4px;
  transition:background-color .15s ease !important;
  -webkit-appearance:none;
  appearance:none;
  font-size:0;
}
button.gc-close-modal::before,
button.gc-close-modal::after{
  content:"";
  position:absolute;
  width:14px;
  height:2px;
  background:var(--gc-close-color);
  border-radius:1px;
  top:50%;
  left:50%;
  transform-origin:center center;
  transition:background-color .15s ease;
}
button.gc-close-modal::before{ transform:translate(-50%,-50%) rotate(45deg); }
button.gc-close-modal::after { transform:translate(-50%,-50%) rotate(-45deg); }
button.gc-close-modal:hover{
  background:var(--gc-close-bg-hover) !important;
  background-color:var(--gc-close-bg-hover) !important;
}
button.gc-close-modal:hover::before,
button.gc-close-modal:hover::after{
  background:var(--gc-close-color-hover);
}
button.gc-close-modal:focus-visible{
  outline:2px solid #2563eb !important;
  outline-offset:2px;
}

.gc-modal-intro{padding:0 28px 20px;font-size:14px;color:#555;line-height:1.6}
.gc-modal-intro .gc-privacy-link{color:#2563eb;text-decoration:underline}
.gc-modal-intro .gc-privacy-link:hover{color:#1d4ed8}

.gc-modal-body{padding:0 28px;overflow-y:auto;flex:1 1 auto}

.gc-modal-footer{display:flex;gap:12px;padding:20px 28px 24px;flex-wrap:wrap;align-items:center}
.gc-modal-footer button{padding:12px 22px;border-radius:4px;cursor:pointer;font:inherit;font-size:14px;font-weight:500;transition:background-color .15s ease, color .15s ease, border-color .15s ease}

/* Outline buttons (Accepta selectia + Declinare) */
.gc-modal-footer .gc-save-prefs{
  background:transparent;
  color:var(--gc-save-bg);
  border:2px solid var(--gc-save-bg);
}
.gc-modal-footer .gc-save-prefs:hover{
  background:var(--gc-save-bg);
  color:var(--gc-save-text);
  border-color:var(--gc-save-bg);
}

.gc-modal-footer .gc-reject-all{
  background:transparent;
  color:var(--gc-reject);
  border:2px solid var(--gc-reject);
}
.gc-modal-footer .gc-reject-all:hover{
  background:var(--gc-reject);
  color:var(--gc-reject-text);
  border-color:var(--gc-reject);
}

/* Primary filled (Permite toate) - pushed right pentru acces facil */
.gc-modal-footer .gc-accept-all{
  background:var(--gc-accept);
  color:var(--gc-accept-text);
  border:2px solid var(--gc-accept);
  margin-left:auto;
}
.gc-modal-footer .gc-accept-all:hover{
  background:var(--gc-accept-bg-hover);
  color:var(--gc-accept-text-hover);
  border-color:var(--gc-accept-bg-hover);
}

/* ======================== CATEGORY ACCORDION ======================== */
.gc-cat,
.gc-cat:hover{
  background:#f7f7f7 !important;
  border:1px solid #e5e5e5 !important;
  border-radius:6px;
  margin-bottom:10px;
  overflow:hidden;
}
.gc-cat:last-child{margin-bottom:0}

.gc-cat-head,
.gc-cat-head:hover,
.gc-cat:hover .gc-cat-head{
  background:transparent !important;
  background-color:transparent !important;
  background-image:none !important;
}
.gc-cat-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:14px 18px;
}

.gc-cat-toggle,
.gc-cat-toggle:hover,
.gc-cat-toggle:focus,
.gc-cat-toggle:active{
  background:transparent !important;
  background-color:transparent !important;
  background-image:none !important;
  border:0 !important;
  outline:none !important;
  box-shadow:none !important;
  padding:0 !important;
  margin:0 !important;
  color:#222 !important;
  text-decoration:none !important;
}
.gc-cat-toggle{
  cursor:pointer;
  display:flex;
  align-items:center;
  gap:12px;
  flex:1;
  text-align:left;
  font:inherit;
  min-width:0;
  -webkit-appearance:none;
  appearance:none;
}
.gc-cat-toggle:focus-visible{
  outline:2px solid #2563eb !important;
  outline-offset:2px;
}

.gc-cat-icon{
  width:18px;
  height:18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
  position:relative;
}
.gc-cat-icon::before,
.gc-cat-icon::after{
  content:"";
  position:absolute;
  background:#222;
  border-radius:1px;
  transition:transform .2s ease, opacity .2s ease;
}
.gc-cat-icon::before{ width:14px; height:2px; left:2px; top:8px; } /* horizontal line */
.gc-cat-icon::after { width:2px;  height:14px; left:8px; top:2px; transform:scaleY(0); } /* vertical line (hidden when expanded -> minus) */

.gc-cat:not(.gc-cat--expanded) .gc-cat-icon::after{ transform:scaleY(1); } /* show vertical -> plus */

.gc-cat-title{
  font-size:15px;
  font-weight:700;
  color:#222;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.gc-cat-right{
  display:flex;
  align-items:center;
  flex-shrink:0;
}

.gc-cat-badge{
  font-size:13px;
  color:#666;
  padding:2px 0;
  white-space:nowrap;
}

.gc-cat-body{
  padding:0 18px 16px;
  border-top:1px solid #eee;
  overflow:hidden;
}
.gc-cat:not(.gc-cat--expanded) .gc-cat-body{display:none}

.gc-cat-desc{
  margin:14px 0 0;
  font-size:13.5px;
  color:#555;
  line-height:1.65;
}

/* ======================== TOGGLE SWITCH ======================== */
.gc-switch{position:relative;display:inline-block;width:42px;height:22px;flex-shrink:0}
.gc-switch input{opacity:0;width:0;height:0;position:absolute}
.gc-slider{
  position:absolute;
  cursor:pointer;
  top:0;left:0;right:0;bottom:0;
  background:var(--gc-slider-off);
  border-radius:22px;
  transition:background .2s;
}
.gc-slider::before{
  content:"";
  position:absolute;
  height:16px;
  width:16px;
  left:3px;
  bottom:3px;
  background:#fff;
  border-radius:50%;
  transition:transform .2s;
  box-shadow:0 1px 3px rgba(0,0,0,.3);
}
.gc-switch input:checked + .gc-slider{background:var(--gc-slider-on)}
.gc-switch input:checked + .gc-slider::before{transform:translateX(20px)}
.gc-switch input:disabled + .gc-slider{cursor:not-allowed;opacity:.6}
.gc-switch input:focus-visible + .gc-slider{box-shadow:0 0 0 3px rgba(37,99,235,.35)}

/* ======================== RESPONSIVE ======================== */
@media (max-width: 720px) {
  .gc-banner{padding:12px}
  .gc-banner-inner{gap:12px}
  .gc-banner-text{flex:1 1 100%}
  .gc-banner-actions{width:100%;flex-wrap:wrap}
  .gc-banner-actions button{flex:1 1 auto;min-width:90px}

  .gc-floating-prefs{width:42px;height:42px}
  .gc-floating-prefs--bottom-left  { bottom:14px; left:14px;  }
  .gc-floating-prefs--bottom-right { bottom:14px; right:14px; }
  .gc-floating-prefs--top-left     { top:14px;    left:14px;  }
  .gc-floating-prefs--top-right    { top:14px;    right:14px; }

  .gc-modal-card{
    margin:2vh auto;
    margin:2dvh auto;
    width:calc(100% - 24px);
    max-height:96vh;
    max-height:96dvh;
  }
  .gc-modal-header{padding:20px 20px 8px}
  .gc-modal-title{font-size:19px}
  .gc-modal-intro{padding:0 20px 16px;font-size:13.5px}
  .gc-modal-body{padding:0 20px}
  .gc-modal-footer{padding:16px 20px 20px}
  .gc-modal-footer button{flex:1 1 auto;min-width:120px}
  .gc-modal-footer .gc-accept-all{margin-left:0;flex:1 1 100%;order:99}
}
