/* Noor Naksha v1.11.23 — product card optimization.
 * Scope: home product showcase + reusable product sections + related theme product cards.
 * Goals approved by user:
 * - mobile 2 products per row
 * - titles clamp to 2 lines unless user explicitly set title-line control
 * - no thumbnail crop; full artwork visible
 * - compact inner padding and button spacing
 * - remove extra empty space from over-tall title boxes
 */

/* Shared card polish: slightly better breathing room without changing the premium look. */
.nn-product-card,
.nn-empty-product-card-v1112,
.woocommerce ul.products li.product .nn-shop-product-card-v18{
  overflow:hidden!important;
}
.nn-product-card .nn-product-info,
.nn-empty-product-info-v1112,
.nn-shop-product-info-v18{
  padding:10px 10px 12px!important;
  display:flex!important;
  flex-direction:column!important;
  min-width:0!important;
  height:auto!important;
}
.nn-product-card .nn-price,
.nn-empty-product-price-v1112,
.nn-shop-product-price-v18{
  margin-top:2px!important;
}

/* Default title clamp: 2 lines unless the dedicated title-lines control is in use. */
body:not(.nn-v1121-custom-title-lines) .nn-product-card .nn-product-info h3,
body:not(.nn-v1121-custom-title-lines) .nn-empty-product-info-v1112 h3,
body:not(.nn-v1121-custom-title-lines) .nn-shop-product-info-v18 h2.woocommerce-loop-product__title{
  display:-webkit-box!important;
  -webkit-box-orient:vertical!important;
  -webkit-line-clamp:2!important;
  line-clamp:2!important;
  overflow:hidden!important;
  min-height:2.7em!important;
  max-height:2.7em!important;
  line-height:1.35!important;
  margin-bottom:6px!important;
}

/* Purchase area stays aligned but more compact. */
.nn-product-card .nn-purchase-buttons-v1117,
.nn-empty-product-info-v1112 .nn-purchase-buttons-v1117,
.nn-shop-product-action-v18 .nn-purchase-buttons-v1117{
  margin-top:auto!important;
  padding-top:8px!important;
  gap:6px!important;
}

/* Full artwork visible instead of being cut. */
.nn-products-section .nn-product-image,
.nn-product-section-v17 .nn-product-image,
.nn-empty-product-image-v1112,
.nn-shop-product-image-v18{
  background-color:#ffffff!important;
}
.nn-products-section .nn-product-image,
.nn-product-section-v17 .nn-product-image,
.nn-empty-product-image-v1112{
  background-size:contain!important;
  background-position:center center!important;
  background-repeat:no-repeat!important;
}
.nn-shop-product-image-v18 img,
.nn-empty-product-image-v1112 img{
  object-fit:contain!important;
  object-position:center center!important;
  background-color:#ffffff!important;
}

/* Mobile-first optimization matching approved mock. */
@media (max-width:720px){
  /* Always show 2 cards per row on mobile for the homepage/product sections. */
  .nn-products-section .nn-product-grid,
  .nn-product-section-v17.nn-product-layout-grid .nn-product-grid-v17{
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:12px!important;
  }

  /* Less tall image stage with full thumbnail still visible. */
  .nn-products-section .nn-product-image,
  .nn-product-section-v17 .nn-product-image{
    height:clamp(150px,38vw,178px)!important;
  }

  .nn-product-card .nn-product-info,
  .nn-empty-product-info-v1112,
  .nn-shop-product-info-v18{
    padding:8px 8px 10px!important;
  }

  /* Exactly 2 visible lines, no extra empty space below short titles. */
  body:not(.nn-v1121-custom-title-lines) .nn-product-card .nn-product-info h3,
  body:not(.nn-v1121-custom-title-lines) .nn-empty-product-info-v1112 h3,
  body:not(.nn-v1121-custom-title-lines) .nn-shop-product-info-v18 h2.woocommerce-loop-product__title{
    min-height:2.55em!important;
    max-height:2.55em!important;
    line-height:1.28!important;
    font-size:12px!important;
    margin-bottom:5px!important;
  }

  .nn-product-card .nn-price,
  .nn-empty-product-price-v1112,
  .nn-shop-product-price-v18,
  .nn-product-card .price,
  .nn-shop-product-card-v18 .price{
    font-size:11.5px!important;
    line-height:1.25!important;
  }
  .nn-product-card .price del,
  .nn-shop-product-card-v18 .price del,
  .nn-empty-product-price-v1112 del{font-size:.92em!important}
  .nn-product-card .price ins,
  .nn-shop-product-card-v18 .price ins,
  .nn-empty-product-price-v1112 ins{font-size:1em!important}

  /* Compact action buttons for better mobile look. */
  .nn-product-card .nn-purchase-buttons-v1117,
  .nn-shop-product-action-v18 .nn-purchase-buttons-v1117,
  .nn-empty-product-info-v1112 .nn-purchase-buttons-v1117{
    gap:4px!important;
    margin-top:8px!important;
    padding-top:0!important;
  }
  .nn-product-card .nn-purchase-buttons-v1117>.nn-purchase-btn-v1117,
  .nn-shop-product-action-v18 .nn-purchase-buttons-v1117>.nn-purchase-btn-v1117,
  .nn-empty-product-info-v1112 .nn-purchase-buttons-v1117>.nn-purchase-btn-v1117{
    min-height:34px!important;
    height:34px!important;
    border-radius:7px!important;
    padding:0 4px!important;
    font-size:10.5px!important;
    line-height:1!important;
  }

  /* If ratings are still enabled, keep them compact. */
  .nn-product-card .nn-rating-row,
  .nn-shop-product-card-v18 .star-rating,
  .nn-empty-product-info-v1112 .nn-rating-row{
    margin-top:2px!important;
    margin-bottom:0!important;
    font-size:10px!important;
  }
}

@media (max-width:360px){
  .nn-product-card .nn-purchase-buttons-v1117>.nn-purchase-btn-v1117,
  .nn-shop-product-action-v18 .nn-purchase-buttons-v1117>.nn-purchase-btn-v1117,
  .nn-empty-product-info-v1112 .nn-purchase-buttons-v1117>.nn-purchase-btn-v1117{
    font-size:10px!important;
  }
}
