/* ==========================================
   FLOATING ADS — AUTO ALIGN TO THEME WIDTH
===========================================*/

/* Use the theme's container width automatically */
:root {
  --ffa-site-width: var(--theme-normal-container-max-width);
}

/* Base floating ad styles */
.ffa-corner-ad {
  position: fixed;
  box-sizing: border-box;
  width: var(--ffa-w);
  height: var(--ffa-h);
  border-radius: var(--ffa-radius);
  overflow: hidden;
  z-index: var(--ffa-z);
  background: transparent;
}

/* Top corners: still use exact CSS offset given (px or %) */
.ffa-top-left {
  top: var(--ffa-y);
  left: var(--ffa-x);
}

.ffa-top-right {
  top: var(--ffa-y);
  right: var(--ffa-x);
}

/* ==========================================
   BOTTOM CORNERS — ALIGN WITH SITE CONTENT
   Uses theme width + user offset (px or %)
===========================================*/

.ffa-bottom-left {
  bottom: var(--ffa-y);
  left: max(
    var(--ffa-x),
    calc(
      (100vw - var(--ffa-site-width)) / 2 - var(--ffa-w) - var(--ffa-x)
    )
  );
}

.ffa-bottom-right {
  bottom: var(--ffa-y);
  right: calc(
    (100vw - var(--ffa-site-width)) / 2 + var(--ffa-x)
  );
}

/* Optional shadow */
.ffa-shadow {
  box-shadow: 0 12px 28px rgba(0,0,0,0.18), 0 2px 4px rgba(0,0,0,0.08);
}

/* Mobile behavior: fallback to screen edges */
@media (max-width: 900px) {
  .ffa-bottom-left {
    left: var(--ffa-x);
  }
  .ffa-bottom-right {
    right: var(--ffa-x);
  }
}

