/* Panda Designs v6.4.16 — admin-controlled product grid density and card direction */

.panda-home .pgrid,
.product-grid {
  gap: var(--pd-product-grid-gap, 16px) !important;
  align-items: stretch;
}

.panda-home .pgrid {
  grid-template-columns: repeat(var(--pd-home-cols-desktop, 5), minmax(0, 1fr)) !important;
}

.product-grid {
  grid-template-columns: repeat(var(--pd-shop-cols-desktop, 4), minmax(0, 1fr)) !important;
}

body.pd-product-equal-height .pgrid > .pcard,
body.pd-product-equal-height .product-grid > .store-card {
  height: 100%;
}

/* Horizontal card shell shared by home and Shop. */
@media (min-width: 1101px) {
  body.pd-card-dir-desktop-horizontal .pgrid > .pcard,
  body.pd-card-dir-desktop-horizontal .product-grid > .store-card {
    display: grid !important;
    grid-template-columns: minmax(105px, 42%) minmax(0, 1fr);
    align-items: stretch;
  }

  body.pd-card-dir-desktop-horizontal .pgrid .pcard-thumb,
  body.pd-card-dir-desktop-horizontal .product-grid .store-img {
    width: 100% !important;
    height: 100% !important;
    min-height: 150px;
    aspect-ratio: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    align-self: stretch;
    border-bottom: 0 !important;
  }

  body.pd-card-dir-desktop-horizontal .pgrid .pcard-body,
  body.pd-card-dir-desktop-horizontal .product-grid .card-body {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (min-width: 651px) and (max-width: 1100px) {
  .panda-home .pgrid {
    grid-template-columns: repeat(var(--pd-home-cols-tablet, 3), minmax(0, 1fr)) !important;
  }

  .product-grid {
    grid-template-columns: repeat(var(--pd-shop-cols-tablet, 3), minmax(0, 1fr)) !important;
  }

  body.pd-card-dir-tablet-horizontal .pgrid > .pcard,
  body.pd-card-dir-tablet-horizontal .product-grid > .store-card {
    display: grid !important;
    grid-template-columns: minmax(100px, 42%) minmax(0, 1fr);
    align-items: stretch;
  }

  body.pd-card-dir-tablet-horizontal .pgrid .pcard-thumb,
  body.pd-card-dir-tablet-horizontal .product-grid .store-img {
    width: 100% !important;
    height: 100% !important;
    min-height: 140px;
    aspect-ratio: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    align-self: stretch;
    border-bottom: 0 !important;
  }

  body.pd-card-dir-tablet-horizontal .pgrid .pcard-body,
  body.pd-card-dir-tablet-horizontal .product-grid .card-body {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
}

@media (max-width: 650px) {
  .panda-home .pgrid {
    grid-template-columns: repeat(var(--pd-home-cols-mobile, 2), minmax(0, 1fr)) !important;
  }

  .product-grid {
    grid-template-columns: repeat(var(--pd-shop-cols-mobile, 2), minmax(0, 1fr)) !important;
  }

  body.pd-card-dir-mobile-horizontal .pgrid > .pcard,
  body.pd-card-dir-mobile-horizontal .product-grid > .store-card {
    display: grid !important;
    grid-template-columns: minmax(82px, 43%) minmax(0, 1fr);
    align-items: stretch;
  }

  body.pd-card-dir-mobile-horizontal .pgrid .pcard-thumb,
  body.pd-card-dir-mobile-horizontal .product-grid .store-img {
    width: 100% !important;
    height: 100% !important;
    min-height: 118px;
    aspect-ratio: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    align-self: stretch;
    border-bottom: 0 !important;
  }

  body.pd-card-dir-mobile-horizontal .pgrid .pcard-body,
  body.pd-card-dir-mobile-horizontal .product-grid .card-body {
    min-width: 0;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 8px !important;
  }

  body.pd-card-dir-mobile-horizontal .pcard-name,
  body.pd-card-dir-mobile-horizontal .card-name {
    white-space: normal !important;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  body.pd-card-dir-mobile-horizontal .pcard-coins,
  body.pd-card-dir-mobile-horizontal .member-price,
  body.pd-card-dir-mobile-horizontal .style-more,
  body.pd-card-dir-mobile-horizontal .more-like {
    display: none !important;
  }
}
