/* Silktide Cookie Banner Styles - Matching m²indesign Design System */

/* Backdrop */
#silktide-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background-color: rgba(43, 40, 37, 0.5);
  backdrop-filter: blur(2px);
  display: none;
}

/* Banner - Bottom right corner */
#silktide-banner {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  top: auto;
  left: auto;
  transform: none;
  z-index: 9999;
  background-color: hsl(40, 20%, 98%);
  border: 1px solid hsl(35, 15%, 85%);
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(43, 40, 37, 0.15);
  font-family: inherit;
  max-width: 420px;
  width: calc(100% - 3rem);
  border-radius: 4px;
}

#silktide-banner p {
  color: hsl(30, 8%, 25%);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1rem 0;
  max-width: 800px;
}

#silktide-banner .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

#silktide-banner .actions-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Primary Buttons - Charcoal outlined style */
#silktide-banner .st-button--primary {
  background-color: transparent;
  color: hsl(30, 8%, 15%);
  border: 2px solid hsl(30, 8%, 15%);
  padding: 0.625rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.025em;
  border-radius: 4px;
}

#silktide-banner .st-button--primary:hover {
  background-color: hsl(30, 8%, 15%);
  color: hsl(38, 30%, 96%);
}

#silktide-banner .st-button--primary:focus {
  outline: 2px solid hsl(30, 8%, 15%);
  outline-offset: 2px;
}

/* Preferences Link */
#silktide-banner .preferences {
  background: transparent;
  border: none;
  color: hsl(30, 8%, 35%);
  padding: 0.625rem 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

#silktide-banner .preferences:hover {
  color: hsl(30, 8%, 15%);
  text-decoration: underline;
}

#silktide-banner .preferences::after {
  content: " >";
}

/* Hide Silktide Logo */
#silktide-banner .silktide-logo {
  display: none !important;
}

/* Modal */
#silktide-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  background-color: hsl(40, 20%, 98%);
  border: 1px solid hsl(35, 15%, 85%);
  width: 90%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  display: none;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(43, 40, 37, 0.15);
}

#silktide-modal header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 1.5rem 1.5rem 1rem;
  border-bottom: 1px solid hsl(35, 15%, 85%);
}

#silktide-modal header h2 {
  color: hsl(30, 8%, 15%);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0;
}

#silktide-modal .modal-close {
  background: transparent;
  border: none;
  padding: 0.5rem;
  cursor: pointer;
  color: hsl(30, 8%, 45%);
  transition: color 0.3s ease;
}

#silktide-modal .modal-close:hover {
  color: hsl(30, 8%, 15%);
}

#silktide-modal .modal-close svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

#silktide-modal > p {
  color: hsl(30, 8%, 35%);
  font-size: 0.9rem;
  line-height: 1.6;
  padding: 1rem 1.5rem;
  margin: 0;
}

/* Cookie Preferences Section */
#cookie-preferences {
  padding: 0 1.5rem 1rem;
}

#cookie-preferences fieldset {
  border: 1px solid hsl(35, 15%, 85%);
  padding: 1rem;
  margin: 0 0 0.75rem 0;
  background-color: hsl(0, 0%, 100%);
}

#cookie-preferences legend {
  color: hsl(30, 8%, 15%);
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0 0.5rem;
}

#cookie-preferences .cookie-type-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

#cookie-preferences .cookie-type-description {
  color: hsl(30, 8%, 45%);
  font-size: 0.85rem;
  line-height: 1.5;
  flex: 1;
}

/* Toggle Switch - Fixed Layout */
#cookie-preferences .switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
}

#cookie-preferences .switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

#cookie-preferences .switch__pill {
  position: absolute;
  inset: 0;
  background-color: hsl(35, 15%, 80%);
  border-radius: 14px;
  transition: background-color 0.3s ease;
}

#cookie-preferences .switch__dot {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: left 0.3s ease;
  z-index: 2;
}

#cookie-preferences .switch input:checked + .switch__pill {
  background-color: hsl(30, 8%, 25%);
}

#cookie-preferences .switch input:checked ~ .switch__dot {
  left: 28px;
}

#cookie-preferences .switch input:disabled + .switch__pill {
  background-color: hsl(30, 8%, 25%);
  opacity: 0.7;
}

