/* ==========================================================================
   Responsive: tablet & mobile
   ========================================================================== */

/* hide header phone at 1440px and below */
@media (max-width: 1440px) {
  .site-header__phone.desktop-only {
    display: none;
  }
  .site-header__nav {
    justify-content: center;
  }
  .site-header__row {
    gap: 0;
  }
}

/* tablet adjustments */
@media (max-width: 1280px) {
  :root {
    --container: 100%;
    --gutter: 20px;
  }

  /* ---- Tablet header ---- */
  .site-header__row {
    display: flex;
    align-items: stretch;
    gap: 0;
  }
  .site-header__logo {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 0;
    padding: 16px 0;
  }
  /* Hide desktop-only elements */
  .site-header__nav,
  .site-header__cta.desktop-only {
    display: none !important;
  }

  /* Menu button — red square on the FAR LEFT */
  .site-header__menu-btn {
    display: inline-flex !important;
    order: -1;
    width: 68px;
    flex-shrink: 0;
    background: var(--c-red);
    align-items: center;
    justify-content: center;
    color: #fff;
  }
  .site-header__menu-btn::before {
    content: "";
    width: 36px;
    height: 36px;
    background: url("../assets/icons/menu.svg") center/contain no-repeat;
    filter: brightness(0) invert(1);
  }

  /* Phone button */
  .site-header__cta-mobile {
    display: inline-flex !important;
    order: 2;
    width: 68px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
  }
  .site-header__cta-mobile::before {
    content: "";
    width: 36px;
    height: 36px;
    background: url("../assets/icons/phone.svg") center/contain no-repeat;
  }

  /* Calc button */
  .site-header__calc-mobile {
    display: inline-flex !important;
    order: 1;
    width: 68px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
  }
  .site-header__calc-mobile::before {
    content: "";
    width: 36px;
    height: 36px;
    background: url("../assets/icons/calc-hash.svg") center/contain no-repeat;
  }

  .site-header.is-overlay .container,
  .site-header.is-sticky .container {
    padding: 0;
  }

  .site-header__logo {
    padding: 16px 20px;
    justify-content: start;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
  }

  .hero__metric:nth-child(2) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
  }

  .hero__metrics {
    grid-template-columns: 1fr 1fr;
  }

  /* Switch features to mobile slider */
  .features {
    overflow: hidden;
    min-height: 0;
  }
  .features__grid {
    display: none !important;
  }
  .features-slider {
    display: block;
  }

  .calc__inner {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 40px;
  }
  .calculator-widget {
    width: 100%;
    max-width: 560px;
  }
  .steps__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .faq__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  /* FAQ CTA moved to faq__items by JS */
  .faq__items .faq__cta {
    width: 100%;
    margin-top: 32px;
  }
  /* Restore bottom border on last faq-item (CTA is now last child) */
  .faq__items .faq-item:last-of-type {
    border-bottom: 1px solid var(--c-border);
  }
  .reviews__grid {
    grid-template-columns: repeat(3, calc(100% / 2));
  }
  .types__grid {
    grid-template-columns: 1fr 1fr;
  }
  .type-card {
    border-right: 1px solid var(--c-border) !important;
  }
  .type-card:nth-child(odd),
  .type-card:nth-child(6) {
    border-left: 1px solid var(--c-border);
  }
  .garant-card--empty {
    display: none !important;
  }

  .type-card--empty {
    display: none;
  }

  .garant__left {
    grid-column: 1 / -1;
    padding-right: 0;
    margin-bottom: 32px;
  }
  .garant__bg {
    left: -28px;
    top: 240px; /* offset the title block */
  }
  .garant__grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }

  .features {
    padding: 0 0 60px;
  }

  .calculator-widget {
    right: 40px;
    top: 40px;
    max-width: 540px;
  }

  .faq-item:nth-child(5) {
    border-bottom: none;
  }

  .feature-row.is-open .feature-row__content p {
    margin-top: 20px;
  }

  .site-footer__top {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .hero__title {
    font-size: 56px;
  }
  .section-title,
  .calc__title,
  .routes__title,
  .garant__title,
  .site-footer__title {
    font-size: 48px;
  }
}

