/**
 * Product Families Display Styles
 * List-view cards with sticky table of contents sidebar
 */

 /* Misc Styles for other page elements */
.radial-overlay.wp-block-kadence-rowlayout .has-theme-palette-9-color a:hover {
    color: #fff;
}

h1.wp-block-kadence-advancedheading {
    word-break: keep-all;
}

/* ===================================
   Main Wrapper
   =================================== */
.product-families-display-wrapper {
    display: flex;
    gap: 40px;
    max-width: 1920px;
    margin: 0 auto 75px auto;
    padding: 40px 20px;
    align-items: flex-start;
}

/* ===================================
   Sticky Table of Contents
   =================================== */
.product-families-toc {
    position: sticky;
    top: 50px;
    width: 33.333%;
    max-height: 500px;
    flex-shrink: 0;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.toc-title {
    margin: 0;
    font-weight: 600;
    color: #000000;
}

.toc-scroll-top {
    background: #ffffff;
    border: 2px solid #ED1C24;
    cursor: pointer;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toc-scroll-top:hover {
    background: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toc-scroll-top:active,
.toc-scroll-top:focus {
    background: none;
    box-shadow: none;
}

.toc-divider {
    height: 1px;
    background: #ED1C24;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.toc-list {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex: 1;
}

.toc-item {
    display: flex;
    gap: 8px;
    padding: 10px;
    text-decoration: none;
    color: #000000;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    font-size: 16px;
}

.toc-item:hover {
    border-color: #ED1C24;
}

.toc-item.active {
    color: #ED1C24;
    border-color: #ED1C24;
}

.toc-number {
    font-weight: 600;
    flex-shrink: 0;
}

.toc-text {
    flex: 1;
}

/* ===================================
   Cards Container
   =================================== */
.product-families-cards-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 40px;
    scroll-margin-top: 150px;
}

/* ===================================
   Product Family Card
   =================================== */
.product-family-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    overflow: visible;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    scroll-margin-top: 150px;
    background-position: 50% 50%;
}

.product-family-card .card-link-wrapper {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    min-height: 200px;
    flex: 1;
}

.product-family-card .card-main-content {
    display: flex;
    flex-direction: row;
    flex: 1;
}

.product-family-card:hover {
    background:
        url('../product-lines-display/img/random_noise_texture.avif') 50% / cover no-repeat,
        url('../product-lines-display/img/brushed-metal-horizontal.avif') 50%/cover no-repeat,
        linear-gradient(180deg,#ed1c24 0,#af0f0c 40%,#ed1c24 100%);
    background-blend-mode: overlay, soft-light, darken;
    box-shadow: 27.558px 73.488px 146.977px 0 rgba(0, 0, 0, 0.40);
    z-index: 10;
    transform: scale(1.02);
    border-color: transparent;
}

/* Admin Edit Button */
.product-family-card .admin-edit-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    text-decoration: none;
    font-size: 14px;
}

/* Card Image */
.product-family-card .card-image {
    min-width: 160px;
    width: 160px;
    height: auto;
    margin: 20px;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-family-card .card-image img {
    width: 160px;
    height: 160px;
    object-fit: contain;
}

.product-family-card .card-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
}

.product-family-card .placeholder-icon {
    font-size: 48px;
    opacity: 0.3;
}

/* Card Content */
.product-family-card .card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-family-card .card-title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #000000;
    transition: color 0.4s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.product-family-card:hover .card-title {
    color: #ffffff;
}

/* PDF Label and Icon */
.product-family-card .pdf-label {
    font-size: 18px;
    font-weight: 400;
    color: inherit;
}

.product-family-card .pdf-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #2F2F2F;
    transition: color 0.4s ease;
}

.product-family-card:hover .pdf-icon {
    color: #ffffff;
}

.product-family-card .card-description {
    color: #333333;
    line-height: 1.6;
    font-size: 16px;
    transition: color 0.4s ease;
    flex: 1;
}

.product-family-card:hover .card-description {
    color: #f0f0f0;
}

/* Card Actions / View Details Button */
.product-family-card .card-actions {
    display: flex;
    justify-content: flex-end;
}

.product-family-card .card-actions .btn {
    transition: background-color, color 0.4s ease;
}

.product-family-card:hover .card-actions .btn {
    background-color: #000;
    color: #fff;
}

/* ===================================
   Responsive Adjustments
   =================================== */
@media (max-width: 1350px) {
    h1.wp-block-kadence-advancedheading {
        font-size: 80px;
    }
}


@media (max-width: 1024px) {
    .product-families-display-wrapper {
        flex-direction: column;
    }

    .product-families-toc {
        position: relative;
        top: 0;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    h1.wp-block-kadence-advancedheading {
        font-size: 60px;
    }
    .product-families-display-wrapper {
        padding: 20px 10px;
    }

    .product-family-card .card-main-content {
        flex-direction: column;
    }

    .product-family-card .card-image {
        width: 100%;
        height: 200px;
        max-width: 100%;
        margin: 0;
    }

    .product-family-card .card-content {
        padding: 15px;
    }

    .product-family-card .card-title {
        font-size: 20px;
    }

    .product-family-card .card-actions {
        bottom: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    h1.wp-block-kadence-advancedheading {
        font-size: 42px;
    }
}

