@font-face {
  font-family: "Prosto One";
  src: url(/fonts/ProstoOne-Regular.ttf);
}

@font-face {
  font-family: "Roboto";
  src: url(/fonts/Roboto-VariableFont_wdth\,wght.ttf);
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
  font-family: "Roboto";
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  user-select: none;
}

h2 {
  font-family: "Prosto One";
  color: #1F1F1F;
  font-weight: normal;
  font-size: 2rem;
  padding-bottom: 5vh;
}

header {
  color: #fff;

  .head1_back {
    background-color: #1F1F1F;

    .head1 {
      max-width: 80vw;
      height: 5vh;
      margin: auto;
      display: flex;
      justify-content: space-between;
      align-items: center;

      .delivery,
      .phone {
        display: flex;
        align-items: center;
        gap: 0.5vw;
      }

      .social {
        display: flex;
        align-items: center;
        gap: 1vw;
      }

      nav {
        display: flex;
        gap: 2vw;

        a:after {
          display: block;
          content: "";
          height: 2px;
          width: 0%;
          background-color: #fff;
          transition: width 0.6s ease-in-out;
          -webkit-transition: width 0.6s ease-in-out;
          -moz-transition: width 0.6s ease-in-out;
          -ms-transition: width 0.6s ease-in-out;
          -o-transition: width 0.6s ease-in-out;
        }

        a:hover:after {
          width: 100%;
        }
      }
    }
  }

  .head2_back {
    border: 3px solid rgba(235, 235, 235, 1);

    .head2 {
      padding: 1vh 0;
      max-width: 80vw;
      margin: auto;
      display: flex;
      align-items: center;
      justify-content: space-between;
      max-height: 9vh;
      .catalog {
        height: 6vh;
        display: flex;
        align-items: center;
        font-size: 1.1rem;
        gap: 2vw;
        background-color: #1F1F1F;
        padding: 0 2vw;
        border-radius: 10px;
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        -ms-border-radius: 10px;
        -o-border-radius: 10px;
      }

      form {
        display: flex;
        align-items: center;
        height: 6vh;
        button {
          font-size: 1.1rem;
          height: 6vh;
          background-color: #1F1F1F;
          padding: 0 2vw;
          color: #fff;
          border: none;
          border-radius: 0 10px 10px 0;
        }

        input {
          color: rgba(59, 59, 59, 1);
          border: 3px solid rgba(235, 235, 235, 1);
          width: 19vw;
          height: 6vh;
          padding: 0 2vw;
          border-radius: 10px 0 0 10px;
        }

        button:hover {
          background-color: #900000;
          transition: all ease-in-out 0.5s;
        }
      }

      nav {
        display: flex;
        align-items: center;
        gap: 1vw;
      }
    }
  }
}
main {
  color: rgba(59, 59, 59, 1);
  max-width: 80vw;
  margin: 0 auto;
  padding: 7vh 0;
  display: flex;
  gap: 10vw;
  align-items: flex-start;
  position: relative;

  .mobile-filter-toggle {
    display: none;
  }

  .filter {
    flex: 0 0 360px;
    width: 360px;
    min-width: 360px;
    flex-shrink: 0;
    max-height: none;
    position: sticky;
    top: 18px;
    align-self: flex-start;

    .accordion {
      background: #fff;
      border: 2px solid rgba(235, 235, 235, 1);
      border-radius: 14px;
      padding: 1.4rem 1.2rem;
      box-shadow: 0 10px 30px rgba(31, 31, 31, 0.06);
      max-height: calc(100vh - 36px);
      overflow: auto;
    }

    .accordion__item {
      border-bottom: 1px solid rgba(59, 59, 59, 0.12);
      padding: 0.35rem 0;
    }

    .accordion__item:last-child {
      border-bottom: none;
    }

    .accordion__body {
      display: grid;
      grid-template-rows: 0fr;
      opacity: 0;
      overflow: hidden;
      transition: grid-template-rows 0.28s ease, opacity 0.22s ease;
      font-size: 1.05rem;
      a {
        padding-bottom: 0.65rem;
      }
    }

    .accordion__body > .accordion__content {
      min-height: 0;
      overflow: hidden;
    }

    .accordion__body.active {
      grid-template-rows: 1fr;
      opacity: 1;
    }

    .accordion__header {
      cursor: pointer;
      position: relative;
      font-size: 1.16rem;
      font-family: "Prosto One";
      color: #1f1f1f;
      padding: 0.85rem 2.2rem 0.85rem 0.8rem;
      border-radius: 10px;
      transition: background-color 0.2s ease, color 0.2s ease;
    }

    .accordion__header:hover {
      background: rgba(31, 31, 31, 0.05);
    }

    .accordion__item.active > .accordion__header {
      background: #1f1f1f;
      color: #fff;
    }

    .line {
      display: none;
    }

    .linee {
      display: none;
    }

    .mini {
      font-size: 1rem;
      font-family: "Roboto";
      font-weight: 600;
      margin: 0.35rem 0;
      background: rgba(230, 230, 230, 1);
      color: rgba(59, 59, 59, 1);
      padding: 0.68rem 2rem 0.68rem 0.75rem;
    }

    .accordion__item.active > .accordion__header.mini {
      background: #900000;
      color: #fff;
    }

    .mini:last-child {
      margin-bottom: 0.6rem;
    }

    .cena_back {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 0.8rem;
      padding: 0.8rem 0.5rem 1rem;
      .cena {
        display: flex;
        flex-direction: column;
        .cena_vmeste {
          display: flex;
          align-items: center;
          gap: 0.55rem;
          input {
            font-size: 1rem;
            background-color: rgba(230, 230, 230, 1);
            border: 1px solid rgba(59, 59, 59, 0.12);
            height: 44px;
            width: 8.4vw;
            min-width: 98px;
            border-radius: 10px;
            padding: 1vh;
            margin-bottom: 0.35rem;
          }
        }
      }
    }

    .checkbox {
      display: flex;
      flex-direction: column;
      gap: 0.6rem;
      padding: 0.8rem 0.5rem 1rem;

      .vmeste {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        font-size: 1.02rem;
      }
    }

    .accordion__header::after {
      content: url(/img/arrow.svg);
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%) rotate(0deg);
      transition: transform 0.3s ease;
      opacity: 0.85;
    }

    .accordion__item.active .accordion__header::after {
      transform: translateY(-50%) rotate(90deg);
    }

    /* Hide arrows for nested subcategories like "Одежда/Рыбалка" */
    .accordion__item .accordion__item > .accordion__header::after {
      content: "";
      display: none;
    }

    .accordion__content a {
      display: block;
      color: rgba(59, 59, 59, 1);
      padding: 0.45rem 0.75rem;
      border-radius: 8px;
      transition: background-color 0.2s ease, color 0.2s ease;
    }

    .accordion__content a.filter-active,
    .accordion__header.filter-active {
      background: rgba(31, 31, 31, 0.08);
      color: rgba(31, 31, 31, 1);
      font-weight: 700;
    }

    .accordion__content a:hover {
      background: rgba(205, 0, 0, 0.08);
      color: rgba(205, 0, 0, 1);
    }

    .accordion__item .accordion__item {
      margin-top: 0.2rem;
      border-bottom: none;
      padding: 0;
    }

    .accordion__item .accordion__item .accordion__body .accordion__content {
      padding-left: 0.4rem;
    }

    .filter-actions {
      position: sticky;
      top: 0;
      z-index: 3;
      display: flex;
      justify-content: flex-start;
      padding: 0.2rem 0 0.8rem;
      background: #fff;
    }
    .filter-actions button {
      background: #1f1f1f;
      color: #fff;
      border: none;
      border-radius: 10px;
      padding: 10px 14px;
      font-size: 0.95rem;
    }
    .filter-actions button:hover {
      background: #900000;
      transition: all ease-in-out 0.35s;
    }

    .checkbox .vmeste input:checked + label {
      font-weight: 700;
      color: #900000;
    }
  }

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

  .active-filters {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    margin: -2vh 0 2vh;
  }

  .filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid rgba(144, 0, 0, 0.24);
    border-radius: 999px;
    background: rgba(205, 0, 0, 0.08);
    color: #1F1F1F;
    font-size: 0.95rem;
  }

  .filter-chip b {
    color: #900000;
    font-size: 1.1rem;
    line-height: 1;
  }

  .tovar_cards {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
      padding-top: 3vh;
      gap: 3vw;

      .tovar_card {
        border: 2px solid inherit;
        padding: 2vh;
        width: 18vw;
        height: 60vh;
        position: relative;
        display: flex;
        flex-direction: column;
        text-align: center;
        /* background-color: rgba(230, 230, 230, 1); */
        border: 3px solid rgba(235, 235, 235, 1);
        border-radius: 10px;
        -webkit-border-radius: 10px;
        -moz-border-radius: 10px;
        -ms-border-radius: 10px;
        -o-border-radius: 10px;

        img {
          padding-bottom: 3vh;
          width: 15vw;
          height: 30vh;
          flex: 0 0 auto;
          object-fit: contain;
        }
        .tovar_card_text {
          flex: 1 1 auto;
          p {
            font-size: 1.1rem;
            height: 10vh;
          }

          .cena {
            font-size: 1.2rem;
            font-weight: bold;
            padding: 2vh;
            height: 8vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
          }

          .old-price {
            height: auto;
            font-size: 0.92rem;
            color: rgba(59, 59, 59, 0.55);
            text-decoration: line-through;
            padding: 0;
          }
        }

        button {
          background-color: #1F1F1F;
          color: #fff;
          border: none;
          border-radius: 10px;
          -webkit-border-radius: 10px;
          -moz-border-radius: 10px;
          -ms-border-radius: 10px;
          -o-border-radius: 10px;
          font-size: 1.2rem;
          padding: 1.5vh 3vw;
          margin-top: auto;
        }

        .favorite-btn {
          position: absolute;
          top: 1.4vh;
          right: 1.2vh;
          width: 42px;
          height: 42px;
          margin: 0;
          padding: 0;
          border: 2px solid rgba(235, 235, 235, 1);
          border-radius: 50%;
          background: #fff url("/img/heart.svg") center / 21px 21px no-repeat;
          box-shadow: 0 8px 18px rgba(31, 31, 31, 0.12);
          z-index: 2;
        }

        .favorite-btn.active {
          background-image: url("/img/heart_red.svg");
          border-color: rgba(144, 0, 0, 0.28);
        }

        .favorite-btn:hover {
          background-color: #fff;
          transform: scale(1.06);
        }

        .sold-out-badge {
          position: absolute;
          top: 2vh;
          left: 50%;
          transform: translateX(-50%);
          width: max-content;
          max-width: calc(100% - 3vh);
          padding: 0.65vh 1vw;
          border-radius: 999px;
          background: rgba(31, 31, 31, 0.9);
          color: #fff;
          font-size: 0.95rem;
          font-weight: 700;
          line-height: 1.1;
          pointer-events: none;
        }

        .discount-badge {
          position: absolute;
          top: 1.4vh;
          left: 1.2vh;
          border-radius: 999px;
          background: #900000;
          color: #fff;
          font-size: 0.9rem;
          font-weight: 700;
          padding: 6px 9px;
          z-index: 2;
        }

        &.sold-out {
          background: linear-gradient(180deg, #fff 0%, #f7f7f7 100%);
          border-color: rgba(190, 190, 190, 1);
        }

        &.sold-out img,
        &.sold-out .tovar_card_text {
          opacity: 0.55;
          filter: grayscale(0.35);
        }

        &.sold-out button {
          background: rgba(59, 59, 59, 0.55);
          cursor: not-allowed;
        }

        &.sold-out button:hover {
          background: rgba(59, 59, 59, 0.55);
        }
      }

      .tovar_card:hover {
        /* background-color: rgb(137, 1, 1); */
        /* color: #fff; */
        border: 3px solid #1F1F1F;
        transform: scale(110%, 110%);
        transition: all ease-in-out 1s;

        /* button {
          background-color: #900000;
          
          border: 2px solid #fff;
        } */

        button:hover {
          background-color: #900000;
          transition: all ease-in-out 0.5s;
          -webkit-transition: all ease-in-out 0.5s;
          -moz-transition: all ease-in-out 0.5s;
          -ms-transition: all ease-in-out 0.5s;
          -o-transition: all ease-in-out 0.5s;
        }

    
      }

      .tovar_card.sold-out:hover {
        border-color: rgba(190, 190, 190, 1);
        transform: none;
        transition: none;
      }

      .tovar_card.sold-out:hover button,
      .tovar_card.sold-out button:hover {
        background: rgba(59, 59, 59, 0.55);
        transition: none;
      }

      .tovar_card:hover .favorite-btn,
      .tovar_card:hover .favorite-btn:hover,
      .tovar_card.sold-out:hover .favorite-btn {
        background-color: #fff;
        transform: scale(1.06);
      }
    }
}



