/**
 * PawProductPolish 0.1.4 – Skyrise layout 4; responsive PawFastInfo tiles + price alert.
 * Desktop-only polish for purchase area; responsive alert and tiles on all screens.
 * No overflow:hidden, transform, position:relative or z-index on PawFastInfo,
 * to avoid interfering with interactive tooltip popovers.
 */

/* Uniform price alert styling: desktop, tablet and mobile. */
/* Existing price alert: text and actions remain untouched. */
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert {
  display: flow-root;
  box-sizing: border-box;
  width: 100%;
  padding: 15px 17px;
  margin-bottom: 17px;
  border: 1px solid #f0e3d6;
  border-left: 3px solid #b77e4c;
  border-radius: 11px;
  background-color: #fdfaf6;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert > div:first-child {
  margin-right: 15px !important;
  margin-bottom: 0 !important;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert img {
  max-width: 43px !important;
  height: auto;
  opacity: 0.88;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert div[style*="color: red"] {
  color: #725c49 !important;
  font-size: 13px;
  line-height: 1.7;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert div[style*="color: red"] span {
  color: #946034;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-clear,
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-alert-divider {
  display: none !important;
}


/* On small phones keep the same colors/panel but give text more space. */
@media screen and (max-width: 480px) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert {
    padding: 12px 13px;
    margin-bottom: 15px;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert > div:first-child {
    margin-right: 11px !important;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-price-alert img {
    max-width: 36px !important;
  }
}


@media screen and (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  /* Calm, consistent typographic hierarchy. */
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .tvproduct-title-brandimage h1.h1 {
    font-size: clamp(23px, 1.6vw, 28px);
    line-height: 1.3;
    font-weight: 500;
    letter-spacing: -0.015em;
    margin-bottom: 11px;
  }

  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-prices {
    margin-bottom: 19px;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-prices .current-price .price {
    font-size: 27px;
    line-height: 1.2;
    font-weight: 700;
    color: #97602f;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .tvproduct-page-decs {
    color: #403d39;
    line-height: 1.7;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .tvproduct-page-decs p {
    color: inherit;
    line-height: inherit;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .tvproduct-special-desc {
    border-top-color: #e7e1d9;
    border-top-style: solid;
    padding-top: 20px;
  }

  /* PawFastInfo: keep original buttons and their tooltips, improve only wrapper. */
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo {
    box-sizing: border-box;
    display: flow-root;
    width: 100%;
    margin: 0 0 18px;
    padding: 14px 16px 8px;
    background: #faf9f7;
    border: 1px solid #ece7e0;
    border-radius: 11px;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo > div:first-child {
    float: none !important;
    margin-right: 0 !important;
    margin-bottom: 0 !important;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo-divider {
    display: none !important;
  }

  /* Buying area is a single understated card, but all existing form markup stays. */
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .tvproduct-special-desc > .product-actions {
    padding: 19px 20px 13px;
    margin-top: 0;
    border: 1px solid #eae3db;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 7px 24px rgba(51, 41, 30, 0.055);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-variants > .product-variants-item {
    margin-bottom: 17px;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-quantity {
    margin-bottom: 17px;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-actions button[data-button-action="add-to-cart"]:not(:disabled):not(.disabled) {
    min-height: 49px;
    padding: 11px 22px;
    border: 1px solid #2e2a26 !important;
    border-radius: 7px;
    background: #2e2a26 !important;
    color: #fff !important;
    box-shadow: 0 3px 10px rgba(36, 29, 23, 0.11);
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-actions button[data-button-action="add-to-cart"]:not(:disabled):not(.disabled) :is(i, span) {
    color: #fff !important;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-actions button[data-button-action="add-to-cart"]:not(:disabled):not(.disabled):hover {
    border-color: #705037 !important;
    background-color: #705037 !important;
    box-shadow: 0 5px 14px rgba(36, 29, 23, 0.17);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-actions button[data-button-action="add-to-cart"]:focus-visible {
    outline: 2px solid #b77e4c;
    outline-offset: 3px;
  }
}

@media screen and (min-width: 1200px) and (hover: hover) and (pointer: fine) and (prefers-reduced-motion: reduce) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .product-actions button[data-button-action="add-to-cart"] {
    transition: none !important;
  }
}

/* PawFastInfo tiles: visible simultaneously in a responsive, non-scrolling grid.
   No JS handlers, popup internals or data from the original PawFastInfo are changed.
   All rules are strictly scoped to layout 4 and this module's JS-applied class.
   NEVER use overflow:hidden here; it would clip PawFastInfo's popovers.
*/
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo > div:first-child {
  width: 100% !important;
  max-width: 100% !important;
  float: none !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  align-items: stretch;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item {
  display: flex;
  min-width: 0;
  align-self: stretch;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-trigger {
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  min-width: 0;
  width: 100%;
  min-height: 112px;
  margin: 0;
  padding: 12px 7px 10px;
  border: 1px solid #e6ddd2;
  border-radius: 10px;
  background: #fff;
  color: #2d3440;
  text-align: center;
  box-shadow: 0 2px 7px rgba(38,31,22,.025);
  transition: border-color .16s ease, background-color .16s ease, box-shadow .16s ease;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-iconbox {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border-radius: 9px;
  background: #fcfaf7;
  border-color: #d7b48c;
  transition: none;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-label {
  box-sizing: border-box;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: none;
  min-width: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-trigger:hover,
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-trigger[aria-expanded="true"] {
  background: #fffdf9;
  border-color: #c49a6a;
  box-shadow: 0 4px 15px rgba(38,31,22,.065);
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-trigger:is(:hover,:focus-visible,[aria-expanded="true"]) .pfi-iconbox {
  transform: none;
  box-shadow: none;
  background: #fcfaf7;
}
#product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-trigger:focus-visible {
  outline: 2px solid #b77e4c;
  outline-offset: 3px;
}
/* Small screens: two full-width tiles per row. Existing mobile popover panel is intact. */
@media screen and (max-width: 767px) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo {
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid #ece7e0;
    border-radius: 11px;
    background: #faf9f7;
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item {
    position: static; /* PawFastInfo mobile popover panel attaches to .pfi-wrap */
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-trigger {
    min-height: 108px;
    padding: 10px 6px;
  }
}
/* Tablets and narrower computer windows: three equal columns, no swipe carousel. */
@media screen and (min-width: 768px) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item {
    position: relative;
  }
}
/* Tablet / touch landscape: ensure the panel isn't floated or crammed into a partial row. */
@media screen and (min-width: 768px) and (max-width: 1199px),
       screen and (min-width: 1200px) and (hover: none),
       screen and (min-width: 1200px) and (pointer: coarse) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo {
    margin: 0 0 18px;
    padding: 12px;
    border: 1px solid #ece7e0;
    border-radius: 11px;
    background: #faf9f7;
  }
  /* Avoid tooltips spilling over the first/last columns. */
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(3n+1) .pfi-popover {
    left: 0;
    right: auto;
    transform: translate(0,8px);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(3n+1):is(:hover,.is-open) .pfi-popover {
    transform: translate(0,0);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(3n) .pfi-popover {
    left: auto;
    right: 0;
    transform: translate(0,8px);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(3n):is(:hover,.is-open) .pfi-popover {
    transform: translate(0,0);
  }
}
/* True desktop pointer: five columns just like the approved 0.1.1 appearance. */
@media screen and (min-width: 1200px) and (hover: hover) and (pointer: fine) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-grid {
    grid-template-columns: repeat(5, minmax(0,1fr));
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(5n+1) .pfi-popover {
    left: 0;
    right: auto;
    transform: translate(0,8px);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(5n+1):is(:hover,.is-open) .pfi-popover {
    transform: translate(0,0);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(5n) .pfi-popover {
    left: auto;
    right: 0;
    transform: translate(0,8px);
  }
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-item:nth-child(5n):is(:hover,.is-open) .pfi-popover {
    transform: translate(0,0);
  }
}
@media (prefers-reduced-motion: reduce) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content .pawpolish-fastinfo .pfi-trigger {transition:none;}
}

/* PawFastInfo mobile overlay: position its EXISTING single panel beside the
   tapped tile. No changes to the original tooltips or content. Fallback to
   PawFastInfo positioning when JavaScript is unavailable. */
@media screen and (max-width: 767px) {
  #product .tvprduct-image-info-wrapper.product-4 .tv-product-page-content
  .pawpolish-fastinfo .pfi-wrap > .pfi-mobile-panel.pawpolish-mobile-positioned {
    top: var(--paw-pfi-panel-top, 0px);
    bottom: auto;
    left: 0;
    right: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    z-index: 100;
  }
}