@media (max-width: 1024px) {
  .types__top {
    grid-template-columns: 1fr;
  }

  .features__head {
    padding-top: 80px;
    grid-template-columns: 1fr;
  }

  .calc {
    padding: 0 0 430px;
  }

  .calculator-widget {
    right: calc(50% - 560px / 2);
    top: 330px;
    max-width: 560px;
  }

  .calc__title-wrap {
    gap: 24px;
    height: auto;
  }

  .garant__grid {
    grid-template-columns: 1fr;
  }

  .garant__left {
    transform: translateY(0);
  }

  .garant__bg {
    top: -440px;
  }

  /* Portfolio & Reviews */
  .portfolio,
  .reviews {
    overflow: hidden;
  }
  .portfolio .container,
  .reviews .container {
    display: flex;
    flex-direction: column;
  }
  .portfolio__head,
  .reviews__head {
    display: contents;
  }
  .portfolio__head > div:first-child,
  .reviews__head > div:first-child {
    order: 1;
    margin-bottom: 24px;
  }
  #carousel-portfolio,
  #carousel-reviews {
    order: 2;
    overflow: visible; /* Allows the next slide to peek */
  }
  .portfolio__head .carousel-nav,
  .reviews__head .carousel-nav {
    order: 3;
    margin-top: 24px;
    align-self: flex-start;
  }
  .case-card {
    height: 280px;
  }

  .site-footer__bottom {
    flex-direction: column;
    align-items: start;
    gap: 16px;
  }

  .steps {
    margin-top: 25px;
  }

  .garant,
  .portfolio {
    padding-top: 100px;
  }
}

/* mobile */
@media (max-width: 768px) {
  .hero__title {
    font-size: 48px;
    margin-bottom: 0;
  }

  .hero__title .flag img {
    width: 56px;
    height: 56px;
  }

  .hero__lead {
    display: none;
  }

  .hero__metric-num {
    font-size: 64px;
  }

  .hero__metric-label {
    font-size: 16px;
  }

  .types__media {
    background: none;
    height: 100%;
  }

  .types__grid {
    grid-template-columns: 1fr;
    border: none;
  }

  .type-card {
    border: 1px solid var(--c-border);
    min-height: 240px;
    border-top: none;
  }

  .type-card:nth-child(1) {
    border-top: 1px solid var(--c-border);
  }

  .section-title,
  .calc__title,
  .routes__title,
  .garant__title,
  .site-footer__title {
    font-size: 36px;
  }

  .routes__title .pill {
    width: 40px;
    height: 40px;
  }

  .routes__list {
    padding: 20px;
  }

  .routes__row:nth-child(1) {
    padding-top: 0;
  }

  .routes__row:last-child {
    padding-bottom: 0;
  }

  .routes__after {
    padding: 60px 28px 0;
  }

  .calculator-widget {
    max-width: 500px;
    right: calc(50% - 500px / 2);
  }

  .site-footer__right {
    grid-template-columns: 1fr;
  }

  .steps {
    margin-top: 50px;
  }
}

