/* WooCommerce Brands Widget Styles */

.wc-brands-widget-wrapper {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
}

.wc-brands-container {
    display: flex;
    gap: 30px;
    width: 100%;
    height: 100%;
    align-items: stretch;
    overflow: hidden;
}

.wc-brands-container.images-only {
    flex-direction: column;
    gap: 20px;
    align-items: stretch;
}

.wc-brands-container.titles-only {
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Left Section */
.brands-left-section {
    flex: 0 0 20%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 100%;
}

.wc-brands-container.titles-only .brands-left-section {
    flex: 1 1 100%;
    max-width: 600px;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    min-height: auto;
}

/* Right Section */
.brands-right-section {
    flex: 0 0 calc(100% - 30%);
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow-y: scroll !important;
}

.brands-right-section.full-width {
    flex: 0 0 100%;
}

.wc-brands-container.images-only .brands-right-section {
    flex: 1 1 100%;
    min-height: auto;
}

/* Alphabet Navigation */
.brand-alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.brand-alphabet-nav button {
    cursor: pointer;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    color: #333;
    padding: 5px 10px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 3px;
    transition: all 0.3s ease;
    min-width: 30px;
    text-align: center;
}

.brand-alphabet-nav button:hover:not(.disabled) {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.brand-alphabet-nav button.active {
    background-color: #e3f2fd;
    color: #007bff;
    border-color: #007bff;
}

.brand-alphabet-nav button.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Brand Names List */
.brand-names-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
}

.brand-names-list::-webkit-scrollbar {
    width: 6px;
}

.brand-names-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.brand-names-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.brand-names-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.brand-name-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 5px 0;
    display: block;
}

.brand-name-link:hover {
    color: #007bff;
    padding-left: 5px;
}

/* Brands Grid */
/* Brand grid fills right column and is scrollable */
.wc-brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    width: 100%;
    padding-right: 10px;
    scroll-behavior: smooth;
    max-height: 100% !important; /* Adjust as needed or use variable from widget */
    overflow-y: auto;
    overflow-x: hidden;
}

.wc-brands-grid::-webkit-scrollbar {
    width: 6px;
}

.wc-brands-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wc-brands-grid::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.wc-brands-grid::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Horizontal Scrollable Grid */
.wc-brands-grid.horizontal-scroll {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 20px;
    padding-bottom: 10px;
    padding-right: 0;
    scroll-behavior: smooth;
}

.wc-brands-grid.horizontal-scroll::-webkit-scrollbar {
    height: 8px;
}

.wc-brands-grid.horizontal-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.wc-brands-grid.horizontal-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.wc-brands-grid.horizontal-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.wc-brands-grid.horizontal-scroll .brand-image-item {
    flex: 0 0 200px;
    min-width: 200px;
}

.brand-image-item {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    min-height: 120px;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.brand-image-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.brand-image-item a {
    display: block;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-image-item img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.brand-placeholder {
    color: #999;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .wc-brands-container {
        gap: 20px;
    }
    
    .brands-left-section {
        flex: 0 0 25%;
    }
    
    .brands-right-section {
        flex: 0 0 calc(100% - 25%);
    }
    
    .wc-brands-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .wc-brands-container:not(.images-only):not(.titles-only) {
        flex-direction: column;
        gap: 30px;
    }
    
    .brands-left-section {
        flex: 0 0 100% !important;
        min-height: auto;
    }
    
    .brands-right-section {
        flex: 0 0 100% !important;
        min-height: auto;
    }
    
    .wc-brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .brand-alphabet-nav {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .wc-brands-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    
    .brand-alphabet-nav button {
        font-size: 12px;
        padding: 4px 8px;
        min-width: 25px;
    }
    
    .brand-image-item {
        padding: 15px;
        min-height: 100px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.brand-image-item,
.brand-name-link {
    animation: fadeIn 0.3s ease;
}