
/* Mantém o seletor da Home com largura estável mesmo quando o título é longo. */
.cpe-home-select-card > div,
section:has(#home-simulator-select-trigger) div[class*="backdrop-blur"] > div {
  min-width: 0;
}

.cpe-home-select-card > div > div:has(> #home-simulator-select-trigger),
section:has(#home-simulator-select-trigger) div[class*="backdrop-blur"] > div > div:has(> #home-simulator-select-trigger) {
  flex: 1 1 0;
  width: auto !important;
  min-width: 0;
  max-width: 100%;
}

#home-simulator-select-trigger {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#home-simulator-select-trigger > span:first-child {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cpe-home-select-card > div > button,
section:has(#home-simulator-select-trigger) div[class*="backdrop-blur"] > div > button {
  flex: 0 0 auto;
}

/* Landing desktop slideshow v2 - escopo limitado à Home e ao card de Landing Page do admin */
.cpe-landing-slideshow,
.cpe-slide-link-overlay,
.cpe-slide-dots {
  display: none;
}

@media (min-width: 1024px) {
  .cpe-home-hero,
  section:has(#home-simulator-select-trigger) {
    min-height: calc(100vh - 72px) !important;
    align-items: center !important;
    justify-content: flex-start !important;
    background: #0b0f19 !important;
  }

  .cpe-home-bg > img:not(.cpe-slide-image),
  section:has(#home-simulator-select-trigger) > div[class*="absolute"][class*="inset-0"] > img:not(.cpe-slide-image) {
    transition: opacity .4s ease;
  }

  .cpe-home-hero.cpe-has-slides .cpe-home-bg > img:not(.cpe-slide-image),
  section.cpe-has-slides:has(#home-simulator-select-trigger) > div[class*="absolute"][class*="inset-0"] > img:not(.cpe-slide-image) {
    opacity: 0 !important;
  }

  .cpe-home-bg > div:not(.cpe-landing-slideshow):not(.cpe-slide-dots),
  section:has(#home-simulator-select-trigger) > div[class*="absolute"][class*="inset-0"] > div:not(.cpe-landing-slideshow):not(.cpe-slide-dots) {
    background: linear-gradient(90deg,
      rgba(7, 10, 18, .94) 0%,
      rgba(7, 10, 18, .88) 32%,
      rgba(7, 10, 18, .66) 49%,
      rgba(7, 10, 18, .25) 68%,
      rgba(7, 10, 18, .08) 100%) !important;
  }

  .cpe-landing-slideshow {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: #0b0f19;
  }

  .cpe-landing-slideshow::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: #05070c;
    opacity: 0;
    transition: opacity .52s ease-in-out;
  }

  .cpe-landing-slideshow.is-darkening::after {
    opacity: 1;
  }

  .cpe-slide-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    transform: scale(1.025);
    transition: opacity .52s ease-in-out, transform 5.5s ease;
    will-change: opacity, transform;
  }

  .cpe-slide-image.is-active {
    opacity: 1;
    transform: scale(1);
  }

  .cpe-slide-link-overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 54%;
    z-index: 9;
    display: block;
    pointer-events: auto;
    text-indent: -9999px;
  }

  .cpe-slide-link-overlay[aria-disabled="true"] {
    pointer-events: none;
  }

  .cpe-slide-dots {
    position: absolute;
    right: clamp(28px, 4vw, 72px);
    bottom: clamp(24px, 4vw, 56px);
    z-index: 11;
    display: flex;
    gap: 10px;
    align-items: center;
    pointer-events: none;
  }

  .cpe-slide-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .48);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .18);
    transition: width .25s ease, background .25s ease;
  }

  .cpe-slide-dot.is-active {
    width: 28px;
    background: rgba(255, 255, 255, .92);
  }

  .cpe-home-content,
  section:has(#home-simulator-select-trigger) > div[class*="container"] {
    width: 100% !important;
    max-width: 1280px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: clamp(28px, 6vw, 92px) !important;
    padding-right: clamp(20px, 5vw, 80px) !important;
    pointer-events: none;
  }

  .cpe-home-copy,
  section:has(#home-simulator-select-trigger) div[class*="max-w-4xl"][class*="text-center"] {
    max-width: 610px !important;
    margin-left: 0 !important;
    margin-right: auto !important;
    text-align: left !important;
    pointer-events: auto;
  }

  .cpe-home-copy h1,
  section:has(#home-simulator-select-trigger) h1 {
    max-width: 610px !important;
    letter-spacing: -0.045em !important;
    text-shadow: 0 18px 52px rgba(0, 0, 0, .45);
  }

  .cpe-home-copy p,
  section:has(#home-simulator-select-trigger) h1 + p {
    max-width: 540px !important;
    color: rgba(226, 232, 240, .92) !important;
  }

  .cpe-home-select-card,
  section:has(#home-simulator-select-trigger) div[class*="backdrop-blur"] {
    margin-left: 0 !important;
    margin-right: auto !important;
    max-width: 590px !important;
    background: rgba(15, 23, 42, .42) !important;
    border-color: rgba(255, 255, 255, .22) !important;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .32) !important;
    pointer-events: auto;
  }
}

