/*
 * HorecaDepot category cards - Phase 2 visual harmonization.
 * Keeps the WoodMart category grid and full-card .wd-fill link behavior.
 */

.category-grid-item .wd-cat-inner {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    position: relative !important;
    background: var(--hd-color-surface) !important;
    border: 1px solid var(--hd-color-border) !important;
    border-radius: var(--hd-radius-lg) !important;
    box-shadow: var(--hd-shadow-sm) !important;
    transform: none !important;
    transition: transform var(--hd-motion-complex) var(--hd-ease-standard),
                box-shadow var(--hd-motion-complex) var(--hd-ease-standard),
                border-color var(--hd-motion-standard) var(--hd-ease-standard) !important;
}

.category-grid-item .wd-cat-thumb {
    width: 100% !important;
    position: relative !important;
    overflow: hidden !important;
    background: var(--hd-color-surface-subtle) !important;
}

.category-grid-item .wd-cat-thumb img {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    transform: none !important;
    transform-origin: center !important;
    transition: transform var(--hd-motion-complex) var(--hd-ease-standard) !important;
}

.category-grid-item .wd-cat-content {
    position: relative !important;
    inset: auto !important;
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    opacity: 1 !important;
    visibility: visible !important;
    background: var(--hd-color-surface) !important;
    border-top: 1px solid #F0F0F0 !important;
    text-align: center !important;
    transform: none !important;
    z-index: 2 !important;
    transition: background-color var(--hd-motion-standard) var(--hd-ease-standard),
                border-color var(--hd-motion-standard) var(--hd-ease-standard) !important;
}

.category-grid-item .wd-cat-content .wd-entities-title,
.category-grid-item .wd-cat-content .wd-entities-title a {
    margin: 0 !important;
    color: var(--hd-color-brand-navy) !important;
    font-weight: 800 !important;
    line-height: 1.3 !important;
    text-align: center !important;
    text-transform: uppercase !important;
    letter-spacing: .04em !important;
    transition: color var(--hd-motion-standard) var(--hd-ease-standard) !important;
}

.category-grid-item .wd-fill {
    z-index: 10 !important;
}

/* Desktop. */
@media (min-width: 1025px) {
    .category-grid-item .wd-cat-content {
        padding: 20px 16px !important;
    }

    .category-grid-item .wd-cat-content .wd-entities-title,
    .category-grid-item .wd-cat-content .wd-entities-title a {
        font-size: 16px !important;
    }
}

/* Tablet and wide mobile: intentionally static and fully specified. */
@media (min-width: 577px) and (max-width: 1024px) {
    .category-grid-item .wd-cat-content {
        padding: 16px 14px !important;
    }

    .category-grid-item .wd-cat-content .wd-entities-title,
    .category-grid-item .wd-cat-content .wd-entities-title a {
        font-size: 15px !important;
    }

    .category-grid-item:hover .wd-cat-inner,
    .category-grid-item:active .wd-cat-inner {
        box-shadow: var(--hd-shadow-sm) !important;
        transform: none !important;
    }

    .category-grid-item:hover .wd-cat-thumb img,
    .category-grid-item:active .wd-cat-thumb img {
        transform: none !important;
    }

    .category-grid-item:hover .wd-cat-content,
    .category-grid-item:active .wd-cat-content {
        background: var(--hd-color-surface) !important;
        border-top-color: #F0F0F0 !important;
    }

    .category-grid-item:hover .wd-cat-content .wd-entities-title,
    .category-grid-item:active .wd-cat-content .wd-entities-title,
    .category-grid-item:hover .wd-cat-content .wd-entities-title a,
    .category-grid-item:active .wd-cat-content .wd-entities-title a {
        color: var(--hd-color-brand-navy) !important;
    }
}

/* Phone. */
@media (max-width: 576px) {
    .category-grid-item .wd-cat-content {
        padding: 12px 10px !important;
    }

    .category-grid-item .wd-cat-content .wd-entities-title,
    .category-grid-item .wd-cat-content .wd-entities-title a {
        font-size: 14px !important;
    }

    .category-grid-item:hover .wd-cat-inner,
    .category-grid-item:active .wd-cat-inner {
        box-shadow: var(--hd-shadow-sm) !important;
        transform: none !important;
    }

    .category-grid-item:hover .wd-cat-thumb img,
    .category-grid-item:active .wd-cat-thumb img {
        transform: none !important;
    }

    .category-grid-item:hover .wd-cat-content,
    .category-grid-item:active .wd-cat-content {
        background: var(--hd-color-surface) !important;
        border-top-color: #F0F0F0 !important;
    }

    .category-grid-item:hover .wd-cat-content .wd-entities-title,
    .category-grid-item:active .wd-cat-content .wd-entities-title,
    .category-grid-item:hover .wd-cat-content .wd-entities-title a,
    .category-grid-item:active .wd-cat-content .wd-entities-title a {
        color: var(--hd-color-brand-navy) !important;
    }
}

/* The dark-label treatment is a desktop fine-pointer interaction only. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
    .category-grid-item:hover .wd-cat-inner {
        box-shadow: var(--hd-shadow-md) !important;
        transform: translateY(-4px) !important;
    }

    .category-grid-item:hover .wd-cat-thumb img {
        transform: scale(1.04) !important;
    }

    .category-grid-item:hover .wd-cat-content {
        background: var(--hd-color-brand-navy) !important;
        border-top-color: var(--hd-color-brand-navy) !important;
    }

    .category-grid-item:hover .wd-cat-content .wd-entities-title,
    .category-grid-item:hover .wd-cat-content .wd-entities-title a {
        color: var(--hd-color-surface) !important;
    }
}

/* Coarse pointers remain static even if :hover is synthesized. */
@media (hover: none), (pointer: coarse) {
    .category-grid-item:hover .wd-cat-inner,
    .category-grid-item:active .wd-cat-inner,
    .category-grid-item:hover .wd-cat-thumb img,
    .category-grid-item:active .wd-cat-thumb img {
        transform: none !important;
    }
}
