/* ========== PUBS — styles réutilisables (popups, carrousels) ========== */

.app-banner-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  align-items: stretch;
}

.app-banner-top {
  margin-bottom: 12px;
}

.app-banner-bottom {
  margin-top: 12px;
}

.app-banner-item {
  width: calc(100% - 16px);
  margin: 0 8px;
  cursor: pointer;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  background: #f5f5f5;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  min-height: 90px;
  margin-bottom: 0;
}

.app-banner-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.app-banner-image {
  width: 100%;
  height: auto;
  min-height: 150px;
  max-height: 300px;
  object-fit: cover;
  object-position: center center;
  display: block;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: auto;
}

.app-banner-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 150px;
  color: #999;
  font-size: 14px;
  background: #ffffff;
  padding: 20px;
  transition: background-color 0.3s ease, color 0.3s ease;
}

[data-theme='dark'] .app-banner-error {
  background: var(--bg-secondary);
  color: var(--text-tertiary);
}

@media (max-width: 1024px) {
  .app-banner-item {
    border-radius: 14px;
  }

  .app-banner-image {
    max-height: 250px;
  }
}

@media (max-width: 768px) {
  .app-banner-container {
    gap: 10px;
  }

  .app-banner-item {
    width: calc(100% - 12px);
    margin: 0 6px;
    border-radius: 12px;
    min-height: 120px;
  }

  .app-banner-image {
    min-height: 120px;
    max-height: 200px;
  }
}

@media (min-width: 1920px) {
  .app-banner-item {
    max-width: calc(1400px - 32px);
    margin: 0 auto;
  }

  .app-banner-image {
    max-height: 350px;
  }
}

/* Conteneur hôte (popup ou panneau) — même rendu qu’ancien login-right */
.ad-host .ad-wrapper,
.login-right .ad-wrapper {
  width: 100%;
  height: 100%;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden;
  border-radius: 10px;
}

.ad-host img,
.login-right img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.ad-host .ad-wrapper img,
.login-right .ad-wrapper img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.carousel-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  border-radius: 10px;
}

.carousel-slides {
  display: flex;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
  align-items: stretch;
}

.carousel-slide {
  min-width: 100%;
  width: 100%;
  height: 100%;
  min-height: 100%;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  position: relative;
}

.carousel-slide .ad-wrapper {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
}

.carousel-slide .ad-wrapper img {
  width: 100%;
  height: 100%;
  min-width: 100%;
  min-height: 100%;
  object-fit: cover;
  object-position: center center;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  image-rendering: auto;
}

.carousel-btn {
  display: none;
}

.carousel-indicators {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
  outline: none;
}

.carousel-dot:hover {
  background: rgba(255, 255, 255, 0.5);
  transform: scale(1.2);
}

.carousel-dot.active {
  background: white;
  border-color: white;
  width: 12px;
  height: 12px;
}

@media (max-width: 1024px) {
  .carousel-wrapper {
    border-radius: 14px;
  }
}

@media (max-width: 768px) {
  .carousel-wrapper {
    height: 100%;
    border-radius: 0;
  }

  .carousel-indicators {
    bottom: 15px;
  }
}

@media (max-width: 480px) {
  .carousel-dot {
    width: 8px;
    height: 8px;
  }

  .carousel-dot.active {
    width: 10px;
    height: 10px;
  }
}

@media (min-width: 1920px) {
  .carousel-slide .ad-wrapper img {
    object-fit: contain;
    object-position: center center;
  }
}