/* Painel extra no administrador */
.cpe-admin-slideshow-panel {
  border: 1px solid hsl(var(--border, 214.3 31.8% 91.4%));
  border-radius: 14px;
  background: rgba(15, 23, 42, .035);
  padding: 18px;
  margin: 6px 0 18px;
}

.cpe-admin-slideshow-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid hsl(var(--border, 214.3 31.8% 91.4%));
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.cpe-admin-slideshow-head h3 {
  font-size: 1.125rem;
  font-weight: 650;
  margin: 0 0 4px;
}

.cpe-admin-slideshow-head p,
.cpe-admin-help,
.cpe-admin-status {
  color: hsl(var(--muted-foreground, 215.4 16.3% 46.9%));
  font-size: .875rem;
  margin: 0;
}

.cpe-admin-timer-row {
  display: grid;
  gap: 8px;
  max-width: 280px;
  margin-bottom: 16px;
}

.cpe-admin-timer-row label,
.cpe-slide-field label {
  font-size: .875rem;
  font-weight: 600;
}

.cpe-admin-timer-row input,
.cpe-slide-field input[type="text"],
.cpe-slide-field input[type="number"] {
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid hsl(var(--input, 214.3 31.8% 91.4%));
  background: hsl(var(--background, 0 0% 100%));
  padding: 0 12px;
  font-size: .9rem;
}

.cpe-admin-slides-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 768px) {
  .cpe-admin-slides-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1180px) {
  .cpe-admin-slides-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cpe-slide-field {
  border: 1px solid hsl(var(--border, 214.3 31.8% 91.4%));
  border-radius: 12px;
  background: hsl(var(--background, 0 0% 100%));
  padding: 12px;
  display: grid;
  gap: 10px;
}

.cpe-slide-preview {
  height: 150px;
  border-radius: 10px;
  border: 1px dashed hsl(var(--border, 214.3 31.8% 91.4%));
  background: rgba(148, 163, 184, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: hsl(var(--muted-foreground, 215.4 16.3% 46.9%));
  font-size: .78rem;
  text-align: center;
}

.cpe-slide-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cpe-slide-field input[type="file"] {
  font-size: .85rem;
}

.cpe-slide-actions,
.cpe-admin-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.cpe-admin-footer {
  margin-top: 16px;
}

.cpe-admin-remove {
  border: 0;
  background: transparent;
  color: #dc2626;
  font-size: .82rem;
  padding: 0;
  cursor: pointer;
}

.cpe-admin-save {
  border: 0;
  border-radius: 10px;
  min-height: 42px;
  padding: 0 16px;
  background: hsl(var(--primary, 221.2 83.2% 53.3%));
  color: hsl(var(--primary-foreground, 210 40% 98%));
  font-weight: 650;
  cursor: pointer;
}

.cpe-admin-save:disabled {
  opacity: .65;
  cursor: not-allowed;
}
