/* style-layout01.css - Clean Neo-Corporate Theme (Inheriting Typography & Colors) */

:root {
    --bg-light: #F8FAFC;
    --card-bg: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Restyle Body if we add layout01 class */
body.layout01 {
    background-color: var(--bg-light);
}

/* Main Container Override */
body.layout01 #content {
    background: transparent !important;
}

/* Scoped exclusively to .channel-product */
.channel-product {
    background: transparent !important;
}

/* Top Feature Block */
.channel-product .content-block {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px 30px 10px 30px; /* Bottom reduced by 10px */
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    margin-bottom: 40px; /* Further reduced margin */
}

.channel-product .content-block header h2 {
    text-align: center;
    margin-top: 10px; /* Increased top boundary height */
    margin-bottom: 30px; /* Increased bottom boundary height */
}

.channel-product .block-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px; /* Reduced gap to save space */
    justify-content: center;
}

.channel-product .block-grid > div {
    flex: 1 1 calc(25% - 16px); /* 4 items per row with new gap */
    min-width: 140px; 
    background: var(--bg-light);
    padding: 10px; /* Equal padding on all 4 sides */
    border-radius: 8px; /* Slightly smaller radius */
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.channel-product .block-grid > div i {
    margin-bottom: 0px; /* Removed margin */
    display: block;
    transition: transform 0.3s;
}

.channel-product .block-grid > div:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-sm);
    border-color: var(--border-color);
    background: #F0F9FF; /* Keeping a subtle highlight */
}

.channel-product .block-grid > div:hover i {
    transform: scale(1.1);
}

.channel-product .block-grid .clr {
    display: none; /* Hide default clear float since we use flexbox */
}

