/*
  mobile.css — мобильная адаптация текущего шаблона cardconnect.ru / creditcardbank.ru
  Загружать после engine.css, styles.css и main.css.
  Путь на хостинге: /templates/Default/css/mobile.css
*/

:root {
  --m-brand: #15bc73;
  --m-brand-dark: #0c4556;
  --m-text: #17212f;
  --m-muted: #667085;
  --m-bg: #f4f8fb;
  --m-card: #ffffff;
  --m-border: #e6edf3;
  --m-radius: 18px;
  --m-shadow: 0 16px 40px rgba(12, 69, 86, 0.12);
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background: var(--m-bg);
}

img,
svg {
  max-width: 100%;
  height: auto;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* -------------------- Header / mobile menu -------------------- */
.openmobmenu {
  display: none;
}

.mobmenu {
  display: none;
}

@media screen and (max-width: 1000px) {
  body.menu-open {
    overflow: hidden;
    touch-action: none;
  }

  .header {
    float: none;
    width: 100%;
    height: auto;
    min-height: 68px;
    position: sticky;
    top: 0;
    z-index: 999;
    background: #ffffff;
    box-shadow: 0 8px 28px rgba(12, 69, 86, 0.08);
  }

  .header-wrap-line-bg {
    float: none;
    width: 100%;
    background: #ffffff;
  }

  .header-wrap-line {
    width: 100%;
    max-width: none;
    min-height: 68px;
    padding: 10px 16px;
    gap: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .header-wrap {
    display: none !important;
  }

  .js-gorod,
  .nomob {
    display: none !important;
  }

  .logo {
    width: auto;
    max-width: 170px;
    margin: 0;
    line-height: 1;
    flex: 0 1 170px;
  }

  .logo img {
    width: auto;
    max-width: 170px;
    height: 46px;
    object-fit: contain;
  }

  .header-wrap-line-bg button.openmobmenu,
  .header-wrap-line-bg button:not(.color-btn):not([class*=fr]):not(.search-btn):not([class*=owl-]).openmobmenu {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid rgba(21, 188, 115, 0.22) !important;
    border-radius: 14px;
    background: #eefcf6 !important;
    box-shadow: none;
    flex: 0 0 48px;
  }

  .openmobmenu svg {
    width: 30px;
    height: 22px;
  }

  .openmobmenu svg path {
    fill: var(--m-brand);
  }

  .mobmenu {
    display: block !important;
    position: fixed;
    top: 0;
    right: 0;
    z-index: 10000;
    width: min(88vw, 380px);
    height: 100dvh;
    padding: 18px;
    box-sizing: border-box;
    overflow-y: auto;
    color: #ffffff;
    background:
      radial-gradient(circle at 12% 0%, rgba(21, 188, 115, 0.24), transparent 34%),
      linear-gradient(180deg, #0c4556 0%, #073240 100%);
    transform: translateX(110%);
    visibility: hidden;
    transition: transform 0.28s ease, visibility 0.28s ease, box-shadow 0.28s ease;
  }

  .mobmenu.open {
    transform: translateX(0);
    visibility: visible;
    box-shadow: 0 0 0 100vmax rgba(7, 17, 31, 0.58), -22px 0 55px rgba(0, 0, 0, 0.22);
  }

  .mobmenu .flexmob:first-child {
    min-height: 56px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  }

  .flexmob {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
  }

  .mobmenu .logo {
    max-width: 170px;
    flex: 0 1 170px;
  }

  .mobmenu .logo img {
    height: 44px;
    filter: brightness(0) invert(1);
  }

  .closemenu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .closemenu:hover {
    background: rgba(255, 255, 255, 0.18);
  }

  .mobmenu .flexmob.search {
    justify-content: flex-start;
    gap: 10px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
  }

  .mobmenu .js-login {
    float: none;
    margin: 0;
  }

  .mobmenu .js-login span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 22px;
    border-radius: 999px;
    background: var(--m-brand);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    border: 0;
  }

  .mobmenu .kolsant {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.12);
  }

  .mobmenu .js-search img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
  }

  .mobmenu h2 {
    margin: 26px 0 14px;
    color: #ffffff;
    font-size: 24px;
    line-height: 1.2;
  }

  .mobmenu ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .mobmenu li {
    margin: 0;
  }

  .mobmenu li a {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
  }

  .mobmenu li a::after {
    content: '›';
    color: rgba(255, 255, 255, 0.72);
    font-size: 26px;
    line-height: 1;
  }

  .mobmenu li a:hover,
  .mobmenu li a.active {
    background: rgba(21, 188, 115, 0.22);
    border-color: rgba(21, 188, 115, 0.5);
  }

  .mobmenu .foot_soc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 28px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.1);
  }

  .mobmenu .foot_soc a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
  }

  .mobmenu .icon-foot {
    width: 21px;
    height: 21px;
    fill: #ffffff;
  }
}

