/* Mobile visual refresh for dariradosti.ru.
 * Everything in this file is deliberately isolated from desktop layouts.
 */
@media (max-width: 1199.98px) {
  :root {
    --dr-mobile-green: #08a653;
    --dr-mobile-green-dark: #078d48;
    --dr-mobile-red: #ed171c;
    --dr-mobile-ink: #081b36;
    --dr-mobile-nav-height: 78px;
  }

  body {
    padding-bottom: calc(var(--dr-mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    background: #eefaff;
  }

  .header {
    background: #ffffff;
    background-image: none;
    box-shadow: 0 5px 20px rgba(2, 60, 43, 0.09);
  }

  .header-top {
    width: 100%;
    min-height: 64px;
    padding: 8px 12px;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #05ad58 0%, #03954b 100%);
  }

  .header-top__mobile,
  .header-top__mobile-burger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .header-top__mobile-burger {
    top: 0;
    width: 42px;
    height: 42px;
    margin-right: 0;
    border-radius: 12px;
  }

  .header-top__mobile-burger svg {
    width: 28px;
    height: 22px;
  }

  .select-city-wrap {
    min-width: 0;
    margin-right: auto;
  }

  .select-city__block {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
  }

  span.select-city__block__text {
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: #ffffff;
    line-height: 1;
  }

  span.select-city__block__text svg {
    width: 20px;
    height: 24px;
    fill: #ffffff;
  }

  span.select-city__block__text-city {
    display: block;
    min-width: 0;
    max-width: min(46vw, 230px);
    overflow: hidden;
    color: #ffffff;
    font-family: "Nunito", sans-serif;
    font-size: clamp(15px, 4.4vw, 20px);
    font-weight: 900;
    line-height: 1.1;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  span.select-city__block__text-city::after {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    margin: 0 0 4px 10px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
  }

  .header-top__cart {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    margin: 0;
    border-radius: 15px;
    box-shadow: 0 8px 18px rgba(0, 85, 55, 0.2);
  }

  .header-top__cart svg {
    width: 30px;
    height: 30px;
  }

  .header-top__cart span {
    top: -4px;
    right: -6px;
    min-width: 22px;
    width: auto;
    height: 22px;
    padding: 0 6px;
    border: 2px solid #ffffff;
    font-size: 12px;
    line-height: 18px;
  }

  .header-bottom {
    isolation: isolate;
    min-height: 94px;
    padding: 11px 14px 12px;
    overflow: hidden;
    background: linear-gradient(90deg, #fffdf7 0%, #ffffff 48%, #fffaf1 100%);
  }

  .header-bottom::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: url("../img/mobile-card-winter-overlay.png") center/100% 145% no-repeat;
    opacity: 0.3;
    transform: scaleY(-1);
    pointer-events: none;
  }

  .header-bottom__logo {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-bottom__logo svg {
    width: min(55vw, 235px);
    height: 70px;
  }

  .header-bottom__wrap,
  .header-bottom__cabinet,
  .header-bottom__cart {
    display: none;
  }

  .header-mobile__phone {
    display: block;
    flex: 0 0 auto;
    width: clamp(118px, 31vw, 155px);
    height: 52px;
    margin: 0;
    border-radius: 24px;
    background: linear-gradient(180deg, #ff272b 0%, #e90c12 100%);
    box-shadow: 0 8px 18px rgba(219, 13, 20, 0.2);
    text-align: center;
  }

  .header-mobile__link {
    position: static;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #ffffff !important;
    font-size: clamp(15px, 4vw, 20px);
    font-weight: 900;
    line-height: 1;
  }

  .header-mobile__link::before {
    content: "";
    width: 20px;
    height: 20px;
    margin-right: 9px;
    background: center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M6.6 10.8c1.7 3.4 3.2 4.9 6.6 6.6l2.2-2.2c.3-.3.7-.4 1.1-.3 1.2.4 2.5.6 3.8.6.6 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.7 21 3 13.3 3 3.7c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.3.2 2.6.6 3.8.1.4 0 .8-.3 1.1l-2.2 2.2Z'/%3E%3C/svg%3E");
  }

  main {
    padding-top: 158px;
  }

  .main {
    background: linear-gradient(145deg, #effbff 0%, #f7fdff 45%, #eaf8fb 100%);
  }

  .main-actions {
    margin-top: 0;
    padding: 18px 0 34px;
    background: transparent;
  }

  .main-actions > .wrap-content {
    width: 100%;
    padding-right: 12px;
    padding-left: 12px;
  }

  .main-actions__top {
    margin-bottom: 18px;
  }

  .main-actions__bottom {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    gap: 12px;
  }

  .main-actions__bottom a,
  .main-actions__bottom a:nth-child(n) {
    position: relative;
    isolation: isolate;
    grid-area: auto;
    display: block;
    aspect-ratio: 0.92;
    min-width: 0;
    overflow: hidden;
    padding: 18px 14px 8px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 19px;
    box-shadow: 0 9px 22px rgba(26, 73, 88, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.58);
    transform: translateZ(0);
  }

  .main-actions__bottom a::after {
    content: "";
    position: absolute;
    z-index: 3;
    inset: 0;
    background: url("../img/mobile-card-winter-overlay.png") center bottom/100% 100% no-repeat;
    opacity: 0.72;
    pointer-events: none;
  }

  .main-actions__bottom a:nth-child(1) {
    background: linear-gradient(145deg, #aee9ff 0%, #77cff4 60%, #5dbce9 100%);
  }

  .main-actions__bottom a:nth-child(2) {
    background: linear-gradient(145deg, #ffd4d4 0%, #ffaaa8 58%, #ff8e8c 100%);
  }

  .main-actions__bottom a:nth-child(3) {
    background: linear-gradient(145deg, #bff7d4 0%, #77ebba 58%, #45dca2 100%);
  }

  .main-actions__bottom a:nth-child(4) {
    background: linear-gradient(145deg, #ffeaa7 0%, #ffd26c 58%, #ffc247 100%);
  }

  .main-actions__bottom a:nth-child(5) {
    background: linear-gradient(145deg, #f2c7f6 0%, #e79bec 58%, #d985df 100%);
  }

  .main-actions__bottom a:nth-child(6) {
    background: linear-gradient(145deg, #d9d0ff 0%, #b9a8ff 55%, #9781f2 100%);
  }

  .main-actions__bottom a p,
  .main-actions__bottom a:nth-child(n) p {
    position: relative;
    z-index: 5;
    width: 100%;
    margin: 0;
  }

  .main-actions__bottom a p span:nth-child(1) {
    display: block;
    width: 100%;
    margin: 0;
    color: var(--dr-mobile-ink);
    font-size: clamp(19px, 5.2vw, 28px);
    font-weight: 900;
    line-height: 1.04;
    text-align: left;
    text-transform: none;
    text-wrap: balance;
  }

  .main-actions__bottom a p span:nth-child(2) {
    display: block;
    width: 100%;
    margin-top: 7px;
    color: #d81218;
    font-size: clamp(18px, 5vw, 27px);
    font-weight: 900;
    line-height: 1.02;
    text-align: left;
  }

  .main-actions__bottom a:nth-child(4) p span:nth-child(2) {
    color: #8d4c17;
    font-weight: 700;
  }

  .main-actions__bottom a img,
  .main-actions__bottom a:nth-child(n) img {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: 3%;
    width: 86%;
    height: 61%;
    max-width: none;
    max-height: none;
    object-fit: contain;
    object-position: center bottom;
    transform: translateX(-50%);
  }

  .header-bottom-menu {
    justify-content: space-around;
    height: calc(var(--dr-mobile-nav-height) + env(safe-area-inset-bottom, 0px)) !important;
    padding: 8px 5px calc(8px + env(safe-area-inset-bottom, 0px));
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(0, 55, 40, 0.12);
    z-index: 180;
  }

  .header-bottom-menu__item {
    flex: 1 1 20%;
    width: auto;
    max-width: 92px;
    min-width: 0;
    justify-content: center;
  }

  .header-bottom-menu__item svg {
    width: 30px;
    height: 30px;
    margin-bottom: 5px;
    fill: var(--dr-mobile-green);
  }

  .header-bottom-menu__item span {
    overflow: hidden;
    color: #777777;
    font-size: clamp(9px, 2.8vw, 13px);
    font-weight: 600;
    line-height: 1.05;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-bottom-menu__item[href="/"] span {
    color: var(--dr-mobile-green);
    font-weight: 900;
  }

  .header-bottom-menu__item span:nth-child(3) {
    top: -2px;
    right: 8px;
    min-width: 21px;
    height: 21px;
    padding: 0 5px;
    border: 2px solid #ffffff;
    font-size: 10px;
    line-height: 17px;
  }

  .b24-widget-button-position-bottom-right {
    right: 12px !important;
    bottom: calc(var(--dr-mobile-nav-height) + 10px + env(safe-area-inset-bottom, 0px)) !important;
  }

  .footer__whatsapp {
    right: 14px;
    bottom: calc(var(--dr-mobile-nav-height) + 12px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 379.98px) {
  .header-top {
    padding-right: 8px;
    padding-left: 8px;
  }

  .header-bottom {
    min-height: 88px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .header-bottom__logo svg {
    width: 51vw;
    height: 64px;
  }

  .header-mobile__phone {
    width: 116px;
    height: 46px;
  }

  .header-mobile__link {
    font-size: 15px;
  }

  main {
    padding-top: 152px;
  }

  .main-actions__bottom {
    gap: 9px;
  }

  .main-actions__bottom a,
  .main-actions__bottom a:nth-child(n) {
    padding: 15px 11px 7px;
    border-radius: 16px;
  }
}