footer {
  .foot1_back {
    background-color: #1F1F1F;

    .foot1 {
      max-width: 80vw;
      margin: auto;
      color: #fff;
      display: flex;
      justify-content: space-between;
      padding: 4vh 0;

      .info1 {
        h3 {
          font-size: 1.5rem;
          padding-bottom: 2vh;
        }
        p {
          font-size: 1.1rem;
        }

        .number {
          font-size: 1.5rem;
          padding: 2vh 0;
        }
      }

      .info2 {
        display: flex;
        flex-direction: column;
        h4 {
          font-size: 1.3rem;
        }

        a {
          font-size: 1.1rem;
          padding-bottom: 1vh;
        }

        a:after {
          display: block;
          content: "";
          height: 2px;
          width: 0%;
          background-color: #fff;
          transition: width 0.6s ease-in-out;
          -webkit-transition: width 0.6s ease-in-out;
          -moz-transition: width 0.6s ease-in-out;
          -ms-transition: width 0.6s ease-in-out;
          -o-transition: width 0.6s ease-in-out;
        }

        a:hover:after {
          width: 100%;
        }

        .line {
          background-color: #fff;
          width: 13vw;
          height: 2px;
          margin-bottom: 2vh;
        }
      }
    }
  }

  .foot2 {
    text-align: center;
    padding: 2vh;
    color: #1F1F1F;
  }
}




