/* ============================================================================
   Bottom Banner Component Styles
   ============================================================================ */

.bottom-banner {
  /* CSS Custom Properties / Design Tokens */
  --banner-bg-color: #a7c954;
  --banner-text-color: #ffffff;
  --banner-padding: 1rem 2rem;
  --banner-text-font-size: 1rem;
  --banner-btn-font-size: 1rem;
  --banner-font-family: inherit;
  --banner-z-index: 1000;
  --banner-max-width: 1200px;

  /* Background Image */
  --banner-bg-image: none;
  --banner-bg-size: cover;
  --banner-bg-position: center;
  --banner-bg-repeat: no-repeat;
  --banner-bg-opacity: 0.3;

  /* Animation */
  --banner-transition-duration: 0.3s;
  --banner-animation-duration: 0.5s;

  /* Button Styles */
  --banner-btn-bg: #2563eb;
  --banner-btn-text: #ffffff;
  --banner-btn-hover-bg: #1d4ed8;
  --banner-btn-hover-text: #ffffff;
  --banner-btn-padding: 0.5rem 1rem;
  --banner-btn-border-radius: 0.375rem;

  /* Close Button */
  --banner-close-size: 2rem;
  --banner-close-hover-bg: rgba(255, 255, 255, 0.1);

  /* Shadows */
  --banner-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1), 0 -1px 3px 0 rgba(0, 0, 0, 0.08);

  /* Layout */
  position: fixed;
  bottom: 0;
  bottom: env(safe-area-inset-bottom, 0); /* iOS safe area support */
  left: 0;
  right: 0;
  z-index: var(--banner-z-index);
  display: flex;
  align-items: center;

  /* Visual */
  background-color: var(--banner-bg-color);
  color: var(--banner-text-color);
  box-shadow: var(--banner-shadow);

  /* Background Image Layer */
  background-image: var(--banner-bg-image);
  background-size: var(--banner-bg-size);
  background-position: var(--banner-bg-position);
  background-repeat: var(--banner-bg-repeat);

  /* Animation */
  transform: translateY(100%);
  transition: transform var(--banner-animation-duration) ease-out;

  /* Accessibility */
  font-family: var(--banner-font-family);
}

/* Background image overlay for opacity control */
.bottom-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: var(--banner-bg-image);
  background-size: var(--banner-bg-size);
  background-position: var(--banner-bg-position);
  background-repeat: var(--banner-bg-repeat);
  opacity: var(--banner-bg-opacity);
  pointer-events: none;
  z-index: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

/* Visible state */
.bottom-banner.is-visible {
  transform: translateY(0);
}

/* Content container */
.bottom-banner__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--banner-max-width);
  width: 100%;
  margin: 0 auto;
  padding: var(--banner-padding);
  padding-right: 3.5rem;
  padding-bottom: calc(var(--banner-padding) + env(safe-area-inset-bottom, 0));
  position: relative;
  z-index: 1;
}

/* Text content */
.bottom-banner__text {
  flex: 1;
  margin: 0;
  margin-bottom: 0 !important;
  line-height: 1.5;
  color: var(--banner-text-color);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  font-weight: 600;
  text-align: center;
  font-size: var(--banner-text-font-size);
  padding-bottom: var(--banner-text-padding-bottom, 0);
}

/* Remove bottom margin from paragraphs in text */
.bottom-banner__text p {
  margin-block-end: 0;
}

/* Mobile text visibility - hide by default */
.bottom-banner__text--mobile {
  display: none;
}

/* CTA Button */
.bottom-banner .bottom-banner__cta {
  flex-shrink: 0;
  padding: var(--banner-btn-padding);
  background-color: var(--banner-btn-bg) !important;
  color: var(--banner-btn-text) !important;
  border: none;
  border-radius: var(--banner-btn-border-radius);
  font-size: var(--banner-btn-font-size);
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--banner-transition-duration) ease,
              color var(--banner-transition-duration) ease,
              transform var(--banner-transition-duration) ease;
  white-space: nowrap;
}

.bottom-banner .bottom-banner__cta:hover {
  background-color: var(--banner-btn-hover-bg) !important;
  color: var(--banner-btn-hover-text) !important;
  transform: translateY(-2px);
}

.bottom-banner .bottom-banner__cta:focus {
  outline: 2px solid var(--banner-btn-text);
  outline-offset: 2px;
}

.bottom-banner .bottom-banner__cta:active {
  transform: translateY(0);
}

/* Close Button */
.bottom-banner__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: var(--banner-close-size);
  height: var(--banner-close-size);
  padding: 0;
  background: transparent;
  border: none;
  color: var(--banner-text-color);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 0.25rem;
  transition: background-color var(--banner-transition-duration) ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.bottom-banner__close:hover {
  background-color: var(--banner-close-hover-bg);
}

.bottom-banner__close:focus {
  outline: 2px solid var(--banner-text-color);
  outline-offset: 2px;
}

/* ============================================================================
   Responsive Design
   ============================================================================ */

@media (max-width: 768px) {
  .bottom-banner {
    --banner-padding: 0.875rem 1rem;
    background-image: none; /* Hide desktop background on mobile */
  }

  /* Use mobile background image if provided, otherwise fallback to desktop image */
  .bottom-banner::before {
    background-image: var(--banner-bg-image-mobile, var(--banner-bg-image));
    background-size: cover;
    background-position: center;
  }

  .bottom-banner__content {
    flex-wrap: wrap;
    justify-content: center;
    padding-left: var(--banner-mobile-padding, 1rem);
    padding-right: var(--banner-mobile-padding, 1rem);
  }

  .bottom-banner__text {
    flex-basis: 100%;
    text-align: center;
    /* Use mobile font size if provided, otherwise keep desktop size */
    font-size: var(--banner-text-font-size-mobile, var(--banner-text-font-size));
  }

  .bottom-banner .bottom-banner__cta {
    flex: 0 0 auto;
    width: auto;
    /* Use mobile font size if provided, otherwise keep desktop size */
    font-size: var(--banner-btn-font-size-mobile, var(--banner-btn-font-size));
  }

  /* Show mobile text and hide desktop text on mobile when both exist */
  .bottom-banner__text--mobile {
    display: block;
  }

  .bottom-banner__text--desktop {
    display: none;
  }
}

@media (max-width: 480px) {
  .bottom-banner {
    --banner-padding: 0.75rem;
  }

  .bottom-banner__content {
    gap: 0.75rem;
  }

  .bottom-banner__cta,
  .bottom-banner__close {
    font-size: 0.875rem;
  }
}

/* ============================================================================
   Print Styles
   ============================================================================ */

@media print {
  .bottom-banner {
    display: none;
  }
}

/* ============================================================================
   Reduced Motion
   ============================================================================ */

@media (prefers-reduced-motion: reduce) {
  .bottom-banner {
    transition: none;
  }

  .bottom-banner__cta,
  .bottom-banner__close {
    transition: none;
  }
}
