/*
  HOOD V8.4 final mobile/catalog typography fix
  Purpose:
  - Compact product card titles without changing SEO/full HTML text.
  - Prevent visible title overflow in catalog/home grids.
  - Normalize product-detail mobile action/price typography after V8.
  Safe scope:
  - Catalog/home/category/manufacturer/search product cards.
  - Product detail mobile action buttons/prices only.
*/

:root {
  --hood-v84-catalog-title-mobile-size: 15px;
  --hood-v84-catalog-title-tablet-size: 16px;
  --hood-v84-catalog-title-desktop-size: 17px;
  --hood-v84-green: #008966;
}

/* Product card title clamp: desktop/tablet */
.product-grid .item-box .product-title,
.product-grid .item-box .product-title a,
.product-list .item-box .product-title,
.product-list .item-box .product-title a,
.home-page-product-grid .item-box .product-title,
.home-page-product-grid .item-box .product-title a,
.category-page .item-box .product-title,
.category-page .item-box .product-title a,
.search-results .item-box .product-title,
.search-results .item-box .product-title a,
.manufacturer-page .item-box .product-title,
.manufacturer-page .item-box .product-title a,
.vendor-page .item-box .product-title,
.vendor-page .item-box .product-title a {
  box-sizing: border-box !important;
}

.product-grid .item-box .product-title,
.product-list .item-box .product-title,
.home-page-product-grid .item-box .product-title,
.category-page .item-box .product-title,
.search-results .item-box .product-title,
.manufacturer-page .item-box .product-title,
.vendor-page .item-box .product-title {
  display: block !important;
  height: 44px !important;
  min-height: 44px !important;
  max-height: 44px !important;
  overflow: hidden !important;
  margin: 10px 0 4px !important;
  padding: 0 8px !important;
  text-align: center !important;
}

