/* Cilo list layout for collection pages. Applies to the cilo-collection and brand collection templates. */
.template-collection:is(.template-cilo-collection, .template-brand) {
  .product-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .product-card__content {
    flex-direction: row;
    gap: 16px;
    padding-bottom: 32px;
    border-bottom: 1px solid #D4D1CE;
    cursor: unset;
  }

  .product-grid:last-child .product-card__content {
    border-bottom: none;
  }

  .cilo-collection-card-wrapper {
    display: flex;
    flex-direction: row;
    gap: 16px;
    width: 100%;
  }

  .cilo-collection-card-wrapper:hover {
    padding: 20px;
    border: 3px solid #554F49;
    border-radius: 4px;
  }

  .ccpc-main-info-container {
    display: flex;
    gap: 24px;
    width: 100%;
  }

  /* Keep tall (portrait) product images inside the 300px image box */
  .ccpc_image_container img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 300px;
    margin: 0 auto;
    object-fit: contain;
  }

  .custom-product-price-wrapper {
    display: flex;
    flex-direction: column;
  }

  .custom-product-price {
    font-family: 'TiltWarp';
    color: #120B04;
    font-size: 24PX;
    font-weight: 400;
    line-height: 100%;
    letter-spacing: -0.5%;
  }

  .custom-product-price.with-compare {
    color: #E61700;
  }

  .custom-product-compare-price {
    color: #554F49;
    text-decoration: line-through;
    font-size: 14px;
    line-height: 100%;
    font-weight: 600;
  }

  .custom-product-discount {
    background: #e61700;
    color: #fff;
    padding: 0 4px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
  }

  .custom-price-info-wrapper {
    position: relative;
    display: flex;
    align-items: center;
  }

  .custom-price-info-icon {
    width: 16px;
    height: 16px;
    cursor: pointer;
    color: #444;
  }

  .custom-price-tooltip {
    position: absolute;
    top: -50px;
    left: 0;
    min-width: 220px;
    padding: 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    z-index: 10;
    font-size: 13px;
    line-height: 1.5;
  }

  .custom-price-info-wrapper:hover .custom-price-tooltip {
    opacity: 1;
    visibility: visible;
  }


  .custom-product-rating,
  .custom-empty-rating {
    font-size: 14px;
    display: flex;
    gap: 4px;
    align-items: center;
    color: #554F49;
  }

  .offers-container-wrapper,
  .product-offers {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .product-offers__item {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #D4D1CE;
    border-radius: 4px;
    padding: 7px 8px;
  }

  .bundle-offer.offer-icon-container {
    background: #B1FFE7;
  }

  .offer-icon-container {
    max-width: 30px;
    display: flex;
    background: #ccc7ff;
    border-radius: 4px;
    width: 100%;
    height: 30px;
  }

  .offer-icon-container img {
    width: 16px;
    height: 16px;
    margin: auto;
  }

  .product-offers__text {
    font-size: 12px;
    font-weight: 500;
    line-height: 17px;
    color: #120B04;
  }

  .product-variant-summary {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .variant-row {
    font-size: 14px;
    line-height: 20px;
  }

  .variant-label {
    font-weight: 700;
    color: #120B04;
  }

  .variant-value {
    font-weight: 500;
    color: #554F49;
  }

  .mobile-product-details-container {
    display: none;
  }
}

/* Collection description: imported descriptions often start with their own <h2>.
   Show that first heading as a subheading under the collection title instead of a second large title. */
.template-collection.template-cilo-collection .text-block.rte > h2:first-child {
  font-family: var(--font-body--family);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: normal;
  margin-block-end: 8px;
}

/* ===========================
   MOBILE PRODUCT CARD
=========================== */

@media screen and (max-width: 990px) {

  .template-collection:is(.template-cilo-collection, .template-brand) .product-card__content {
    padding: 16px;
  }

  .template-collection:is(.template-cilo-collection, .template-brand) .cilo-collection-card-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "header header"
      "image price"
      "button button"
      "bundle bundle"
      "info info"
      "compare compare"
      "mobile-product-details-container mobile-product-details-container";
    column-gap: 16px;
    row-gap: 0;
  }

  .template-collection:is(.template-cilo-collection, .template-brand) .ccpc-main-info-container {
    display: contents;
  }

  .template-collection:is(.template-cilo-collection, .template-brand) {
    /* Header */

    .ccpc__info {
      display: contents;
    }

    .ccpc__header {
      grid-area: header;
      display: flex;
      flex-direction: column;
      gap: 6px;
      margin-bottom: 16px;
    }

    /* Image */

    .ccpc__media {
      grid-area: image;
      /* width: 120px;
      max-width: 120px; */
      align-self: start;
      min-width: unset;
    }

    .ccpc_image_container {
      /* width: 120px;
      height: 150px; */
      max-width: none;
      max-height: none;
    }

    .ccpc__image {
      width: 100%;
      height: 100%;
      object-fit: contain;
    }

    /* Right Side */

    .ccpc_product_info {
      grid-area: price;
      max-width: none;
      width: 100%;
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* Button */

    .ccpc-add-to-cart {
      grid-area: button;
    }

    .ccpc__cta {
      width: 100%;
      padding: 14px;
    }

    /* Bundle Offer */

    .bundle-offer-container {
      grid-area: bundle;
    }

    /* Specifications */

    .ccpc__bullets,
    .product-variant-summary {
      grid-column: 1/-1;
    }

    /* Compare */

    .compare-checkbox {
      grid-area: compare;
    }

    /* Typography */

    .ccpc__title {
      font-size: 20px;
      line-height: 26px;
    }

    .custom-product-price {
      font-size: 20px;
    }

    .custom-product-rating,
    .custom-empty-rating {
      font-size: 14px;
    }

    /* Desktop-only elements */

    .ccpc__type {
      display: none;
    }

    .ccpc-product-details {
      grid-area: info;
      border: 1px solid #D4D1CE;
      border-radius: 4px;
      padding: 16px;
    }

    .desktop-product-details {
      display: block;
    }

    .desktop-product-details {
      display: none;
    }

    .mobile-product-details-container {
      display: flex;
      flex-direction: column;
      gap: 8px;
      grid-area: mobile-product-details-container;
      margin-top: 16px;
    }

    .mobile-product-details {
      display: block;
      border: 1px solid #D4D1CE;
      border-radius: 4px;
      overflow: hidden;

    }

    .mobile-product-details summary {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px;
      cursor: pointer;
      list-style: none;
      font-weight: 700;
    }

    .mobile-product-details summary::-webkit-details-marker {
      display: none;
    }

    .mobile-product-details-content {
      padding: 0 16px 16px;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .mobile-product-details[open] svg {
      transform: rotate(180deg);
      transition: .3s;
    }

    .ccpc-add-to-cart.desktop,
    .bundle-offer-container.desktop {
      display: none;
    }
  }
}

@media screen and (max-width: 425px) {
  .template-collection:is(.template-cilo-collection, .template-brand) .cilo-collection-card-wrapper {
    grid-template-columns: 120px 1fr;
  }
}