@media (max-width: 640px) {
  .site-header__logo img,
  .menu-header__logo img {
    height: 28px;
  }

  .site-header__menu-btn,
  .site-header__calc-mobile,
  .site-header__cta-mobile,
  .menu-header__close,
  .menu-header__calc,
  .menu-header__phone {
    width: 58px;
  }

  .site-header__menu-btn::before,
  .site-header__calc-mobile::before,
  .site-header__cta-mobile::before,
  .menu-header__close::before,
  .menu-header__calc::before,
  .menu-header__phone::before {
    width: 28px;
    height: 28px;
  }

  .modal--menu .menu-list a {
    font-size: 16px;
    font-weight: 500;
  }

  .menu-contacts__label {
    font-size: 14px;
  }

  .menu-contacts__value,
  .menu-contacts__messengers a {
    font-size: 16px;
    font-weight: 500;
  }

  .menu-cta {
    padding: 44px 20px 16px;
  }

  .hero__content {
    padding-top: 100px;
    padding-bottom: 40px;
  }

  .hero__title {
    font-size: 44px;
    max-width: 300px;
  }

  .hero__title .flag img {
    width: 40px;
    height: 40px;
  }

  .hero__calc,
  .hero__metric {
    padding: 16px;
    min-height: 160px;
  }

  .hero__calc-link {
    font-size: 16px;
    border-bottom: none;
  }

  .hero__metric {
    gap: 0;
    justify-content: center;
  }

  .hero__metric-label {
    font-size: 15px;
    margin-top: 30px;
  }

  .hero__metric-num {
    font-size: 40px;
  }

  .hero__metric-num .unit {
    font-size: 16px;
  }

  .types {
    padding-bottom: 80px;
  }

  .types .section-tag {
    padding-top: 0;
    font-size: 16px;
    margin-bottom: 20px;
  }

  .types__heading h2 {
    font-size: 26px;
    margin-bottom: 20px;
  }

  .types__heading {
    padding-bottom: 40px;
  }

  .type-card {
    padding: 20px;
    min-height: 200px;
    gap: 24px;
  }

  .type-card h3 {
    font-size: 20px;
  }

  .types__heading p {
    font-size: 16px;
  }

  .type-card--cta {
    gap: 0;
  }

  .type-card--cta p {
    font-size: 16px;
    margin-bottom: 18px;
  }

  .type-card--cta .btn--ghost {
    font-size: 16px;
    padding-bottom: 0;
  }

  .routes {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .section-tag {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .routes__title {
    font-size: 34px;
  }

  .routes__title .pill {
    width: 36px;
    vertical-align: 0;
    height: 36px;
  }

  .routes__bg img {
    object-position: -600px;
  }

  .routes__title {
    margin-bottom: 40px;
  }

  .routes__row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 16px 0;
  }

  .routes__bg {
    height: 60vh;
  }

  .routes__path {
    padding-top: 8px;
    width: calc(100% - 52px);
  }

  .routes__path-line {
    font-size: 16px;
    gap: 12px;
  }

  .routes__sub {
    font-size: 14px;
  }

  .routes__time {
    padding-left: 52px;
    flex: 1;
  }

  .routes__go {
    width: 24px;
    height: 24px;
  }

  .routes__cc {
    width: 36px;
    height: 36px;
    font-size: 14px;
    align-self: start;
  }

  .routes__after {
    padding: 20px 28px 0;
  }

  .routes__after p {
    font-size: 16px;
  }

  .routes__after .btn--ghost {
    font-size: 16px;
  }

  .routes::after {
    height: 80px;
  }

  .features {
    padding-bottom: 0px;
  }

  .features .section-tag {
    margin-bottom: 20px;
  }

  .features__head {
    padding-top: 70px;
    margin-bottom: 40px;
  }

  .features__head .section-title {
    font-size: 34px;
    margin-bottom: 20px;
  }

  .features__head div {
    gap: 0;
  }

  .feature-slide__visual {
    height: auto;
    aspect-ratio: 65/77;
    margin-bottom: -60px;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0 93%);
  }

  .feature-slide__body {
    padding: 76px 20px 20px;
  }

  .feature-slide__content h3 {
    margin-bottom: 20px;
  }

  .feature-slide__vtext {
    font-size: 26px;
    padding: 20px;
  }

  .numbers {
    padding-top: 80px;
  }

  .numbers .section-tag {
    margin-bottom: 20px;
  }

  .numbers__grid {
    grid-template-columns: 1fr;
  }

  .num-card {
    border-left: 1px solid var(--c-border) !important;
    border-right: 1px solid var(--c-border) !important;
    padding: 24px 20px;
    padding-left: 20px;
  }

  .num-card:nth-child(even) {
    padding: 24px 20px;
    padding-left: 20px;
  }

  .num-card:nth-child(1) {
    padding: 20px;
    padding-right: 20px;
  }

  .num-card__lead p {
    font-size: 20px;
  }

  .num-card__big {
    font-size: 48px;
    margin-bottom: 20px;
  }

  .num-card:nth-child(3) {
    border-bottom: 1px solid var(--c-border);
    padding-bottom: 25px;
  }

  .num-card:nth-child(4) {
    padding-bottom: 60px;
  }

  .num-card__label {
    font-size: 16px;
  }

  .calc__inner {
    padding: 63px 0px 0px;
  }

  .calc__inner::after,
  .calc__inner::before {
    background-position: left;
    left: -28px;
    right: -28px;
  }

  .calc__title {
    font-size: 34px;
  }

  .calc__title .pill {
    width: 36px;
    height: 36px;
    vertical-align: -4px;
  }

  .calculator-widget {
    top: 300px;
    max-width: calc(100vw - 40px);
    left: 0;
    padding: 20px;
  }

  .calculator-widget__title {
    font-size: 20px;
  }

  .calculator-widget__lead {
    font-size: 16px;
    margin-bottom: 20px;
  }

  .calc-opt {
    padding: 12px 0;
  }

  .calculator-widget__step-row h3 {
    font-size: 18px;
    line-height: 23px;
  }

  .calc-progress {
    margin-bottom: 15px;
  }

  .calculator-widget__step-row .step {
    font-size: 14px;
  }

  .calc-opt__letter {
    width: 32px;
    height: 32px;
    font-size: 14px;
    flex: 0 0 32px;
  }

  .calc-opt {
    gap: 16px;
  }

  .calc-opt__label {
    font-size: 16px;
  }

  .calculator-widget .btn {
    margin-top: 20px;
  }

  .calculator-widget .btn {
    padding: 12px;
    justify-content: end;
    gap: 0;
    min-height: 62px;
    position: relative;
  }

  .calculator-widget .btn::after {
    width: 28px;
    top: 12px;
    right: 12px;
    position: absolute;
    height: 28px;
  }

  .calculator-widget__opts {
    gap: 4px;
  }

  .calc {
    padding-bottom: 340px;
  }

  .steps {
    padding-top: 80px;
    padding-bottom: 0px;
    margin-bottom: 0;
  }

  .steps .container {
    border-bottom: none;
    padding-bottom: 0;
  }

  .steps__heading h2 {
    font-size: 34px;
    margin-bottom: 20px;
  }

  .steps__heading p {
    font-size: 16px;
  }

  .step-item {
    padding: 20px 0;
  }

  .step-item {
    grid-template-columns: 45px 1fr;
  }

  .step-item__num {
    font-size: 16px;
  }

  .step-item__body h3 {
    font-size: 20px;
  }

  .step-item__body p {
    font-size: 16px;
  }

  .step-item__body .btn--ghost {
    font-size: 16px;
  }

  .step-item:last-child {
    border-bottom: 1px solid var(--c-border);
  }

  .garant {
    padding-top: 80px;
    padding-bottom: 0;
    margin-bottom: 80px;
  }

  .garant .section-tag {
    margin-bottom: 20px;
  }

  .garant__grid {
    gap: 8px;
  }

  .garant__left {
    margin-bottom: 52px;
  }

  .garant-card {
    min-height: 220px;
    padding: 20px;
  }

  .garant-card__icon {
    margin-bottom: auto;
  }

  .garant-card h3 {
    font-size: 20px;
  }

  .garant-card p {
    font-size: 16px;
  }

  .garant__bg {
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    left: -24px;
    height: 1055px;
    top: -125px;
  }

  .portfolio {
    padding-bottom: 0;
  }

  .portfolio .section-tag {
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 34px;
  }

  .case-card {
    min-height: 240px;
    height: 240px;
  }

  .case-card__body {
    padding: 20px;
  }

  .case-card__title {
    display: none;
  }

  .case-pin__letter {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .case-pins {
    gap: 20px;
  }

  .portfolio__head .carousel-nav,
  .reviews__head .carousel-nav {
    margin-top: 20px;
  }

  .reviews {
    padding-top: 80px;
    padding-bottom: 0;
  }

  .portfolio__head > div:first-child,
  .reviews__head > div:first-child {
    margin-bottom: 40px;
  }

  .review-card {
    padding: 20px;
    min-height: 314px;
  }

  .review-card__name {
    font-size: 16px;
  }

  .review-card__rating {
    font-size: 14px;
  }

  .review-card__rating::before {
    font-size: 20px;
  }

  .review-card__role {
    font-size: 14px;
    letter-spacing: -5%;
  }

  .review-card__head {
    margin-bottom: 16px;
  }

  .review-card__text {
    font-size: 16px;
    margin-bottom: auto;
    max-height: 176px;
  }

  .review-card__more {
    font-size: 16px;
  }

  .faq {
    padding-top: 80px;
    padding-bottom: 80px;
  }

  .faq__left .section-title {
    font-size: 34px;
  }

  .faq-item {
    padding: 20px 0;
  }

  .faq-item__q {
    font-size: 20px;
  }

  .faq-item__btn {
    font-size: 0;
    gap: 0;
  }

  .faq-item__a {
    font-size: 16px;
    padding-top: 16px;
  }

  .faq__items .faq__cta {
    margin-top: 20px;
    padding: 20px;
  }

  .faq__cta h3 {
    font-size: 20px;
  }

  .faq__cta p {
    font-size: 16px;
    margin-bottom: auto;
  }

  .faq__cta .btn--ghost {
    font-size: 16px;
  }

  .faq__items .faq__cta {
    min-height: 220px;
  }

  .site-footer {
    padding-top: 40px;
    padding-bottom: 20px;
  }

  .site-footer__left {
    justify-content: center;
    align-items: center;
  }

  .site-footer__left {
    font-size: 34px;
  }

  .site-footer__title .ico {
    width: 36px;
    height: 36px;
  }

  .site-footer__title {
    justify-content: center;
    gap: 4px;
  }

  .site-footer__title .row2 {
    gap: 8px;
  }

  .site-footer__right {
    text-align: center;
    justify-content: center;
    align-items: center;
  }

  .site-footer__col .messengers {
    justify-content: center;
  }

  .site-footer__col h3 {
    font-size: 14px;
  }

  .site-footer__col p,
  .site-footer__col a {
    font-size: 18px;
  }

  .site-footer__col .row {
    gap: 8px;
  }

  .site-footer__col a {
    text-decoration: none;
  }

  .site-footer__col {
    gap: 20px;
  }

  .site-footer__right {
    gap: 20px;
  }

  .site-footer__cta {
    margin-top: 20px;
  }

  .site-footer__cta .btn {
    padding: 32px 12px 12px;
  }

  .btn--footer::after {
    width: 28px;
    height: 28px;
    top: 12px;
    right: 12px;
  }

  .site-footer__top {
    padding-bottom: 40px;
  }

  .site-footer__bottom {
    gap: 8px;
    padding-top: 20px;
  }
}

/* Default visibility helpers */
.mobile-only {
  display: none;
}
.site-header__menu-btn,
.site-header__cta-mobile {
  display: none;
}

/* Print-friendly tweaks */
@media print {
  .site-header,
  .site-footer,
  .modal,
  .carousel-nav {
    display: none;
  }
}

.br-mobile {
  display: none;
}
@media (max-width: 640px) {
  .br-desktop {
    display: none;
  }
  .br-mobile {
    display: block;
  }
}