#cookie-preferences .switch input:disabled ~ .switch__dot {
  opacity: 0.9;
}

/* Hide On/Off text labels */
#cookie-preferences .switch__off,
#cookie-preferences .switch__on {
  display: none;
}

/* Modal Footer */
#silktide-modal footer {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.5rem 1.5rem;
  border-top: 1px solid hsl(35, 15%, 85%);
  background-color: hsl(38, 30%, 96%);
}

#silktide-modal footer .st-button--primary {
  background-color: transparent;
  color: hsl(30, 8%, 15%);
  border: 2px solid hsl(30, 8%, 15%);
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  border-radius: 4px;
}

#silktide-modal footer .st-button--primary:hover {
  background-color: hsl(30, 8%, 15%);
  color: hsl(38, 30%, 96%);
}

/* Cookie Icon */
#silktide-cookie-icon {
  position: fixed;
  bottom: 1.25rem;
  left: 1.25rem;
  z-index: 9997;
  width: 48px;
  height: 48px;
  background-color: hsl(30, 8%, 15%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(43, 40, 37, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#silktide-cookie-icon:hover {
  background-color: hsl(30, 8%, 25%);
  transform: scale(1.05);
}

#silktide-cookie-icon svg {
  width: 24px;
  height: 24px;
  fill: hsl(38, 30%, 96%);
}

/* Position variants */
#silktide-cookie-icon.bottom-right {
  left: auto;
  right: 1.25rem;
}

#silktide-banner.top {
  bottom: auto;
  top: 0;
  border-top: none;
  border-bottom: 1px solid hsl(35, 15%, 85%);
  box-shadow: 0 4px 20px rgba(43, 40, 37, 0.08);
}

/* Responsive - Mobile */
@media (max-width: 640px) {
  #silktide-banner {
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
    width: auto;
    max-width: none;
    padding: 1.25rem 1rem;
    border-radius: 6px;
  }

  #silktide-banner p {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  #silktide-banner .actions {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  #silktide-banner .actions-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #silktide-banner .st-button--primary {
    width: 100%;
    text-align: center;
    padding: 0.875rem 1rem;
    font-size: 0.9rem;
  }

  #silktide-banner .preferences {
    padding: 0.625rem;
    text-align: center;
    width: 100%;
  }

  #silktide-modal {
    width: 94%;
    max-height: 80vh;
    border-radius: 8px;
  }

  #silktide-modal header,
  #silktide-modal > p,
  #cookie-preferences,
  #silktide-modal footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #silktide-modal header {
    padding-top: 1rem;
    padding-bottom: 0.75rem;
  }

  #silktide-modal header h2 {
    font-size: 1.1rem;
  }

  #cookie-preferences .cookie-type-content {
    flex-direction: column;
    gap: 0.75rem;
  }

  #cookie-preferences .switch {
    align-self: flex-start;
  }

  #cookie-preferences fieldset {
    padding: 0.75rem;
  }

  #cookie-preferences legend {
    font-size: 0.9rem;
  }

  #cookie-preferences .cookie-type-description {
    font-size: 0.8rem;
  }

  #silktide-modal footer {
    flex-direction: column;
    padding: 0.75rem 1rem 1rem;
  }

  #silktide-modal footer .st-button--primary {
    padding: 0.875rem 1rem;
  }

  #silktide-cookie-icon {
    width: 44px;
    height: 44px;
    bottom: 1rem;
    left: 1rem;
  }

  #silktide-cookie-icon svg {
    width: 20px;
    height: 20px;
  }
}

/* Responsive - Tablet (iPad) */
@media (min-width: 641px) and (max-width: 1024px) {
  #silktide-banner {
    bottom: 1.25rem;
    right: 1.25rem;
    max-width: 380px;
    padding: 1.5rem;
    border-radius: 6px;
  }

  #silktide-banner p {
    font-size: 0.875rem;
    line-height: 1.55;
  }

  #silktide-banner .actions {
    gap: 0.625rem;
  }

  #silktide-banner .st-button--primary {
    padding: 0.75rem 1.25rem;
  }

  #silktide-modal {
    max-width: 480px;
    border-radius: 8px;
  }

  #silktide-cookie-icon {
    width: 46px;
    height: 46px;
    bottom: 1.25rem;
    left: 1.25rem;
  }
}
