/* ============================================
   SMARTLY WEBBeD™ — Cookie Consent Banner
   Brand tokens: gold #d18500 / charcoal / Google Sans
   Compact bar + separate preferences modal (v2)
   ============================================ */

/* ---------- Compact bottom bar (default state) ---------- */
#sw-cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 99999;
  display: none;
  background: #1c1c1c;
  background: linear-gradient(135deg, #1c1c1c 0%, #2a2a2a 100%);
  color: #f2f2f2;
  font-family: 'Google Sans', Arial, sans-serif;
  padding: 16px 28px;
  border-top: 2px solid #d18500;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.35);
  animation: sw-cookie-slide-up 0.4s ease-out;
}

#sw-cookie-banner.sw-cookie-show {
  display: block;
}

@keyframes sw-cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

@keyframes sw-cookie-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes sw-cookie-modal-pop {
  from { transform: scale(0.96) translateY(8px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}

.sw-cookie-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.sw-cookie-text {
  flex: 1 1 420px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #e6e6e6;
}

.sw-cookie-text strong {
  color: #d18500;
  font-weight: 600;
}

.sw-cookie-text a {
  color: #d18500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sw-cookie-text a:hover {
  color: #e8a437;
}

.sw-cookie-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.sw-cookie-btn {
  font-family: 'Google Sans', Arial, sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.sw-cookie-btn-accept {
  background: #d18500;
  color: #1c1c1c;
  border-color: #d18500;
  border-radius: 50px;
}

.sw-cookie-btn-accept:hover {
  background: #e8a437;
  border-color: #e8a437;
  transform: translateY(-1px);
}

.sw-cookie-btn-decline {
  background: transparent;
  color: #cfcfcf;
  border-color: #555;
  border-radius: 50px;
}

.sw-cookie-btn-decline:hover {
  border-color: #d18500;
  color: #d18500;
}

.sw-cookie-btn-settings {
  background: transparent;
  color: #cfcfcf;
  border: none;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 10px 6px;
}

.sw-cookie-btn-settings:hover {
  color: #d18500;
}

/* ---------- Keyboard focus indicators (WCAG 2.4.7 / 2.4.11) ---------- */
#sw-cookie-banner *:focus-visible,
#sw-cookie-modal *:focus-visible,
#sw-cookie-reopen:focus-visible {
  outline: 2px solid #d18500;
  outline-offset: 2px;
}

#sw-cookie-banner a:focus-visible,
#sw-cookie-modal a:focus-visible {
  outline: 2px solid #d18500;
  outline-offset: 1px;
  border-radius: 2px;
}

.sw-cookie-toggle input:focus-visible + .sw-cookie-toggle-slider {
  outline: 2px solid #d18500;
  outline-offset: 2px;
}

/* ---------- Preferences modal (separate overlay, not inline) ---------- */
#sw-cookie-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 100000;
  display: none;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: sw-cookie-fade-in 0.2s ease-out;
}

#sw-cookie-modal-overlay.sw-cookie-show {
  display: flex;
}

#sw-cookie-modal {
  background: #1c1c1c;
  background: linear-gradient(135deg, #1c1c1c 0%, #262626 100%);
  border: 1px solid #3a3a3a;
  border-top: 2px solid #d18500;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 24px;
  color: #f2f2f2;
  font-family: 'Google Sans', Arial, sans-serif;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  animation: sw-cookie-modal-pop 0.2s ease-out;
}

.sw-cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.sw-cookie-modal-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #f2f2f2;
}

#sw-cookie-modal-close {
  background: transparent;
  border: none;
  color: #aaa;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

#sw-cookie-modal-close:hover {
  color: #d18500;
}

.sw-cookie-modal-subtext {
  font-size: 12.5px;
  color: #aaa;
  margin: 4px 0 16px;
  line-height: 1.5;
}

.sw-cookie-category {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #2f2f2f;
}

.sw-cookie-category:last-of-type {
  border-bottom: none;
}

.sw-cookie-category-info h4 {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #f2f2f2;
}

.sw-cookie-category-info p {
  margin: 0;
  font-size: 12.5px;
  color: #aaa;
  line-height: 1.4;
}

/* Toggle switch */
.sw-cookie-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.sw-cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.sw-cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #555;
  border-radius: 24px;
  transition: 0.2s;
}

.sw-cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #f2f2f2;
  border-radius: 50%;
  transition: 0.2s;
}

.sw-cookie-toggle input:checked + .sw-cookie-toggle-slider {
  background-color: #d18500;
}

.sw-cookie-toggle input:checked + .sw-cookie-toggle-slider:before {
  transform: translateX(20px);
}

.sw-cookie-toggle input:disabled + .sw-cookie-toggle-slider {
  background-color: #d18500;
  opacity: 0.5;
  cursor: not-allowed;
}

.sw-cookie-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- Floating re-open tab ---------- */
#sw-cookie-reopen {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 99998;
  background: #1c1c1c;
  border: 1.5px solid #d18500;
  color: #d18500;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  font-size: 18px;
  padding: 0;
  font-family: inherit;
  line-height: 1;
}

#sw-cookie-reopen.sw-cookie-show {
  display: flex;
}

#sw-cookie-reopen:hover {
  background: #d18500;
  color: #1c1c1c;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  #sw-cookie-banner {
    padding: 14px 16px;
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .sw-cookie-inner {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
  }

  .sw-cookie-text {
    /* On desktop "flex: 1 1 420px" sets a preferred WIDTH (row layout).
       Once flex-direction switches to column above, that same 420px
       basis applies to HEIGHT instead — forcing a tall, mostly-empty
       box. Reset it to natural content height here. */
    flex: 0 1 auto;
    width: 100%;
    font-size: 13px;
  }

  .sw-cookie-actions {
    justify-content: stretch;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  .sw-cookie-btn {
    text-align: center;
    min-height: 44px;
    padding: 12px 16px;
    box-sizing: border-box;
  }

  .sw-cookie-btn-settings {
    order: -1;
    flex: 1 0 100%;
    min-height: 40px;
  }

  .sw-cookie-btn-decline,
  .sw-cookie-btn-accept {
    flex: 1 1 calc(50% - 5px);
  }

  #sw-cookie-modal {
    max-width: 100%;
    max-height: 85vh;
    padding: 20px;
  }

  .sw-cookie-category {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .sw-cookie-toggle {
    width: 48px;
    height: 28px;
    align-self: flex-start;
  }

  .sw-cookie-toggle-slider:before {
    height: 22px;
    width: 22px;
  }

  .sw-cookie-modal-footer {
    flex-direction: column-reverse;
  }

  .sw-cookie-modal-footer .sw-cookie-btn {
    width: 100%;
  }

  #sw-cookie-reopen {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
  }
}

@media (max-width: 380px) {
  #sw-cookie-banner {
    padding: 14px 12px;
  }

  .sw-cookie-text {
    font-size: 12.5px;
    line-height: 1.45;
  }

  .sw-cookie-btn {
    font-size: 13px;
  }

  #sw-cookie-modal {
    padding: 16px;
  }
}