@media (max-width: 1240px) {
  header .head2_back .head2 .search input {
    width: 26vw;
  }
  main .hits .tovar_cards .tovar_card {
    width: 22vw;
  }
}
@media (max-width: 1040px) {
  header .head2_back .head2 .search input {
    width: 24vw;
  }
  main .categories .categories_card {
    flex-direction: column;
    gap: 2vh;
  }
  main .categories .category {
    width: 100%;
    height: auto;
  }
  main .categories .category2 .category3 {
    width: 100%;
  }
  main .hits .tovar_cards {
    justify-content: center;
    gap: 2vw;
  }
  main .hits .tovar_cards .tovar_card {
    width: 28vw;
    height: auto;
  }
}
@media (max-width: 840px) {
  header .head1_back {
    display: none;
  }
  header .head2_back .head2 .search {
    display: none;
  }
  header .head2_back .head2 {
    flex-wrap: wrap;
    gap: 10px;
  }
  header .head2_back .head2 .logo {
    height: 48px;
  }
  header .head2_back .head2 nav {
    order: 3;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 4vw;
  }
  main {
    max-width: 90vw;
    padding-top: 7vh;
    flex-direction: column;
    gap: 3vh;
  }
  main .mobile-filter-toggle {
    display: inline-flex;
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 46px;
    border: none;
    border-radius: 10px;
    background: #1f1f1f;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
  }
  main .mobile-filter-toggle.active {
    background: #900000;
  }
  main .filter {
    display: none;
    position: static;
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }
  main .filter.open {
    display: block;
  }
  main .filter .accordion {
    max-height: none;
    overflow: visible;
  }
  main .filter .filter-actions {
    position: static;
  }
  main .catalog {
    width: 100%;
  }
  main .hits .tovar_cards .tovar_card img {
    width: 60vw;
    height: auto;
  }
  main .hits .tovar_cards .tovar_card {
    width: 60vw;
  }
  main .market .market_cards {
    gap: 3vh;
  }
  main .market .market_cards .market_card {
    width: 44vw;
  }
}
@media (max-width: 640px) {
  main .banner .slide .slide_content {
    flex-direction: column;
    height: auto;
    padding: 4vh 0;
  }
  main .banner .slide .slide_content img {
    height: 32vh;
  }
  main .banner .slide .text_slide {
    padding: 4vh 6vw;
  }
  main .categories .categories_card {
    gap: 3vh;
  }
  main .hits .tovar_cards .tovar_card {
    width: 86vw;
  }
  main .hits .tovar_cards .tovar_card img {
    width: 80vw;
  }
  main .market .market_cards .market_card {
    width: 86vw;
  }
  main input,
  main textarea {
    width: 100%;
  }
  footer .foot1_back .foot1 {
    flex-direction: column;
    gap: 3vh;
  }
  footer .foot1_back .foot1 .info2 .line {
    width: 40vw;
  }
}
@media (max-width: 540px) {
  h2 {
    font-size: 2rem;
  }
  main .banner .slide .text_slide h1 {
    font-size: 2.2rem;
  }
  main .banner .slide .text_slide p {
    font-size: 1.1rem;
  }
  header .head2_back .head2 .catalog {
    gap: 2vw;
    padding: 0 4vw;
  }
}
@media (max-width: 440px) {
  .back-to-top {
    right: 12px;
    bottom: 12px;
    width: 42px;
    height: 42px;
  }
  .mobile-nav {
    width: 88vw;
  }
}
