/* =============================================================================
   BlueArk Cards — Frontend CSS
   Prefijo: bac-
   =========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset de caja — solo afecta elementos del plugin
   -------------------------------------------------------------------------- */
.bac-carousel *,
.bac-carousel *::before,
.bac-carousel *::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   2. Wrapper del carrusel
   -------------------------------------------------------------------------- */
.bac-carousel {
  position: relative;
  width: 100%;
  padding: 72px 0;
  overflow: hidden;
  --bac-cards-desktop: 4;
  --bac-cards-mobile: 2;
}

/* --------------------------------------------------------------------------
   3. Viewport — recorte con overflow oculto
   -------------------------------------------------------------------------- */
.bac-carousel__viewport {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
  padding: 0 40px 24px;
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   4. Track — fila horizontal de cards
   -------------------------------------------------------------------------- */
.bac-carousel__track {
  display: flex;
  gap: 16px;
  transition: transform 350ms ease;
  will-change: transform;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  padding-right: 40px;
}

.bac-carousel__track.is-dragging {
  cursor: grabbing;
  transition: none;
}

/* --------------------------------------------------------------------------
   5. Card individual
   -------------------------------------------------------------------------- */
.bac-card {
  position: relative;
  flex: 0 0 calc((100% / var(--bac-cards-desktop)) - 14px);
  max-width: 380px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  margin-right: 2px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
}

.bac-card__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

/* --------------------------------------------------------------------------
   6. Imagen de la card
   -------------------------------------------------------------------------- */
.bac-card__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 160px;
}

.bac-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   7. Cuerpo de la card
   -------------------------------------------------------------------------- */
.bac-card__body {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 6px;
  text-align: center;
  align-items: center;
}

.bac-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  color: inherit;
}

.bac-card__desc {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: inherit;
  opacity: 0.75;
}

.bac-card__btn {
  position: relative;
  z-index: 2;
  display: inline-block;
  margin-top: 12px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 2px solid var(--btn-border, currentColor);
  border-radius: 4px;
  width: auto;
  min-width: 140px;
  align-self: center;
  text-align: center;
  transition: background 200ms ease, color 200ms ease, opacity 200ms ease;
  background: var(--btn-bg, transparent);
  color: var(--btn-color, inherit);
}

.bac-card__btn:hover {
  background: var(--btn-bg-hover, #1d2327);
  color: var(--btn-color-hover, #fff);
  opacity: 1;
}

/* --------------------------------------------------------------------------
   8. Flechas de navegación
   -------------------------------------------------------------------------- */
.bac-carousel__arrows {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}

.bac-carousel__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 200ms ease, background 200ms ease, transform 200ms ease;
  z-index: 2;
  color: #1d2327;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.bac-carousel__arrow--prev { left: 10px; }
.bac-carousel__arrow--next { right: 10px; }

.bac-carousel__arrow:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.08);
}

.bac-carousel__arrow:focus-visible {
  outline: 2px solid #2271b1;
  outline-offset: 2px;
}

.bac-carousel__arrow:disabled {
  opacity: 0.3;
  cursor: default;
}

.bac-carousel__arrow svg {
  fill: #1d2327 !important;
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.bac-carousel__arrow:hover svg {
  fill: #1d2327;
}

/* Flechas solo en hover — ocultas por defecto */
.bac-carousel--arrows-hover .bac-carousel__arrow {
  opacity: 0;
}

.bac-carousel--arrows-hover:hover .bac-carousel__arrow:not(:disabled) {
  opacity: 1;
}

/* Cuando NO tiene clase arrows-hover, las flechas siempre visibles */
.bac-carousel:not(.bac-carousel--arrows-hover) .bac-carousel__arrow {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   9. Barra de progreso
   -------------------------------------------------------------------------- */
.bac-carousel__progress {
  margin: 20px auto 0;
  margin-top: 32px;
  width: 25%;
  height: 5px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
  overflow: visible;
}

.bac-carousel__bar {
  height: 100%;
  width: 0;
  background: #1d2327;
  border-radius: 3px;
  transition: width 300ms ease;
}

/* --------------------------------------------------------------------------
   10. Responsivo — móvil
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .bac-carousel__viewport {
    padding: 0 20px;
  }

  .bac-card {
    flex: 0 0 calc((100% / var(--bac-cards-mobile)) - 10px);
    max-width: 280px;
  }
}

.bac-btn-pill .bac-card__btn {
    border-radius: 999px;
}