/* Section Titles (GaN Transistor / GaN SiP) */
.channel-product > section {
    margin-bottom: 80px;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.channel-product > section:hover {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.channel-product section > header {
    text-align: center;
    margin-bottom: 8px;
}

.channel-product section > h2 {
    text-align: center;
    margin-bottom: 40px;
}

/* Minimalist Tables */
.channel-product .channel-file-tb {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.channel-product .channel-file-tb table {
    width: 100%;
    min-width: 1200px; /* Ensure columns never squeeze or overlap on any screen size */
    border-collapse: collapse;
    table-layout: auto; /* Distribute columns based on content sizes naturally */
}

.channel-product .channel-file-tb th {
    background: #F8FAFC;
    padding: 12px 10px;
    text-align: center;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
}

/* Center alignment for specific data columns */
.channel-product .channel-file-tb th:nth-child(n+2),
.channel-product .channel-file-tb td:nth-child(n+2) {
    text-align: center;
}

.channel-product .channel-file-tb td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
    white-space: nowrap; 
    font-size: 16px;
}

/* List view: enlarge product images on desktop only */
@media (min-width: 769px) {
    .channel-product .channel-file-tb td img {
        max-height: 150px !important;
        width: auto !important;
        height: auto !important;
    }
}

@media (max-width: 767px) {
    .channel-product .channel-file-tb td[data-label="Part Number"] {
        background-color: #E0F2FE !important; /* Restore Part Number highlight on mobile */
        font-weight: 700;
        color: #0F172A;
    }
}

.channel-product .channel-file-tb tr:last-child td {
    border-bottom: none;
}

.channel-product .channel-file-tb tr:hover td {
    background-color: #F8FAFC;
}

.channel-product .channel-file-tb tr:hover td[data-label="Datasheet"] {
    background-color: transparent; 
}

/* Specific Column Width Tweaks */
.channel-product .channel-file-tb th:nth-child(1), 
.channel-product .channel-file-tb td:nth-child(1) { width: 220px; } /* Image enlarged for double 80px images */
.channel-product .channel-file-tb th:nth-child(2), 
.channel-product .channel-file-tb td:nth-child(2) { width: 140px; } /* Part Number reduced */
.channel-product .channel-file-tb th:nth-child(3), 
.channel-product .channel-file-tb td:nth-child(3) { width: 60px; } /* Part link */
.channel-product .channel-file-tb th:nth-child(4), 
.channel-product .channel-file-tb td:nth-child(4) { width: 60px; } /* Package link */
.channel-product .channel-file-tb th:nth-child(5), 
.channel-product .channel-file-tb td:nth-child(5) { width: 90px; } /* Qualification */
.channel-product .channel-file-tb th:nth-child(6), 
.channel-product .channel-file-tb td:nth-child(6) { width: 80px; } /* Generation */
.channel-product .channel-file-tb th:nth-child(7), 
.channel-product .channel-file-tb td:nth-child(7) { width: 90px; } /* Product Status */
.channel-product .channel-file-tb th:nth-child(8), 
.channel-product .channel-file-tb td:nth-child(8) { width: 70px; } /* Package reduced */
.channel-product .channel-file-tb th:nth-child(9), 
.channel-product .channel-file-tb td:nth-child(9) { 
    width: 95px; 
    white-space: normal; /* Allow header to wrap if necessary to avoid overlap */
} /* RDS */
.channel-product .channel-file-tb th:nth-child(10), 
.channel-product .channel-file-tb td:nth-child(10) { width: 70px; } /* VDS */

.channel-product .channel-file-tb td[data-label="Part Number"] {
    font-weight: 700;
    color: #0F172A; /* Darker for better contrast */
}

.channel-product .channel-file-tb td[data-label="Product Status"] {
    white-space: normal; /* Allow status to wrap to save width */
    min-width: 90px;
}

.channel-product .channel-file-tb th:nth-child(11), 
.channel-product .channel-file-tb td:nth-child(11) { 
    width: 105px; 
    text-align: center;
    vertical-align: middle !important;
}

.channel-product .channel-file-tb td[data-label="Datasheet"] .btn {
    display: block;
    padding: 6px 8px;
    font-size: 13px;
    margin: 8px auto !important; 
    width: 85px;
    text-align: center;
    box-sizing: border-box;
}

/* View Toggle Buttons UI */
.view-toggle-container {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    max-width: 1200px; /* Aligns with original layout sections */
    margin: 0 auto 20px auto;
    padding: 0 15px; /* Ensures safe edge padding on smaller screens */
}

@media (max-width: 768px) {
    .view-toggle-container {
        justify-content: center !important;
        margin: 20px auto 20px auto !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}

.view-toggle-btn {
    background: #FFFFFF;
    border: 1px solid var(--border-color);
    color: #64748B;
    padding: 8px 18px;
    border-radius: 999px; /* Pill shape */
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    outline: none;
}

.view-toggle-btn:hover {
    background: #F8FAFC;
    color: #0F172A;
    border-color: #CBD5E1;
}

.view-toggle-btn.active {
    background: #E0F2FE;
    color: #0284C7;
    border-color: #BAE6FD;
    box-shadow: 0 2px 4px -1px rgba(2, 132, 199, 0.1);
    font-weight: 600;
}

/* Grid View Modifiers */
.channel-product .channel-file-tb.view-grid {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
}

.channel-product .channel-file-tb.view-grid table {
    display: block !important;
    background: transparent;
    width: 100%;
    min-width: 0 !important;
    border: none !important;
    border-collapse: separate;
}

.channel-product .channel-file-tb.view-grid thead {
    display: none !important; /* Hide table headers */
}

.channel-product .channel-file-tb.view-grid tbody {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); /* Desktop min card width 360px */
    gap: 24px;
    padding: 0;
    background: transparent;
}

/* Transform row into card */
.channel-product .channel-file-tb.view-grid tr {
    display: flex !important;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    overflow: hidden;
}

.channel-product .channel-file-tb.view-grid tr:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #BAE6FD;
}

.channel-product .channel-file-tb.view-grid tr:hover td {
    background-color: transparent; /* Disable the list-view row hover color */
}

/* Transform cell into block item */
.channel-product .channel-file-tb.view-grid td {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px dashed var(--border-color);
    text-align: right;
    width: auto;
}

.channel-product .channel-file-tb.view-grid td:last-child {
    border-bottom: none;
    margin-top: auto; /* Push button container to the bottom */
    padding-top: 20px;
    padding-bottom: 20px;
    background: #F8FAFC; /* Footer aesthetic for buttons */
}

/* Data-label projection (Displays header name inside card) */
.channel-product .channel-file-tb.view-grid td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: #64748B;
    font-size: 0.85rem;
    text-align: left;
    padding-right: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Hide label for Data-label of empty string (Image row) */
.channel-product .channel-file-tb.view-grid td[data-label=""]::before {
    display: none !important;
}

.channel-product .channel-file-tb.view-grid td[data-label=""] {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    height: 260px; /* Further increased for even larger images */
    border-bottom: 1px solid var(--border-color);
    background: #FFFFFF;
}

.channel-product .channel-file-tb.view-grid td img {
    max-width: 340px !important;
    max-height: 220px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    margin: 0 auto;
}

/* Title (Part Number) styling */
.channel-product .channel-file-tb.view-grid td[data-label="Part Number"] {
    font-size: 1.25rem;
    font-weight: 800;
    color: #0F172A;
    justify-content: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: #F8FAFC;
    text-align: center;
}
.channel-product .channel-file-tb.view-grid td[data-label="Part Number"]::before {
    display: none !important; /* Hide label, acts as main title */
}

/* Buttons wrapper specifically */
.channel-product .channel-file-tb.view-grid td[data-label="Datasheet"] {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
}
.channel-product .channel-file-tb.view-grid td[data-label="Datasheet"]::before {
    display: none !important;
}

.channel-product .channel-file-tb.view-grid td[data-label="Datasheet"] .btn {
    flex: 1;
    margin: 0 !important;
    text-align: center;
    padding: 12px 0;
    width: auto;
    max-width: none;
}

/* Removed button overrides completely so it inherits .btn-normal from original CSS */

/* Stack buttons vertically under 1200px (Already stack by default now, so this is just for gap/alignment adjustments) */
@media (max-width: 1200px) {
    .channel-product .channel-file-tb td[data-label="Datasheet"] {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center; 
        border-bottom: none;
    }
}

/* On mobile, buttons match grid card layout (side-by-side, equal width) */
@media (max-width: 768px) {
    .channel-product .channel-file-tb.view-grid td[data-label="Datasheet"] {
        flex-direction: row !important;
        justify-content: center !important;
        gap: 6px !important;
    }
    .channel-product .channel-file-tb.view-grid td[data-label="Datasheet"]::before {
        display: none !important; /* Hide 'Datasheet' label text */
    }
    .channel-product .channel-file-tb.view-grid td[data-label="Datasheet"] .btn {
        flex: 1 !important;
        text-align: center !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        font-size: 0.78rem !important;
        width: auto !important;
        max-width: none !important;
    }
    
    /* Force grid view styling only for .view-grid containers on mobile */
    .channel-product .channel-file-tb.view-grid {
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }
    
    .channel-product .channel-file-tb.view-grid table {
        display: block !important;
        background: transparent !important;
        width: 100% !important;
        min-width: 0 !important;
        border: none !important;
        border-collapse: separate !important;
    }
    
    .channel-product .channel-file-tb.view-grid thead {
        display: none !important;
    }
    
    .channel-product .channel-file-tb.view-grid tbody {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)) !important; /* Mobile/tablet min card width 360px */
        gap: 16px !important;
        padding: 0 !important;
        background: transparent !important;
    }
    
    .channel-product .channel-file-tb.view-grid tr {
        display: flex !important;
        flex-direction: column !important;
        background: #FFFFFF !important;
        border-radius: 12px !important;
        border: 1px solid var(--border-color) !important;
        box-shadow: var(--shadow-md) !important;
        transition: all 0.3s ease !important;
        overflow: hidden !important;
    }
    
    .channel-product .channel-file-tb.view-grid tr:hover {
        transform: translateY(-4px) !important;
        box-shadow: var(--shadow-lg) !important;
        border-color: #BAE6FD !important;
    }
    
    .channel-product .channel-file-tb.view-grid tr:hover td {
        background-color: transparent !important;
    }
    
    .channel-product .channel-file-tb.view-grid td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 12px !important;
        border-bottom: 1px dashed var(--border-color) !important;
        text-align: right !important;
        width: auto !important;
        font-size: 0.8rem !important;
    }
    
    .channel-product .channel-file-tb.view-grid td:last-child {
        border-bottom: none !important;
        margin-top: auto !important;
        padding-top: 15px !important;
        padding-bottom: 15px !important;
        background: #F8FAFC !important;
    }
    
    .channel-product .channel-file-tb.view-grid td[data-label]::before {
        content: attr(data-label) !important;
        font-weight: 600 !important;
        color: #64748B !important;
        font-size: 0.72rem !important;
        text-align: left !important;
        padding-right: 6px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }
    
    .channel-product .channel-file-tb.view-grid td[data-label=""]::before {
        display: none !important;
    }
    
    .channel-product .channel-file-tb.view-grid td[data-label=""] {
        justify-content: center !important;
        border-bottom: none !important;
        padding: 10px !important;
    }
    
    /* Center and downsize Title (Part Number) on mobile/tablet */
    .channel-product .channel-file-tb.view-grid td[data-label="Part Number"] {
        font-size: 0.95rem !important;
        font-weight: 800 !important;
        padding: 10px !important;
        justify-content: center !important;
        border-bottom: 1px solid var(--border-color) !important;
        background: #F8FAFC !important;
        text-align: center !important;
    }
    
    .channel-product .channel-file-tb.view-grid td.product-img-cell img {
        max-width: 45% !important;
        max-height: 160px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .channel-product .channel-file-tb.view-grid td.product-img-cell {
        height: auto !important;
    }
    
    .channel-product .channel-file-tb.view-grid .product-img-wrap {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 12px !important;
    }

    /* List view mobile: Restore standard table layout (TABLE RWD) */
    .channel-product .channel-file-tb:not(.view-grid) {
        display: block !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        width: 100% !important;
        background: var(--card-bg) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 16px !important;
        box-shadow: var(--shadow-lg) !important;
    }
    .channel-product .channel-file-tb:not(.view-grid) table {
        display: table !important;
        width: 100% !important;
        min-width: 1200px !important; /* Ensure ample width for all columns on mobile RWD */
        border-collapse: collapse !important;
        border: none !important;
        table-layout: auto !important; /* Allow browser to distribute widths based on content size */
    }
    .channel-product .channel-file-tb:not(.view-grid) thead {
        display: table-header-group !important;
    }
    .channel-product .channel-file-tb:not(.view-grid) tbody {
        display: table-row-group !important;
    }
    .channel-product .channel-file-tb:not(.view-grid) tr {
        display: table-row !important;
        border-bottom: 1px solid var(--border-color) !important;
        background: transparent !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    .channel-product .channel-file-tb:not(.view-grid) th,
    .channel-product .channel-file-tb:not(.view-grid) td {
        display: table-cell !important;
        text-align: center !important;
        padding: 12px 10px !important;
        white-space: nowrap !important;
        vertical-align: middle !important;
        border: none !important;
        border-bottom: 1px solid var(--border-color) !important;
    }
    .channel-product .channel-file-tb:not(.view-grid) td::before {
        display: none !important; /* Hide labels used in stacked view */
    }
    .channel-product .channel-file-tb:not(.view-grid) td[data-label="Datasheet"] {
        display: table-cell !important;
        text-align: center !important;
    }
    .channel-product .channel-file-tb:not(.view-grid) td[data-label="Datasheet"]::before {
        display: none !important;
    }
    .channel-product .channel-file-tb:not(.view-grid) td[data-label="Datasheet"] .btn {
        display: block !important;
        margin: 8px auto !important;
        width: 85px !important;
        max-width: 85px !important;
        flex: none !important;
    }
}

/* Portrait Mobile Devices (< 480px): force single-column stretched cards to keep centered */
@media (max-width: 480px) {
    .channel-product .channel-file-tb.view-grid tbody {
        grid-template-columns: repeat(auto-fill, minmax(min(360px, 100%), 1fr)) !important;
        gap: 12px !important;
    }
}

/* Product image wrapper to handle double images */
.product-img-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

/* List view image size adjustments - Restored to 80px (2x larger) */
.channel-product .channel-file-tb td.product-img-cell img {
    max-height: 80px !important;
    max-width: 80px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

/* Grid view image container and wrap overrides - Restored to 260px (2x larger) */
.channel-product .channel-file-tb.view-grid td.product-img-cell {
    height: 260px !important;
}

.channel-product .channel-file-tb.view-grid .product-img-wrap {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.channel-product .channel-file-tb.view-grid td.product-img-cell img {
    max-width: 45% !important;
    max-height: 200px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
}

/* Mobile responsive for double images in both List and Grid views */
@media (max-width: 768px) {
    .product-img-wrap {
        gap: 6px;
    }
    .channel-product .channel-file-tb td.product-img-cell img {
        max-height: 60px !important;
        max-width: 60px !important;
    }
    .channel-product .channel-file-tb.view-grid td.product-img-cell {
        height: auto !important;
        padding: 20px !important;
    }
    .channel-product .channel-file-tb.view-grid .product-img-wrap {
        gap: 12px;
    }
    .channel-product .channel-file-tb.view-grid td.product-img-cell img {
        max-width: 45% !important;
        max-height: 160px !important;
    }
}