/* -------------------- Main page mobile -------------------- */
@media screen and (max-width: 900px) {
  .main {
    float: none;
    width: 100%;
  }

  .main_banner_bg {
    float: none;
    width: 100%;
    padding: 18px 14px 14px;
    box-sizing: border-box;
    background:
      radial-gradient(circle at 85% 10%, rgba(21, 188, 115, 0.18), transparent 32%),
      linear-gradient(135deg, #f7fbff 0%, #ecfff6 100%);
  }

  .main_banner_wrap {
    width: 100%;
    max-width: none;
    min-height: auto;
    margin: 0;
    padding: 22px 18px;
    box-sizing: border-box;
    border: 1px solid var(--m-border);
    border-radius: 24px;
    background: #ffffff;
    box-shadow: var(--m-shadow);
  }

  .main_banner_left {
    float: none;
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .main_banner_left .flex {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
  }

  .main_banner_left .flex a {
    padding: 7px 10px;
    border-radius: 999px;
    background: #eefcf6;
    color: #0b6f48;
    font-size: 13px;
    line-height: 1.2;
  }

  .banner_title h1 {
    margin: 0;
    color: var(--m-text);
    font-size: clamp(30px, 8vw, 46px);
    line-height: 1.05;
    letter-spacing: -0.04em;
  }

  .banner_title span::after {
    width: min(210px, 74vw);
    height: 5px;
    margin-top: 8px;
  }

  .banner_text {
    margin-top: 16px;
    color: var(--m-muted);
    font-size: 16px;
    line-height: 1.55;
  }

  .banner_text br {
    display: none;
  }

  .main_banner_btn {
    margin-top: 20px;
  }

  .main_banner_btn a {
    display: flex;
    width: 100%;
    min-height: 52px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #14995f, #15bc73);
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 12px 24px rgba(21, 188, 115, 0.22);
  }

  .banner_text_down {
    margin-top: 16px;
    color: #7a8794;
    font-size: 12px;
    line-height: 1.45;
  }

  .line_wrap_bg {
    float: none;
    width: 100%;
    padding: 8px 14px 16px;
    box-sizing: border-box;
    background: var(--m-bg);
  }

  .line_wrap {
    width: 100%;
    max-width: none;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
  }

  .line_offer {
    float: none;
    width: auto;
    margin: 0;
  }

  .line_offer a {
    display: grid;
    align-content: start;
    min-height: 136px;
    padding: 16px;
    box-sizing: border-box;
    border: 1px solid var(--m-border);
    border-radius: 20px;
    background: #ffffff;
    color: var(--m-text);
    text-decoration: none;
    box-shadow: 0 8px 20px rgba(12, 69, 86, 0.06);
  }

  .line_offer_img {
    width: 44px;
    height: 44px;
    margin-bottom: 10px;
  }

  .line_offer_img img {
    width: 44px;
    height: 44px;
    object-fit: contain;
  }

  .line_offer_info_fx {
    width: 100%;
  }

  .line_offer_link {
    color: var(--m-text);
    font-size: 15px;
    line-height: 1.25;
    font-weight: 800;
  }

  .line_offer_info {
    margin-top: 5px;
    color: var(--m-muted);
    font-size: 12px;
    line-height: 1.25;
  }

  .rang_main_bg,
  .news_main_bg,
  .credcard_main_bg,
  .debetcard_main_bg,
  .rko_main_bg {
    float: none;
    width: 100%;
    padding: 18px 0;
    background: var(--m-bg);
  }

  .wrap-carusel2,
  .news_main_wrap {
    width: 100%;
    max-width: none;
    padding: 0 14px;
    box-sizing: border-box;
  }

  .line-on-card,
  .news_main_title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 2px 16px;
    color: var(--m-text);
    font-size: 22px;
    line-height: 1.2;
    font-weight: 800;
  }

  .line-on-card span,
  .news_main_title > a {
    display: none !important;
  }

  .news_main_title h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
  }

  .card-offer-mini {
    padding: 8px 6px;
  }

  .card-offer-mini-wr {
    float: none;
    width: 100%;
    min-height: 100%;
    padding: 18px 0;
    border: 1px solid var(--m-border);
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(12, 69, 86, 0.06);
    overflow: hidden;
  }

  .card-offer-mini-img {
    padding: 0 18px 12px;
  }

  .card-offer-mini-img img {
    width: 86px;
    max-height: 56px;
    object-fit: contain;
  }

  .nazvbankcard-mini {
    padding: 0 18px 8px;
    color: #7a8794;
    font-size: 12px;
    line-height: 1.35;
  }

  .card-offer-mini-title {
    height: auto;
    min-height: 58px;
    padding: 13px 18px;
  }

  .card-offer-mini-title a {
    margin: 0;
    color: var(--m-text);
    font-size: 15px;
    line-height: 1.35;
    font-weight: 800;
  }

  .offer-mini-info {
    padding: 13px 18px;
    color: #475467;
    font-size: 14px;
    line-height: 1.55;
  }

  .offer-mini-info span {
    color: var(--m-text);
    font-size: 19px;
    line-height: 1.25;
  }

  .offer-mini-online {
    padding: 0 18px;
  }

  .offer-mini-online a {
    margin-top: 16px;
    min-height: 46px;
    line-height: 46px;
    border-radius: 999px;
    background: linear-gradient(135deg, #14995f, #15bc73);
    font-weight: 800;
  }

  .topchik {
    border-top-width: 54px;
    border-left-width: 54px;
  }

  .toptext {
    font-size: 11px;
    padding-top: 10px;
  }

  .news_main_hold {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .short-main {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--m-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(12, 69, 86, 0.05);
  }

  .short-main-img {
    width: 112px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 14px;
  }

  .short-main-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .short-title.short-main-title {
    color: var(--m-text);
    font-size: 15px;
    line-height: 1.35;
    font-weight: 800;
  }

  .short-main-meta-btm {
    grid-column: 2;
    color: var(--m-muted);
    font-size: 12px;
  }
}

/* -------------------- Inner pages mobile -------------------- */
@media screen and (max-width: 900px) {
  .bg_main {
    float: none;
    width: 100%;
    padding: 14px;
    box-sizing: border-box;
    background: var(--m-bg);
  }

  .content_flex {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: none;
    margin: 0;
  }

  .content_left,
  .content_right {
    width: 100%;
    flex-basis: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }

  .content_right {
    order: 2;
  }

  .sect-header {
    padding: 0 0 12px;
  }

  .sect-title h1,
  .content_left h1 {
    font-size: clamp(26px, 7vw, 36px);
    line-height: 1.12;
    color: var(--m-text);
  }

  .right_top,
  .main-bank-info,
  .katalog_info_left,
  .katalog_info_right,
  .katalog_cont_left,
  .katalog_cont_right {
    border-radius: 18px;
    box-shadow: 0 8px 20px rgba(12, 69, 86, 0.05);
  }

  .offer_carusel {
    float: none;
    width: 100%;
    margin: 18px 0;
  }
}

/* -------------------- Search, login, city modal -------------------- */
@media screen and (max-width: 700px) {
  .search-box {
    width: 100%;
    padding: 14px;
    box-sizing: border-box;
  }

  .search-wrap {
    width: 100%;
    max-width: none;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 22px;
  }

  .seach-fx {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .seach-left,
  .seach-right {
    width: 100%;
  }

  .seach-right button {
    width: 100%;
    min-height: 48px;
    border-radius: 999px;
  }

  .login-box {
    width: calc(100% - 28px) !important;
    max-width: 420px;
    left: 14px !important;
    right: 14px !important;
    margin: 0 auto;
    border-radius: 22px;
  }

  .ui-dialog,
  .ui-widget.ui-widget-content {
    width: calc(100vw - 24px) !important;
    max-width: 520px !important;
    left: 12px !important;
    box-sizing: border-box;
  }

  #city_modal {
    max-height: 72dvh;
    overflow: auto;
  }

  ul.city_list {
    column-count: 1 !important;
  }
}

@media screen and (max-width: 520px) {
  .header-wrap-line {
    min-height: 64px;
    padding: 9px 12px;
  }

  .logo,
  .mobmenu .logo {
    max-width: 150px;
  }

  .logo img,
  .mobmenu .logo img {
    height: 40px;
    max-width: 150px;
  }

  .header-wrap-line-bg button.openmobmenu,
  .header-wrap-line-bg button:not(.color-btn):not([class*=fr]):not(.search-btn):not([class*=owl-]).openmobmenu {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }

  .mobmenu {
    width: min(92vw, 360px);
    padding: 14px;
  }

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

  .line_offer a {
    min-height: 104px;
    grid-template-columns: 50px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
  }

  .line_offer_img {
    margin: 0;
  }

  .short-main {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .short-main-img {
    width: 96px;
  }

  .short-title.short-main-title {
    font-size: 14px;
  }

  .card-offer-mini {
    padding-left: 0;
    padding-right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobmenu,
  .mobmenu.open {
    transition: none;
  }
}
