/**
 * Category HTML Blocks - Frontend Styles
 * categoryblocks.css
 */

/* =============================================
   SIDEBAR LAYOUT (Vertical stacking)
   ============================================= */

.cb-sidebar-blocks {
    width: 100%;
}

.cb-sidebar-blocks .cb-block {
    margin-bottom: 20px;
    width: 100%;
}

.cb-sidebar-blocks .cb-block:last-child {
    margin-bottom: 0;
}

.cb-sidebar-blocks .cb-block img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =============================================
   GRID LAYOUT (Responsive horizontal grid)
   Desktop: 4 per row
   Tablet:  2 per row
   Mobile:  1 per row
   ============================================= */

.cb-grid-blocks {
    width: 100%;
    margin: 15px 0;
}

.cb-grid-row {
    display: flex;
    flex-wrap: wrap;
    margin-left: -10px;
    margin-right: -10px;
}

.cb-grid-col {
    box-sizing: border-box;
    padding: 10px;
    /* Default: 4 per row on desktop */
    width: 25%;
    flex: 0 0 25%;
    max-width: 25%;
}

/* Tablet: 2 per row */
@media (max-width: 1024px) {
    .cb-grid-col {
        width: 50%;
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* Mobile: 1 per row */
@media (max-width: 767px) {
    .cb-grid-col {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
    }

    .cb-grid-row {
        margin-left: 0;
        margin-right: 0;
    }

    .cb-grid-col {
        padding: 8px 0;
    }
}

/* Images inside grid blocks */
.cb-grid-col img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Links inside grid blocks */
.cb-grid-col a img {
    transition: opacity 0.2s ease;
}

.cb-grid-col a:hover img {
    opacity: 0.88;
}

/* =============================================
   Common Banner Block Styles
   (used with the snippet helper)
   ============================================= */

.cb-banner-block {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 0;
}

.cb-banner-block img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s ease;
}

.cb-banner-block:hover img {
    transform: scale(1.03);
}

.cb-banner-caption {
    padding: 10px 12px;
    background: #f7f7f7;
    border-top: 1px solid #e5e5e5;
}

.cb-banner-caption h4 {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 600;
}

.cb-banner-caption p {
    margin: 0;
    font-size: 12px;
    color: #666;
}

/* =============================================
   Hook-specific adjustments
   ============================================= */

/* Above products - add spacing */
.cb-hook-displayContentWrapperTop.cb-grid-blocks {
    margin-top: 0;
    margin-bottom: 20px;
}

/* Below products - add spacing */
.cb-hook-displayContentWrapperBottom.cb-grid-blocks {
    margin-top: 20px;
    margin-bottom: 0;
}
