
/*
 * HAPP Magic — Compact Desktop v2
 * Эталон: happ-online.site при масштабе Chrome 67%.
 * Не используется zoom / transform: scale.
 * Мобильная вёрстка остаётся исходной.
 */




/* HAPP location flag spacing fix */
@media (min-width: 1100px) {
  .connection-main .location-copy {
    padding-left: 20px;
  }
}


/* HAPP HERO TOP SPACING FIX */
@media (min-width: 1100px) {
  .hero.section {
    padding-top: 30px;
  }
}

/* Якорь должен прокручивать к началу всей страницы,
   а не ставить main вплотную к верху окна. */
#top {
  scroll-margin-top: 100vh;
}

/* HAPP METRICS DIVIDER FIX V2 */

/* Убираем старые псевдоразделители.
   Оставляем штатный border-left из HTML. */
.metrics-wrap .metric:not(:last-child)::after {
  content: none !important;
  display: none !important;
}


/* HAPP HERO DESCRIPTION TWO LINES */
@media (min-width: 1100px) {
  .hero-copy .hero-lead {
    width: 420px;
    max-width: 445px;
    font-size: 11px;
    line-height: 1.65;
  }
}



/* HAPP RADAR PULSE */
.connection-status .pulse-wrap {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.connection-status .pulse {
  position: relative;
  z-index: 1;
  animation: none;
  transform: none;
}

.connection-status .pulse::after {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  background: #16b364;
  opacity: 0;
  animation: happRadarPulse 2.4s ease-out infinite;
  pointer-events: none;
}

@keyframes happRadarPulse {
  0% {
    transform: scale(1);
    opacity: .55;
  }

  75% {
    transform: scale(4);
    opacity: 0;
  }

  100% {
    transform: scale(4);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .connection-status .pulse::after {
    animation: none;
    opacity: 0;
  }
}



/* HAPP FIXED HEADER ACTIONS */
@media (min-width: 1100px) {
  .site-header .nav-actions {
    width: 245px;
    flex: 0 0 245px;
    justify-content: flex-end;
    gap: 7px;
  }

  .site-header .nav-actions > .btn-ghost {
    width: 110px;
    flex: 0 0 110px;
    padding-inline: 6px;
    white-space: nowrap;
  }

  .site-header .nav-actions > .btn-primary {
    width: 128px;
    flex: 0 0 128px;
    padding-inline: 6px;
    white-space: nowrap;
  }
}


/* HAPP PLANS GRID 2X2 */
@media (min-width: 1100px) {
  .plans-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
  }

  .plan-card {
    min-width: 0;
    min-height: 235px;
    padding: 20px 22px;
  }

  .plan-top {
    min-height: 24px;
  }

  .plan-name {
    font-size: 12px;
    white-space: nowrap;
  }

  .price {
    margin: 19px 0 13px;
  }

  .price strong {
    font-size: 34px;
    white-space: nowrap;
  }

  .plan-card > p {
    min-height: 38px;
  }

  .plan-economy {
    min-height: 22px;
    margin-bottom: 12px;
  }

  .plan-card.selected {
    transform: none;
  }

  .plan-card.selected:hover {
    transform: translateY(-2px);
  }
}


/* HAPP PLANS COMPACT CHECKOUT V2 */
@media (min-width: 821px) {
  #plans .plans-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: auto;
    gap: 10px;
    align-items: stretch;
  }

  #plans .plan-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 160px;
    height: auto;
    padding: 15px 17px;
    border-radius: 15px;
  }

  #plans .plan-top {
    min-height: 20px;
    margin: 0;
    gap: 8px;
    align-items: center;
  }

  #plans .plan-name {
    font-size: 11px;
    white-space: nowrap;
  }

  #plans .plan-badge {
    font-size: 8px;
    white-space: nowrap;
  }

  #plans .price {
    margin: 9px 0 4px;
    gap: 5px;
    align-items: baseline;
  }

  #plans .price strong {
    font-size: 27px;
    line-height: 1.1;
    white-space: nowrap;
  }

  #plans .price span {
    font-size: 9px;
  }

  #plans .plan-monthly {
    font-size: 9px;
    margin: 0;
  }

  #plans .plan-old-price {
    display: none;
  }

  #plans .plan-economy {
    min-height: 0;
    margin: 6px 0 8px;
    font-size: 9px;
  }

  #plans .plan-economy-empty {
    display: none;
  }

  #plans .plan-card > p {
    display: none;
  }

  #plans .btn-plan {
    margin-top: auto;
    min-height: 30px;
    width: 100%;
    font-size: 10px;
  }
}


/* HAPP Magic — restore normal desktop header */
@media (min-width: 1100px) {
  .site-header .nav-wrap {
    height: 78px;
  }

  .site-header .nav-actions {
    width: auto;
    flex: 0 1 auto;
    gap: 10px;
    justify-content: flex-end;
  }

  .site-header .nav-actions > .btn-ghost,
  .site-header .nav-actions > .btn-primary {
    width: auto;
    flex: 0 0 auto;
    min-height: 44px;
    padding-inline: 19px;
    font-size: 14px;
    white-space: nowrap;
  }
}



/* HAPP Magic — four tariffs in one row */
@media (min-width: 1100px) {
  #plans .plans-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* HAPP MAGIC MOBILE FOOTER */
@media (max-width: 640px) {
  .footer {
    padding: 30px 0 20px;
  }

  .footer-grid {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    text-align: center;
  }

  .footer-brand,
  .footer-grid > div:not(.footer-brand):not(:last-child) {
    display: none !important;
  }

  .footer-grid > div:last-child {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .footer-grid > div:last-child strong {
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .footer-grid > div:last-child a {
    font-size: 13px;
  }

  .footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 16px;
  }
}
