/*
  Silktide Consent Manager - https://silktide.com/consent-manager/
  Customized to match Miss März website design
*/

/* --------------------------------
  Global Styles
-------------------------------- */
/* Wrapper (Global) */
#stcm-wrapper {
  --boxShadow: 0 30px 80px rgba(28, 36, 33, 0.18);
  --fontFamily: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --primaryColor: #2e454d;
  --backgroundColor: #f4efe7;
  --textColor: #1c2421;
  --textColorSoft: #4a5450;
  --backdropBackgroundColor: rgba(28, 36, 33, 0.35);
  --backdropBackgroundBlur: 1px;
  --iconColor: #f4efe7;
  --iconBackgroundColor: #2e454d;
  --accentWarm: #b8895f;
  position: fixed;
  bottom: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 99999;
  pointer-events: none;
  border: 0px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --------------------------------
Links
-------------------------------- */
#stcm-wrapper a {
  all: unset;
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
  transition: color 0.25s ease;
  cursor: pointer;
}

#stcm-wrapper a:hover {
  cursor: pointer;
  color: var(--accentWarm);
}

/* --------------------------------
Focus Styles
-------------------------------- */
#stcm-wrapper a:focus,
#stcm-wrapper #stcm-banner button:focus,
#stcm-wrapper #stcm-modal button:focus,
#stcm-wrapper #stcm-icon:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--backgroundColor), 0 0 0 3px var(--primaryColor);
  border-radius: 2px;
}

#stcm-wrapper #stcm-icon:focus {
  border-radius: 50%;
}

/* --------------------------------
General Styles
-------------------------------- */
#stcm-wrapper .stcm-button {
  color: var(--backgroundColor);
  background-color: var(--primaryColor);
  border: 1px solid var(--primaryColor);
  padding: 12px 24px;
  text-decoration: none;
  text-align: center;
  display: inline-block;
  font-size: 13px;
  line-height: 18px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0;
  transition: all 0.25s ease;
  font-family: var(--fontFamily);
}

#stcm-wrapper .stcm-button-primary:hover {
  background-color: var(--backgroundColor);
  color: var(--primaryColor);
  border-color: var(--primaryColor);
}

#stcm-wrapper .stcm-button-secondary {
  background-color: transparent;
  color: var(--primaryColor);
  border: 1px solid var(--primaryColor);
}

#stcm-wrapper .stcm-button-secondary:hover {
  background-color: var(--primaryColor);
  color: var(--backgroundColor);
}

/* --------------------------------
Banner
-------------------------------- */
#stcm-banner {
  font-family: var(--fontFamily);
  color: var(--textColor);
  background-color: var(--backgroundColor);
  box-sizing: border-box;
  padding: 40px;
  border-radius: 0;
  pointer-events: auto;
  border: 1px solid rgba(28, 36, 33, 0.12);
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  width: 100%;
  overflow: auto;
  max-width: none;
  max-height: calc(100vh - 0px);
  transform: translate(0, 20px);
  opacity: 0;
  animation: stcm-slide-down 400ms ease-out;
  animation-delay: 0.4s;
  box-shadow: var(--boxShadow);
}

#stcm-banner.stcm-loaded {
  opacity: 1;
  transform: none;
  animation: none;
}

#stcm-banner:focus {
  border-radius: 50%;
}

@media (min-width: 768px) {
  #stcm-banner {
    width: auto;
    right: 0;
    left: auto;
    max-width: 500px;
  }
}

#stcm-banner.stcm-pos-center {
  top: 50%;
  left: 50%;
  bottom: auto;
  right: auto;
  position: fixed;
  width: calc(100% - 40px);
  max-width: 600px;
  transform: translate(-50%, calc(-50% + 20px));
  animation: stcm-slide-down-center 400ms ease-out forwards;
}

#stcm-banner.stcm-pos-bottom-left {
  bottom: 0;
  left: 0;
  right: auto;
  position: fixed;
  width: 100%;
  max-width: none;
}

@media (min-width: 640px) {
  #stcm-banner.stcm-pos-bottom-left {
    bottom: 24px;
    left: 24px;
    width: auto;
    max-width: 500px;
  }
}

#stcm-banner.stcm-pos-bottom-center {
  bottom: 0;
  left: 0;
  right: 0;
  position: fixed;
  width: 100%;
  max-width: none;
  transform: translate(0, 20px);
  animation: stcm-slide-down-bottom-center 400ms ease-out forwards;
}

