
/* Floating Manage Preferences Button */
body button#cpl-floating-btn.cpl-floating-btn {
    position: fixed; bottom: 20px; z-index: 9997; 
    background-color: var(--cpl-ucp-float-bg) !important; 
    color: var(--cpl-ucp-float-color) !important;
    width: 44px; height: 44px; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none; padding: 0;
}
body button#cpl-floating-btn.cpl-floating-btn:hover { 
    transform: scale(1.05); box-shadow: 0 6px 14px rgba(0,0,0,0.3); 
}
body button#cpl-floating-btn.cpl-floating-btn:focus-visible { 
    outline: 2px solid var(--cpl-ucp-float-color) !important; outline-offset: 4px; 
}
body button#cpl-floating-btn.cpl-floating-btn svg {
    fill: none !important;
    stroke: var(--cpl-ucp-float-color) !important;
    color: var(--cpl-ucp-float-color) !important;
}
body .cpl-pos-bottom-left { left: 20px; }
body .cpl-pos-bottom-right { right: 20px; }

/* Banner Styles */
body div#cpl-user-cookie-preferences-banner.cpl-user-cookie-preferences-banner {
  position: fixed;
  bottom: 0; left: 0; width: 100%;
  background-color: var(--cpl-ucp-banner-bg) !important;
  color: var(--cpl-ucp-banner-text) !important;
  box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
  z-index: 9998;
  padding: 15px 20px;
  box-sizing: border-box;
  font-family: inherit;
}
body .cpl-user-cookie-preferences-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
body .cpl-user-cookie-preferences-banner-text-wrap { 
  margin: 0 20px 0 0; 
  flex: 1; 
  min-width: 250px; 
  font-size: 14px; 
  color: var(--cpl-ucp-banner-text) !important; 
}
body .cpl-user-cookie-preferences-banner-text-wrap p,
body .cpl-user-cookie-preferences-banner-text-wrap a { 
    color: var(--cpl-ucp-banner-text) !important; 
}
body .cpl-user-cookie-preferences-banner-text-wrap p { 
    margin: 0 0 10px 0; 
}
body .cpl-user-cookie-preferences-banner-text-wrap p:last-child { margin: 0; }
body .cpl-user-cookie-preferences-banner-buttons { display: flex; gap: 10px; }

/* Modal Overlay Styles */
body div#cpl-user-cookie-preferences-overlay.cpl-user-cookie-preferences-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background-color: var(--cpl-ucp-overlay) !important;
  z-index: 9999;
  justify-content: center;
  align-items: center;
  font-family: inherit;
}

/* Modal Box */
body div.cpl-user-cookie-preferences-modal {
  position: relative;
  background-color: var(--cpl-ucp-modal-bg) !important;
  color: var(--cpl-ucp-modal-text) !important;
  padding: 30px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  box-sizing: border-box;
}

/* Close Button */
body button#cmp-close-modal.cpl-user-cookie-preferences-close {
  position: absolute;
  top: 12px; right: 15px;
  background: none; border: none; padding: 0;
  font-size: 24px; font-weight: bold;
  cursor: pointer; 
  color: var(--cpl-ucp-modal-text) !important;
  line-height: 1; opacity: 0.5; transition: opacity 0.2s;
  -webkit-user-select: none; user-select: none;
}
body button#cmp-close-modal.cpl-user-cookie-preferences-close:hover { opacity: 1; }
body button#cmp-close-modal.cpl-user-cookie-preferences-close:focus-visible { 
    outline: 2px solid currentColor; outline-offset: 4px; opacity: 1; 
}

body div.cpl-user-cookie-preferences-modal h2 { 
    margin-top: 0; font-size: 20px; 
    color: var(--cpl-ucp-modal-text) !important; 
    padding-right: 20px; 
}
body div.cpl-user-cookie-preferences-modal-desc,
body div.cpl-user-cookie-preferences-modal-desc p,
body div.cpl-user-cookie-preferences-modal-desc a { 
    color: var(--cpl-ucp-modal-text) !important; 
}
body div.cpl-user-cookie-preferences-modal-desc { 
    font-size: 14px; margin-bottom: 20px; 
}
body div.cpl-user-cookie-preferences-modal-desc p { margin: 0 0 10px 0; }
body div.cpl-user-cookie-preferences-modal-desc p:last-child { margin-bottom: 0; }

/* Developer Credit */
body div.cpl-user-cookie-preferences-credit { 
    font-size: 11px; text-align: center; margin-top: 20px; opacity: 0.8; 
    color: var(--cpl-ucp-modal-text) !important;
}
body div.cpl-user-cookie-preferences-credit a { 
    color: var(--cpl-ucp-modal-text) !important; 
    text-decoration: underline; 
}
body div.cpl-user-cookie-preferences-credit a:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }

/* Toggle Rows & Cookie Info */
body .cpl-user-cookie-preferences-toggles {
    transition: max-height 0.4s ease-in, opacity 0.4s ease-in;
    max-height: 2000px;
    opacity: 1;
    overflow: hidden;
}
body .cpl-user-cookie-preferences-toggles.cpl-toggles-collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
}
body .cpl-user-cookie-preferences-toggles.cpl-no-transition {
    transition: none !important;
}
body .cpl-toggle-wrapper { margin-bottom: 15px; }
body .cpl-user-cookie-preferences-toggle-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; font-weight: 500;
  -webkit-user-select: none; user-select: none;
}

