/* Achieving English: motion + adaptive tariff layout, 2026-10-08 */
html { scroll-behavior: smooth; }

/* MOBILE-FIRST: swipe carousel */
.ae-tariff-carousel {
  display: flex !important;
  align-items: stretch;
  gap: 18px !important;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 10px 16px 22px;
  box-sizing: border-box;
  cursor: grab;
}
.ae-tariff-carousel:active { cursor: grabbing; }
.ae-tariff-carousel::-webkit-scrollbar { display: none; }
.ae-tariff-carousel > * {
  position: relative;
  flex: 0 0 min(86vw, 360px) !important;
  width: min(86vw, 360px);
  max-width: 360px;
  min-width: 0;
  min-height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  border-radius: 20px !important;
  box-shadow: 0 16px 44px rgba(0,0,0,.26);
  transition: transform .32s ease, border-color .32s ease, box-shadow .32s ease;
}
.ae-tariff-carousel > *::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  background: linear-gradient(90deg, #ef4444, #f97316);
  opacity: .95;
}
.ae-tariff-carousel-compact > * {
  flex-basis: min(84vw, 340px) !important;
  width: min(84vw, 340px);
  max-width: 340px;
}
.ae-tariff-carousel > *:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 56px rgba(0,0,0,.34), 0 0 0 1px rgba(239,68,68,.14);
}
.ae-tariff-carousel > * a[class*='bg-red-500'],
.ae-tariff-carousel > * button[class*='bg-red-500'],
.ae-tariff-carousel > * .bg-red-500 {
  width: 100%;
  justify-content: center;
}

.ae-carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 6px 0 14px;
  color: #9ca3af;
  font-size: 13px;
  user-select: none;
}
.ae-carousel-arrow {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid #374151;
  background: #111827;
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background .2s ease;
}
.ae-carousel-arrow:hover { transform: scale(1.06); border-color: #ef4444; background: #171717; }
.ae-carousel-dots { display: flex; align-items: center; gap: 7px; }
.ae-carousel-dot {
  width: 7px;
  height: 7px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  background: #4b5563;
  transition: width .24s ease, background .24s ease;
  cursor: pointer;
}
.ae-carousel-dot.is-active { width: 22px; background: #ef4444; }
.ae-carousel-hint { color: #9ca3af; white-space: nowrap; }

/* Motion */
.ae-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .58s cubic-bezier(.2,.7,.2,1), transform .58s cubic-bezier(.2,.7,.2,1);
  will-change: opacity, transform;
}
.ae-reveal.is-visible { opacity: 1; transform: translateY(0); }
.ae-lift { transition: transform .26s ease, box-shadow .26s ease, border-color .26s ease !important; }
.ae-lift:hover { transform: translateY(-4px); box-shadow: 0 14px 40px rgba(0,0,0,.28); }
.ae-cta { position: relative; overflow: hidden; transform: translateZ(0); }
.ae-cta::after {
  content: '';
  position: absolute;
  inset: -40% auto -40% -50%;
  width: 28%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.18), transparent);
  transform: skewX(-18deg);
  transition: left .55s ease;
  pointer-events: none;
}
.ae-cta:hover::after { left: 125%; }
.ae-hero-pop { animation: aeHeroPop .65s cubic-bezier(.2,.8,.2,1) both; }
@keyframes aeHeroPop {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* TABLET: clean 2-column layout instead of awkward half-cut cards */
@media (min-width: 768px) {
  .ae-tariff-carousel {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px !important;
    overflow: visible;
    scroll-snap-type: none;
    padding: 0;
    cursor: default;
  }
  .ae-tariff-carousel > *,
  .ae-tariff-carousel-compact > * {
    flex: initial !important;
    width: auto !important;
    max-width: none;
    scroll-snap-align: none;
  }
  .ae-carousel-controls { display: none !important; }
}

/* DESKTOP: full neat pricing grid */
@media (min-width: 1180px) {
  .ae-tariff-carousel {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ae-reveal, .ae-reveal.is-visible, .ae-lift, .ae-tariff-carousel > *, .ae-carousel-arrow, .ae-carousel-dot, .ae-hero-pop {
    transition: none !important;
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
  .ae-cta::after { display: none; }
}