@media (min-width: 640px) {
  #stcm-banner.stcm-pos-bottom-center {
    bottom: 24px;
    left: 50%;
    width: auto;
    max-width: 500px;
    transform: translate(-50%, 20px);
  }
}

#stcm-banner .stcm-preferences-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--primaryColor);
  padding: 12px 24px;
  background-color: transparent;
  color: var(--primaryColor);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: var(--fontFamily);
  transition: all 0.25s ease;
  border-radius: 0;
}

#stcm-banner .stcm-preferences-button span {
  display: block;
  white-space: nowrap;
  text-decoration: none;
}

#stcm-banner .stcm-preferences-button:hover {
  background-color: var(--primaryColor);
  color: var(--backgroundColor);
}

#stcm-banner p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--textColor);
  margin: 0px 0px 20px;
}

#stcm-banner a {
  display: inline-block;
  color: var(--primaryColor);
  text-decoration: underline;
  background-color: transparent;
  transition: color 0.25s ease;
}

#stcm-banner a:hover {
  color: var(--accentWarm);
}

#stcm-banner a.stcm-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  fill: var(--primaryColor);
  width: 40px;
  height: 40px;
  text-decoration: none;
  transition: fill 0.25s ease;
}

#stcm-banner a.stcm-logo:hover {
  fill: var(--accentWarm);
}

#stcm-banner .stcm-actions {
  display: flex;
  gap: 16px;
  flex-direction: column;
  margin-top: 28px;
}

@media (min-width: 640px) {
  #stcm-banner .stcm-actions {
    flex-direction: row;
    align-items: center;
  }
}

#stcm-banner .stcm-actions-row {
  display: flex;
  gap: 12px;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  flex-grow: 0;
}

/* --------------------------------
Modal
-------------------------------- */
#stcm-modal {
  display: none;
  pointer-events: auto;
  overflow: auto;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  border: 1px solid rgba(28, 36, 33, 0.12);
  transform: translate(0px, 20px);
  opacity: 0;
  animation: stcm-slide-up-center 400ms ease-out forwards;
  box-shadow: var(--boxShadow);
  font-family: var(--fontFamily);
  color: var(--textColor);
  flex-direction: column;
  padding: 40px;
  background-color: var(--backgroundColor);
  border-radius: 0;
  box-sizing: border-box;
}

/* --------------------------------
Modal - Header
-------------------------------- */
#stcm-modal header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  gap: 24px;
}

#stcm-modal h1 {
  font-family: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  color: var(--textColor);
  font-size: 32px;
  font-weight: 400;
  margin: 0px;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

#stcm-modal .stcm-modal-close {
  display: inline-flex;
  border: none;
  padding: 8px;
  cursor: pointer;
  background: transparent;
  color: var(--textColor);
  transition: color 0.25s ease;
  flex-shrink: 0;
}

#stcm-modal .stcm-modal-close:hover {
  color: var(--accentWarm);
}

#stcm-modal .stcm-modal-close svg {
  fill: currentColor;
}

/* --------------------------------
Modal - Content
-------------------------------- */
#stcm-modal section {
  flex: 1;
  margin-top: 24px;
}

#stcm-modal section::-webkit-scrollbar {
  display: block;
  width: 6px;
}

#stcm-modal section::-webkit-scrollbar-thumb {
  background-color: rgba(28, 36, 33, 0.2);
  border-radius: 3px;
}

#stcm-modal section::-webkit-scrollbar-thumb:hover {
  background-color: rgba(28, 36, 33, 0.3);
}

#stcm-modal p {
  font-size: 15px;
  line-height: 1.55;
  color: var(--textColorSoft);
  margin: 0px 0px 16px;
}

#stcm-modal p:last-of-type {
  margin: 0px;
}

#stcm-modal fieldset {
  padding: 0px;
  border: none;
  margin: 0px 0px 32px;
}

#stcm-modal fieldset:last-of-type {
  margin: 0px;
}

#stcm-modal legend {
  padding: 0px;
  margin: 0px 0px 16px;
  font-weight: 500;
  color: var(--textColor);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

#stcm-modal .stcm-consent-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;  
}

/* --------------------------------
Modal - Switches
-------------------------------- */
#stcm-modal .stcm-toggle {
  flex-shrink: 0;
  position: relative;
  display: inline-block;
  height: 32px;
  width: 68px;
  cursor: pointer;
}

