/* Phase H.1 - Catalog card short-description hover tooltip
   This file is intentionally separate from styles.css so it can be added
   without replacing the rest of the storefront styling. */

.catalog-card {
  position: relative;
  overflow: visible;
}

.catalog-card[data-description-tooltip]::before,
.catalog-card[data-description-tooltip]::after {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
}

.catalog-card[data-description-tooltip]::after {
  content: attr(data-description-tooltip);
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(100% + 12px);
  z-index: 40;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--burgundy-dark);
  color: var(--white);
  box-shadow: 0 18px 38px rgba(0, 0, 0, .24);
  font-size: .94rem;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  transform: translateY(8px);
}

.catalog-card[data-description-tooltip]::before {
  content: '';
  position: absolute;
  left: 32px;
  bottom: calc(100% + 4px);
  z-index: 41;
  width: 14px;
  height: 14px;
  background: var(--burgundy-dark);
  transform: translateY(8px) rotate(45deg);
}

.catalog-card[data-description-tooltip]:hover::before,
.catalog-card[data-description-tooltip]:hover::after,
.catalog-card[data-description-tooltip]:focus-visible::before,
.catalog-card[data-description-tooltip]:focus-visible::after {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.catalog-card-description-hint {
  border-bottom: 1px dotted rgba(102, 102, 102, .45);
  cursor: help;
}

@media (hover: none) {
  .catalog-card[data-description-tooltip]::before,
  .catalog-card[data-description-tooltip]::after {
    display: none;
  }

  .catalog-card-description-hint {
    cursor: default;
    border-bottom: none;
  }
}
