@import url('/static/css/category-cards-consistency.css?v=20260925a');

/* Category hover preview — popover styling.
   Renders as an absolutely-positioned card just below the tile on
   desktop hover. Kept lightweight — background, subtle shadow, thin
   product rows. Hidden on touch devices (JS bails out anyway). */

.pc-cat {
    /* Make sure the popover can escape the tile without being clipped. */
    position: relative;
}

.pc-cat__preview {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, -6px);
    width: min(360px, 92vw);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.18),
                0 4px 12px -4px rgba(0, 0, 0, 0.08);
    padding: 12px 14px 14px;
    z-index: 20;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 220ms cubic-bezier(0.4, 0, 0.2, 1);
    /* Reset inherited text-align + color from the tile link. */
    color: #1a1a1a;
    text-align: left;
}

.pc-cat__preview.is-open {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

/* Small connecting notch. */
.pc-cat__preview::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: -2px -2px 4px -3px rgba(0, 0, 0, 0.1);
}

.pc-cat__preview-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.55);
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-weight: 600;
}
.pc-cat__preview-head em { font-style: normal; font-weight: 500; }

.pc-cat__preview-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc-cat__preview-item {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 10px;
    align-items: center;
    padding: 6px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: background 150ms ease;
}
.pc-cat__preview-item:hover { background: rgba(0, 0, 0, 0.04); }

.pc-cat__preview-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f2ee;
    display: block;
}
.pc-cat__preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pc-cat__preview-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.pc-cat__preview-name {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    color: #1a1a1a;
    /* Two-line clamp so long product names stay readable. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pc-cat__preview-price {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
    font-variant-numeric: tabular-nums;
}

.pc-cat__preview-empty {
    margin: 0;
    padding: 8px 4px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.55);
    text-align: center;
}

/* Hide the popover entirely on touch / narrow screens. */
@media (max-width: 900px), (pointer: coarse) {
    .pc-cat__preview { display: none !important; }
}
