/* SB Companies Frontend Styles */

.sb-companies-list {
    margin: 30px 0;
}

.sb-companies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0 32px;
}

.sb-company-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 16px 0;
    background: #fff;
    border-bottom: 1px solid #B3B09D;
    border-radius: 0;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    cursor: pointer;
}

.sb-company-item__logo {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    margin-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sb-company-item__logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sb-company-item__logo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 24px;
    font-weight: 600;
    text-transform: uppercase;
}

.sb-company-item__content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

h4.sb-company-item__title {
    margin: 0;
    line-height: 1.4;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: 500;
    font-style: normal;
    font-family: Jost, serif;
    color: rgb(23, 23, 23);
}

h4.sb-company-item__title mark {
    color: #1f2937;
    padding: 4px 12px;
    font-size: 0.85em;
    font-weight: 500;
    margin-left: 8px;
    text-transform: uppercase;
    background: #E7E4D3;
    border-radius: 20px;
    text-align: center;
    display: inline-block;
}

.sb-company-item__arrow {
    width: 24px;
    height: 24px;
    color: #111827;
    transition: all 0.3s ease;
    transform: rotate(0deg);
}

.sb-company-item:hover .sb-company-item__arrow {
    color: #000;
    transform: rotate(45deg);
}

/* CSS-only tooltip */
.sb-company-item[data-tooltip]:before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    transform: translateX(-50%) translateY(-11px);
    background: #000;
    word-wrap: break-word;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    pointer-events: none;
    width: 95%;
    color: #fff;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    left: 50%;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 16px;
    font-family: 'Jost', sans-serif;
    line-height: 24px;
}

.sb-company-item[data-tooltip]:after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-2px);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #000;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.sb-company-item[data-tooltip]:hover:before,
.sb-company-item[data-tooltip]:hover:after {
    opacity: 1;
}

/* Hide tooltip if no description */
.sb-company-item[data-tooltip=""]:before,
.sb-company-item[data-tooltip=""]:after {
    display: none;
}

/* No logo styles */
.sb-companies-list--no-logo .sb-company-item__logo {
    display: none;
}

.sb-companies-list--no-logo .sb-company-item__content {
    margin-left: 0;
}

.sb-companies-list--no-logo .sb-company-item {
    padding-top: 25px;
    padding-bottom: 25px;
}

/* Responsive design */
@media (max-width: 768px) {
    .sb-company-item {
        padding: 16px;
    }
    
    .sb-company-item__logo {
        width: 50px;
        height: 50px;
        margin-right: 16px;
    }
    
    .sb-company-item__title {
        font-size: 16px;
    }
    
    .sb-company-item__arrow {
        width: 20px;
        height: 20px;
    }
    
    /* Adjust tooltip for mobile */
    .sb-company-item[data-tooltip]:before,
    .sb-company-item[data-tooltip]:after {
        display: none;
    }
}

@media (max-width: 480px) {
    .sb-company-item {
        padding: 14px;
    }
    
    .sb-company-item__logo {
        width: 45px;
        height: 45px;
        margin-right: 12px;
    }
    
    .sb-company-item__title {
        font-size: 15px;
    }
    
    .sb-company-item__arrow {
        width: 18px;
        height: 18px;
    }
}

/* Ensure proper spacing for grid items */
@media (min-width: 769px) and (max-width: 1024px) {
    .sb-companies-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1025px) {
    .sb-companies-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    h4.sb-company-item__title {
        font-size: 16px;
    }
}