.product-grid .item-box .product-title a,
.product-list .item-box .product-title a,
.home-page-product-grid .item-box .product-title a,
.category-page .item-box .product-title a,
.search-results .item-box .product-title a,
.manufacturer-page .item-box .product-title a,
.vendor-page .item-box .product-title a {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-size: var(--hood-v84-catalog-title-desktop-size) !important;
  line-height: 22px !important;
  height: 44px !important;
  max-height: 44px !important;
  font-weight: 400 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

/* Product card rating/price compact */
.product-grid .item-box .rating,
.product-list .item-box .rating,
.home-page-product-grid .item-box .rating,
.category-page .item-box .rating,
.search-results .item-box .rating {
  margin: 2px auto 4px !important;
  line-height: 16px !important;
}

.product-grid .item-box .prices,
.product-list .item-box .prices,
.home-page-product-grid .item-box .prices,
.category-page .item-box .prices,
.search-results .item-box .prices,
.manufacturer-page .item-box .prices,
.vendor-page .item-box .prices {
  margin: 4px 0 12px !important;
  min-height: 26px !important;
  line-height: 26px !important;
  text-align: center !important;
  white-space: nowrap !important;
}

.product-grid .item-box .prices .old-price,
.product-grid .item-box .prices .old-product-price,
.product-list .item-box .prices .old-price,
.product-list .item-box .prices .old-product-price,
.home-page-product-grid .item-box .prices .old-price,
.home-page-product-grid .item-box .prices .old-product-price,
.category-page .item-box .prices .old-price,
.category-page .item-box .prices .old-product-price,
.search-results .item-box .prices .old-price,
.search-results .item-box .prices .old-product-price {
  font-size: 16px !important;
  line-height: 24px !important;
  color: #aaa !important;
}

.product-grid .item-box .prices .actual-price,
.product-grid .item-box .prices .price,
.product-list .item-box .prices .actual-price,
.product-list .item-box .prices .price,
.home-page-product-grid .item-box .prices .actual-price,
.home-page-product-grid .item-box .prices .price,
.category-page .item-box .prices .actual-price,
.category-page .item-box .prices .price,
.search-results .item-box .prices .actual-price,
.search-results .item-box .prices .price {
  font-size: 20px !important;
  line-height: 26px !important;
  font-weight: 400 !important;
  color: var(--hood-v84-green) !important;
}

/* Tablet/mobile product cards */
@media (max-width: 1024px) {
  .product-grid .item-box .product-title,
  .product-list .item-box .product-title,
  .home-page-product-grid .item-box .product-title,
  .category-page .item-box .product-title,
  .search-results .item-box .product-title,
  .manufacturer-page .item-box .product-title,
  .vendor-page .item-box .product-title {
    height: 54px !important;
    min-height: 54px !important;
    max-height: 54px !important;
    margin: 8px 0 3px !important;
    padding: 0 6px !important;
  }

  .product-grid .item-box .product-title a,
  .product-list .item-box .product-title a,
  .home-page-product-grid .item-box .product-title a,
  .category-page .item-box .product-title a,
  .search-results .item-box .product-title a,
  .manufacturer-page .item-box .product-title a,
  .vendor-page .item-box .product-title a {
    -webkit-line-clamp: 3 !important;
    font-size: var(--hood-v84-catalog-title-tablet-size) !important;
    line-height: 18px !important;
    height: 54px !important;
    max-height: 54px !important;
  }

  .product-grid .item-box .prices .actual-price,
  .product-grid .item-box .prices .price,
  .product-list .item-box .prices .actual-price,
  .product-list .item-box .prices .price,
  .home-page-product-grid .item-box .prices .actual-price,
  .home-page-product-grid .item-box .prices .price,
  .category-page .item-box .prices .actual-price,
  .category-page .item-box .prices .price,
  .search-results .item-box .prices .actual-price,
  .search-results .item-box .prices .price {
    font-size: 18px !important;
    line-height: 24px !important;
  }

  .product-grid .item-box .prices .old-price,
  .product-grid .item-box .prices .old-product-price,
  .product-list .item-box .prices .old-price,
  .product-list .item-box .prices .old-product-price,
  .home-page-product-grid .item-box .prices .old-price,
  .home-page-product-grid .item-box .prices .old-product-price,
  .category-page .item-box .prices .old-price,
  .category-page .item-box .prices .old-product-price,
  .search-results .item-box .prices .old-price,
  .search-results .item-box .prices .old-product-price {
    font-size: 14px !important;
    line-height: 22px !important;
  }
}

/* Narrow phones: keep 2-column cards readable but not oversized */
@media (max-width: 480px) {
  .product-grid .item-box .product-title,
  .product-list .item-box .product-title,
  .home-page-product-grid .item-box .product-title,
  .category-page .item-box .product-title,
  .search-results .item-box .product-title,
  .manufacturer-page .item-box .product-title,
  .vendor-page .item-box .product-title {
    height: 51px !important;
    min-height: 51px !important;
    max-height: 51px !important;
    margin: 7px 0 2px !important;
    padding: 0 4px !important;
  }

  .product-grid .item-box .product-title a,
  .product-list .item-box .product-title a,
  .home-page-product-grid .item-box .product-title a,
  .category-page .item-box .product-title a,
  .search-results .item-box .product-title a,
  .manufacturer-page .item-box .product-title a,
  .vendor-page .item-box .product-title a {
    -webkit-line-clamp: 3 !important;
    font-size: var(--hood-v84-catalog-title-mobile-size) !important;
    line-height: 17px !important;
    height: 51px !important;
    max-height: 51px !important;
  }

  .product-grid .item-box .prices,
  .product-list .item-box .prices,
  .home-page-product-grid .item-box .prices,
  .category-page .item-box .prices,
  .search-results .item-box .prices {
    margin: 3px 0 10px !important;
    line-height: 22px !important;
  }

  .product-grid .item-box .prices .actual-price,
  .product-grid .item-box .prices .price,
  .product-list .item-box .prices .actual-price,
  .product-list .item-box .prices .price,
  .home-page-product-grid .item-box .prices .actual-price,
  .home-page-product-grid .item-box .prices .price,
  .category-page .item-box .prices .actual-price,
  .category-page .item-box .prices .price,
  .search-results .item-box .prices .actual-price,
  .search-results .item-box .prices .price {
    font-size: 17px !important;
    line-height: 22px !important;
  }
}

/* Product detail mobile: do not touch desktop; normalize oversized action/price text */
@media (max-width: 768px) {
  .product-details-page .overview-buttons,
  .product-details-page .overview-buttons div,
  .product-details-page .overview-buttons a,
  .product-details-page .product-social-buttons,
  .product-details-page .product-social-buttons a,
  .product-details-page .email-a-friend,
  .product-details-page .compare-products {
    font-size: 15px !important;
    line-height: 20px !important;
    font-weight: 400 !important;
  }

  .product-details-page .prices {
    text-align: center !important;
    margin: 16px 0 18px !important;
  }

  .product-details-page .prices .old-product-price,
  .product-details-page .prices .old-price,
  .product-details-page .prices .old-product-price span,
  .product-details-page .prices .old-price span {
    font-size: 20px !important;
    line-height: 28px !important;
    color: #aaa !important;
  }

  .product-details-page .prices .product-price,
  .product-details-page .prices .actual-price,
  .product-details-page .prices .product-price span,
  .product-details-page .prices .actual-price span {
    font-size: 27px !important;
    line-height: 32px !important;
    color: var(--hood-v84-green) !important;
    font-weight: 400 !important;
  }

  .product-details-page .tier-prices,
  .product-details-page .tier-prices table,
  .product-details-page .tier-prices th,
  .product-details-page .tier-prices td {
    font-size: 14px !important;
    line-height: 20px !important;
  }

  .product-details-page .tier-prices th,
  .product-details-page .tier-prices td {
    padding: 9px 8px !important;
  }

  .product-details-page .add-to-cart-button {
    font-size: 18px !important;
    line-height: 24px !important;
    min-height: 56px !important;
  }
}