/* Separator Logic */
body .cpl-has-separators .cpl-toggle-wrapper {
    border-bottom: 1px solid var(--cpl-ucp-separator);
    padding-bottom: 15px;
}
body .cpl-has-separators .cpl-toggle-wrapper:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Accordion Details */
body .cpl-cookie-details { 
    font-size: 13px; color: var(--cpl-ucp-modal-text) !important; 
    opacity: 0.8; margin-top: 8px; line-height: 1.4; 
}
body .cpl-cookie-details summary { 
    cursor: pointer; font-size: 12px; opacity: 0.8; user-select: none; outline: none; 
    display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 5px; 
    border-radius: 2px; color: var(--cpl-ucp-modal-text) !important;
}
body .cpl-cookie-details summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; opacity: 1; }
body .cpl-cookie-details summary::-webkit-details-marker { display: none; }
body .cpl-cookie-details summary::after {
    content: ""; display: block; width: 5px; height: 5px;
    border-bottom: 2px solid currentColor; border-right: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg); transition: transform 0.3s ease;
}
body .cpl-cookie-details[open] summary::after {
    transform: translateY(2px) rotate(-135deg);
}
body .cpl-cookie-info-text p,
body .cpl-cookie-info-text a {
    color: var(--cpl-ucp-modal-text) !important;
}
body .cpl-cookie-info-text p { margin: 0 0 8px 0; }
body .cpl-cookie-info-text p:last-child { margin: 0; }

/* Buttons */
body .cpl-user-cookie-preferences-buttons { display: flex; justify-content: space-between; margin-top: 25px; gap: 10px; }

/* Highly specific selector for all buttons to override theme block styles */
body button.cpl-user-cookie-preferences-btn {
  flex: 1; padding: 10px 15px; border: none; border-radius: 4px;
  cursor: pointer; font-weight: bold; transition: 0.2s; text-align: center; font-size: 14px;
  -webkit-user-select: none; user-select: none;
  text-decoration: none !important;
}
body button.cpl-user-cookie-preferences-btn:hover { opacity: 0.85; }
body button.cpl-user-cookie-preferences-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; opacity: 1; }

/* Specific Button Colours using ID and Class for massive specificity */
body button#cmp-banner-allow-all.cpl-user-cookie-preferences-btn,
body button.cpl-user-cookie-preferences-btn-banner-allow-all { 
    background-color: var(--cpl-ucp-banner-btn-all-bg) !important; 
    color: var(--cpl-ucp-banner-btn-all-text) !important; 
}

body button#cmp-banner-prefs.cpl-user-cookie-preferences-btn,
body button.cpl-user-cookie-preferences-btn-banner-prefs { 
    background-color: var(--cpl-ucp-banner-btn-prefs-bg) !important; 
    color: var(--cpl-ucp-banner-btn-prefs-text) !important; 
}

body button#cmp-allow-all.cpl-user-cookie-preferences-btn,
body button.cpl-user-cookie-preferences-btn-modal-allow-all { 
    background-color: var(--cpl-ucp-modal-btn-all-bg) !important; 
    color: var(--cpl-ucp-modal-btn-all-text) !important; 
}

body button#cmp-allow-selection.cpl-user-cookie-preferences-btn,
body button.cpl-user-cookie-preferences-btn-modal-allow-sel { 
    background-color: var(--cpl-ucp-modal-btn-sel-bg) !important; 
    color: var(--cpl-ucp-modal-btn-sel-text) !important; 
}

/* The Switch */
body .cpl-switch { 
    position: relative; display: inline-block; width: 44px; height: 24px; 
    -webkit-user-select: none; user-select: none;
}
body .cpl-switch input { opacity: 0; width: 0; height: 0; }
body .cpl-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #ccc; transition: .4s; border-radius: 24px;
  -webkit-user-select: none; user-select: none;
}
body .cpl-slider:before {
  position: absolute; content: ""; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background-color: white; transition: .4s; border-radius: 50%;
}
body input:checked + .cpl-slider { background-color: var(--cpl-ucp-toggle-on) !important; }
body input:disabled + .cpl-slider { opacity: 0.6; cursor: not-allowed; }
body input:checked + .cpl-slider:before { transform: translateX(20px); }
body .cpl-switch input:focus-visible + .cpl-slider { outline: 2px solid var(--cpl-ucp-toggle-on); outline-offset: 2px; }

/* Animations */
body .cpl-user-cookie-preferences-banner.cpl-animated { animation: cplSlideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
body .cpl-user-cookie-preferences-overlay.cpl-animated { animation: cplFadeIn 0.3s ease forwards; }
body .cpl-user-cookie-preferences-overlay.cpl-animated .cpl-user-cookie-preferences-modal { animation: cplPopIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes cplSlideUp { 0% { transform: translateY(100%); opacity: 0; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes cplFadeIn { 0% { opacity: 0; } 100% { opacity: 1; } }
@keyframes cplPopIn { 0% { transform: scale(0.92); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* Responsive Banner */
@media (max-width: 768px) {
  body .cpl-user-cookie-preferences-banner-content { flex-direction: column; align-items: stretch; }
  body .cpl-user-cookie-preferences-banner-text-wrap { margin: 0 0 15px 0; text-align: center; }
  body .cpl-user-cookie-preferences-banner-buttons { flex-direction: column; }
}
