/* VIPURI — catalog area styles (additive; loaded after vipuri.css). */

/* ===================== Section heading: "View All" stays inline ===================== */
.section-heading__inner {
  flex-wrap: nowrap;
  align-items: flex-end;
}

.section-heading__inner .section-heading__title {
  min-width: 0;
}

.section-heading__viewmore {
  flex-shrink: 0;
  white-space: nowrap;
  padding-bottom: 0.3em;
}

@media screen and (max-width: 575px) {
  .section-heading__inner {
    gap: 12px;
  }

  .section-heading__viewmore {
    font-size: 0.8125rem;
    gap: 4px;
  }

  .section-heading__inner .section-heading__title {
    font-size: 1.375rem;
  }
}

/* ===================== Hero banner: tyre centred under the copy on phone ===================== */
@media screen and (max-width: 575px) {
  /* The slide art is 1920x700 with the product in its right ~40%; size it by
     height and shift so the product lands centred below the text. */
  .banner-slider-item {
    background-size: auto 210px;
    background-position: calc(50% - 160px) calc(100% - 16px);
  }

  .banner-slider-item__main {
    padding-top: 32px;
    padding-bottom: 240px;
  }
}

/* ===================== Find by vehicle ===================== */
@media screen and (max-width: 575px) {
  .search-form {
    --gap: 10px;
    padding: 12px;
  }

  .search-form__field {
    flex: 1 1 calc(50% - var(--gap));
    min-width: 0;
  }

  /* Engine type and the button take the full row. */
  .search-form__field:nth-child(n + 5) {
    flex-basis: 100%;
  }

  .search-form .form--select,
  .search-form .form-select {
    height: 44px;
    min-height: 44px;
    font-size: 0.875rem;
    padding-block: 0;
    padding-left: 14px;
    padding-right: 32px;
    background-position: right 12px center;
    text-overflow: ellipsis;
  }

  .search-form__field .btn {
    height: 44px;
    padding-block: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* ===================== Category tiles ===================== */
.cat-card__name {
  -webkit-line-clamp: 2;
  line-height: 1.3;
  border-radius: 14px;
  padding: 5px 10px;
}

@media screen and (max-width: 575px) {
  .cat-card__name {
    font-size: 0.8125rem;
    width: calc(100% - 10px);
    bottom: 8px;
  }

  .popular-cat .cat-card__thumb {
    aspect-ratio: 1 / 1.15;
  }
}

/* ===================== All Categories page ===================== */
.all-cat-block__header {
  gap: 12px;
}

.all-cat-block__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: hsl(var(--base));
}

.all-cat-block__link:hover,
.all-cat-block__link:focus {
  color: hsl(var(--base-d-200));
}

.all-cat-block-ctrl:empty {
  display: none;
}

.all-cat-block-ctrl ul {
  display: none;
}

.all-cat-grid {
  display: none;
}

@media screen and (max-width: 767px) {
  /* Phone: a plain two-column grid instead of the slider, so every
     subcategory is visible without hunting for an off-screen slide. */
  .all-cat-block-slider,
  .all-cat-block-ctrl {
    display: none !important;
  }

  .all-cat-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .all-cat-grid .cat-card__thumb {
    aspect-ratio: 1 / 1;
  }
}

@media screen and (max-width: 575px) {
  .all-cat-card {
    gap: 16px;
  }

  .all-cat-card-info {
    flex-direction: row;
    align-items: center;
  }

  .all-cat-card-info__thumb {
    width: 56px;
    border-radius: 12px;
  }

  .all-cat-card-info__title {
    font-size: 1.25rem;
    margin-bottom: 2px;
  }

  .all-cat-card-info__desc {
    font-size: 0.875rem;
    line-height: 1.45;
    margin-bottom: 0;
  }

  .all-cat-block {
    gap: 12px;
  }
}

/* ===================== Product cards ===================== */
.product-card2__title,
.product-card4__title {
  font-size: 1rem;
}

.product-card2__title a,
.product-card3__title a,
.product-card4__title a,
.shop-block-one .lower-content h4 a {
  -webkit-line-clamp: 2;
  line-clamp: 2;
  line-height: 1.3;
  min-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
}

.product-card2,
.product-card4 {
  min-width: 0;
  background-color: hsl(var(--white));
}

.product-card2__thumb img,
.product-card4__thumb img {
  object-fit: contain;
}

/* Cards in a row stretch to the tallest one so buttons line up. */
.special-offer .row > [class*='col-'] > .product-card4,
.latest-product .row > [class*='col-'] > .product-card2 {
  height: 100%;
}

@media screen and (max-width: 575px) {
  .product-card2__thumb,
  .product-card4__thumb {
    padding: 10px;
  }

  .product-card2__body,
  .product-card4__body {
    padding: 4px 10px 10px;
  }

  .product-card2__footer,
  .product-card4__footer {
    padding: 0 10px 10px;
  }

  .product-card2__title,
  .product-card4__title {
    font-size: 0.875rem;
    margin-bottom: 4px;
  }

  .product-card2__cat,
  .product-card4__cat {
    font-size: 0.6875rem;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .product-card2__price,
  .product-card4__price {
    font-size: 0.875rem;
  }

  .product-card2__price > span,
  .product-card4__price > span {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 6px;
  }

  .product-card2 .rating-list,
  .product-card4 .rating-list {
    font-size: 0.75rem;
  }

  .product-card2__footer .btn,
  .product-card4__footer .btn {
    padding: 8px 10px;
    font-size: 0.8125rem;
    line-height: 1.2;
    white-space: nowrap;
  }
}

/* ===================== Top selling: next card peeks on phone ===================== */
@media screen and (max-width: 575px) {
  /* Slick sizes slides from the list's content width, so right padding
     leaves the next card visible as a swipe cue. */
  .top-selling-slider .slick-list {
    padding-right: 38%;
  }

  .top-deal-slider .slick-list,
  .limited-stock-slider .slick-list {
    padding-right: 12%;
  }
}

/* ===================== Brand tiles ===================== */
.brand-item__logo {
  --size: auto;
  width: 100%;
  max-width: 180px;
  height: 88px;
  border-radius: 14px;
  border: 1px solid hsl(var(--border-color));
  background-color: hsl(var(--white));
  box-shadow: 0 6px 18px -10px hsl(var(--dark) / 0.25);
  transition: 0.3s ease;
}

.brand-item__logo img {
  /* Uploaded logos carry wide transparent margins (the mark fills ~60% of
     the file), so let the file fill the tile and the margin do the padding. */
  width: 92%;
  height: 90%;
  object-fit: contain;
}

.brand-item:hover .brand-item__logo,
.brand-item:focus-visible .brand-item__logo {
  border-color: hsl(var(--base) / 0.4);
  box-shadow: 0 10px 24px -12px hsl(var(--base) / 0.45);
}

.brand-item__name {
  margin-top: 10px;
}

@media screen and (max-width: 575px) {
  .brand-item__logo {
    height: 72px;
  }
}

/* Home "Shop by Brand" with only a handful of brands. */
.brand-card--few {
  padding: 40px 48px;
}

.brand-card--few .brand-item__logo {
  max-width: 220px;
  height: 104px;
}

.brand-card--few .section-heading {
  margin-bottom: 20px !important;
}

@media screen and (max-width: 991px) {
  .brand-card--few {
    padding: 28px;
  }
}

@media screen and (max-width: 575px) {
  .brand-card--few {
    padding: 20px;
    border-radius: 20px;
  }

  .brand-card--few .brand-item__logo {
    height: 80px;
  }
}

/* ===================== Blog cards: footer pinned to the bottom ===================== */
.blog-card__content {
  display: flex;
  flex-direction: column;
}

.blog-card__content-body {
  flex: 1 1 auto;
}

.blog-card__content-footer {
  margin-top: auto;
}

.blog .blog-card__title a {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
  min-height: 2.7em;
}

/* ===================== CTA: keep copy readable over the image on phone ===================== */
@media screen and (max-width: 575px) {
  .cta-wrap {
    padding: 24px 20px 150px;
    /* The art is a wide strip with the product on its right half: anchor it
       to the bottom-right, below the buttons, instead of behind the text. */
    background-size: auto 140px;
    background-position: right -20px bottom 0;
  }

  .cta-wrap::before {
    background: linear-gradient(
      180deg,
      rgba(8, 12, 20, 0.94) 0%,
      rgba(8, 12, 20, 0.9) 55%,
      rgba(8, 12, 20, 0.35) 100%
    );
  }

  .cta-content__btns {
    flex-wrap: wrap;
    gap: 10px;
  }

  .cta-content__btns .btn {
    flex: 1 1 auto;
    text-align: center;
  }
}