#stcm-modal .stcm-toggle:focus-within {
  outline: none;
  box-shadow: 0 0 0 2px var(--backgroundColor), 0 0 0 3px var(--primaryColor);
  border-radius: 20px;
}

#stcm-modal .stcm-toggle input {
  opacity: 0;
  position: absolute;
}

/* Unchecked Switch Styles */
#stcm-modal .stcm-toggle-track {
  position: relative;
  display: block;
  height: 32px;
  width: 68px;
  background: rgba(28, 36, 33, 0.15);
  border-radius: 20px;
}

#stcm-modal .stcm-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  display: block;
  height: 28px;
  width: 28px;
  background: var(--backgroundColor);
  border-radius: 50%;
  transition: left 180ms ease-out;
}

#stcm-modal .stcm-toggle-off,
#stcm-modal .stcm-toggle-on {
  text-transform: uppercase;
  font-size: 10px;
  font-weight: 600;
  color: var(--textColorSoft);
  position: absolute;
  top: 8px;
  right: 6px;
  transition: right 180ms ease-out, opacity 180ms ease-out;
  letter-spacing: 0.05em;
}

#stcm-modal .stcm-toggle-off {
  opacity: 1;
}

#stcm-modal .stcm-toggle-on {
  opacity: 0;
}

/* Checked Switch Styles */
#stcm-modal .stcm-toggle input:checked + .stcm-toggle-track {
  background: var(--primaryColor);
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-thumb {
  left: calc(100% - 30px);
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-off {
  right: calc(100% - 28px);
  opacity: 0;
}

#stcm-modal .stcm-toggle input:checked ~ .stcm-toggle-on {
  right: calc(100% - 28px);
  opacity: 1;
  color: var(--backgroundColor);
}

#stcm-modal .stcm-toggle input:disabled + .stcm-toggle-track {
  opacity: 0.4;
  cursor: not-allowed;
}

/* --------------------------------
Modal - Footer
-------------------------------- */
#stcm-modal footer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(28, 36, 33, 0.08);
}

@media (min-width: 640px) {
  #stcm-modal footer {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

#stcm-modal footer a {
  padding: 0;
}

#stcm-modal footer a.stcm-credit-link {
  text-decoration: none;
  font-size: 13px;
  color: var(--textColorSoft);
  transition: color 0.25s ease;
}

#stcm-modal footer a.stcm-credit-link:hover {
  color: var(--accentWarm);
}

/* Cookie Icon */
#stcm-icon {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 24px;
  justify-content: center;
  align-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  padding: 0px;
  border: none;
  background-color: var(--primaryColor);
  cursor: pointer;
  box-shadow: var(--boxShadow);
  pointer-events: auto;
  animation: stcm-fade-in 0.4s ease-in-out forwards;
  transition: all 0.25s ease;
}

#stcm-icon:hover {
  background-color: var(--accentWarm);
  transform: scale(1.05);
}

#stcm-icon.stcm-pos-bottom-right {
  left: auto;
  right: 24px;
}

#stcm-icon svg {
  fill: var(--iconColor);
}

/* --------------------------------
Backdrop
-------------------------------- */
#stcm-backdrop {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--backdropBackgroundColor);
  backdrop-filter: blur(var(--backdropBackgroundBlur));
  pointer-events: all;
  animation: stcm-fade-in 300ms ease-out forwards;
}

/* --------------------------------
Animations
-------------------------------- */
@keyframes stcm-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes stcm-slide-down {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stcm-slide-down-center {
  from {
    opacity: 0;
    transform: translate(-50%, calc(-50% + 20px));
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes stcm-slide-down-bottom-center {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes stcm-slide-up-center {
  from {
    opacity: 0;
    transform: translate(0px, -20px);
  }
  to {
    opacity: 1;
    transform: translate(0px, 0px);
  }
}

/* --------------------------------
Animation - backdrop click feedback
-------------------------------- */
@keyframes stcm-nudge {
  0%, 100% { right: 16px; }
  10%, 30%, 50%, 70%, 90% { right: 20px; }
  20%, 40%, 60%, 80% { right: 12px; }
}

/* Apply to banner */
#stcm-banner.stcm-nudge {
  animation: stcm-nudge 1s ease-in-out;
}

/* Apply to modal */
#stcm-modal.stcm-nudge {
  animation: stcm-nudge 0.5s ease-in-out;
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  #stcm-banner.stcm-nudge,
  #stcm-modal.stcm-nudge {
    animation: stcm-pulse 0.5s ease-in-out;
  }
  
  @keyframes stcm-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
  }
}
