/* Sticky CTA Bar - Shared Component */

:root {
  --cta-bg: #F85602;
  --cta-text: #FFF8F5;
  --cta-border-radius: 4px;
  --cta-mobile-height: 56px;
  --cta-desktop-width: 80px;
  --cta-desktop-height: 44px;
}

.sticky-cta-bar {
  position: fixed;
  z-index: 999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif;
  font-weight: 600;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
}

.sticky-cta-bar.visible {
  display: flex;
  opacity: 1;
}

/* Mobile: Bottom Bar (56px) */
@media (max-width: 768px) {
  .sticky-cta-bar {
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--cta-mobile-height);
    background-color: var(--cta-bg);
    border-radius: 0;
    align-items: center;
    justify-content: center;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.12);
    padding: 0 16px;
  }

  .sticky-cta-bar__content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 100%;
  }

  .sticky-cta-bar__text {
    color: var(--cta-text);
    font-size: 14px;
    line-height: 1;
    margin: 0;
    flex: 1;
  }

  .sticky-cta-bar__cta {
    background-color: transparent;
    color: var(--cta-text);
    border: none;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: var(--cta-border-radius);
    cursor: pointer;
    white-space: nowrap;
    margin-left: 8px;
    text-decoration: none;
    display: inline-block;
    transition: opacity 0.2s ease;
  }

  .sticky-cta-bar__cta:hover {
    opacity: 0.9;
  }

  .sticky-cta-bar__close {
    background-color: transparent;
    border: none;
    color: var(--cta-text);
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    transition: opacity 0.2s ease;
  }

  .sticky-cta-bar__close:hover {
    opacity: 0.8;
  }
}

/* Desktop: Compact Bar (bottom-right, 80x44px) */
@media (min-width: 769px) {
  .sticky-cta-bar {
    bottom: 20px;
    right: 20px;
    width: var(--cta-desktop-width);
    height: var(--cta-desktop-height);
    background-color: var(--cta-bg);
    border-radius: var(--cta-border-radius);
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 0;
  }

  .sticky-cta-bar__content {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    flex-direction: column;
    padding: 0 8px;
  }

  .sticky-cta-bar__text {
    display: none;
  }

  .sticky-cta-bar__cta {
    background-color: transparent;
    color: var(--cta-text);
    border: none;
    font-size: 12px;
    font-weight: 700;
    padding: 0;
    border-radius: 0;
    cursor: pointer;
    white-space: nowrap;
    margin: 0;
    text-decoration: none;
    display: block;
    line-height: 1.2;
    text-align: center;
    transition: opacity 0.2s ease;
  }

  .sticky-cta-bar__cta:hover {
    opacity: 0.9;
  }

  .sticky-cta-bar__close {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: transparent;
    border: none;
    color: var(--cta-text);
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
  }

  .sticky-cta-bar__close:hover {
    opacity: 0.8;
  }
}

/* Accessibility */
.sticky-cta-bar__cta:focus,
.sticky-cta-bar__close:focus {
  outline: 2px solid rgba(255, 248, 245, 0.4);
  outline-offset: 2px;
}

/* Print: Hide CTA Bar */
@media print {
  .sticky-cta-bar {
    display: none !important;
  }
}
