/* Brand Showcase Marine - Frontend Styles */

/* Main container */
.bsm-brand-showcase {
    margin: 20px 0;
    width: 100%;
}

/* Grid container */
.bsm-brands-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    align-items: stretch;
}

/* Column responsive layout */
.bsm-brand-showcase[data-columns="1"] .bsm-brands-grid {
    display: grid;
    grid-template-columns: 1fr;
}

.bsm-brand-showcase[data-columns="2"] .bsm-brands-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
}

.bsm-brand-showcase[data-columns="3"] .bsm-brands-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.bsm-brand-showcase[data-columns="4"] .bsm-brands-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.bsm-brand-showcase[data-columns="5"] .bsm-brands-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
}

.bsm-brand-showcase[data-columns="6"] .bsm-brands-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
}

/* Individual brand card */
.bsm-brand-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 280px;
}

.bsm-brand-card:hover {
    transform: translateY(-8px);
    /* box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15); */
}

/* Media container for image/video and title overlay */
.bsm-brand-media-container {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 25px;
    overflow: hidden;
}

/* Brand link wrapper */
.bsm-brand-link {
    display: block;
    text-decoration: none;
    color: inherit;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bsm-brand-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Image wrapper */
.bsm-brand-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 60%; /* 5:3 aspect ratio */
    overflow: hidden;
    background: #000;
    flex-shrink: 0;
}

.bsm-brand-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.bsm-brand-card:hover .bsm-brand-image {
    transform: scale(1.05);
}

/* Brand video */
.bsm-brand-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: grayscale(100%);
    transition: all 0.5s ease-in-out;
}

.bsm-brand-card:hover .bsm-brand-video {
    filter: none !important;
    transform: scale(1.05);
}

/* Hover-to-play video effect */
.bsm-hover-thumbnail {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    z-index: 2;
}

.bsm-hover-video {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 1;
}

.bsm-brand-card:hover .bsm-hover-thumbnail {
    opacity: 0;
}

.bsm-brand-card:hover .bsm-hover-video {
    opacity: 1;
    filter: none !important;
}

/* Image placeholder */
.bsm-brand-image-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
}

.bsm-placeholder-text {
    text-align: center;
    font-size: 18px;
    padding: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Title overlay */
.bsm-brand-title-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 40px 20px 20px;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

.bsm-brand-title {
    color: white !important;
    margin: 0;
    text-align: center;
    line-height: 1em;
}

/* Inventory link wrapper (for separate link icon) */
.bsm-inventory-link-wrapper {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.bsm-inventory-link {
    display: inline-block;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.bsm-inventory-link:hover {
    background: white;
    transform: scale(1.1);
    text-decoration: none;
}

.bsm-inventory-icon {
    font-size: 18px;
    color: #333;
}

/* Single brand wrapper */
.bsm-single-brand {
    display: inline-block;
    margin: 10px;
}

.bsm-single-brand .bsm-brand-card {
    width: 250px;
    min-height: 280px;
}

/* Error and no content states */
.bsm-error,
.bsm-no-brands {
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
    text-align: center;
    font-weight: 500;
    margin: 20px 0;
}

.bsm-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Responsive design */
@media (max-width: 768px) {
    .bsm-brand-showcase[data-columns="3"] .bsm-brands-grid,
    .bsm-brand-showcase[data-columns="4"] .bsm-brands-grid,
    .bsm-brand-showcase[data-columns="5"] .bsm-brands-grid,
    .bsm-brand-showcase[data-columns="6"] .bsm-brands-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .bsm-brand-title {
        font-size: 16px;
    }
    
    .bsm-placeholder-text {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bsm-brands-grid {
        gap: 10px;
    }
    
    .bsm-brand-showcase[data-columns="2"] .bsm-brands-grid,
    .bsm-brand-showcase[data-columns="3"] .bsm-brands-grid,
    .bsm-brand-showcase[data-columns="4"] .bsm-brands-grid,
    .bsm-brand-showcase[data-columns="5"] .bsm-brands-grid,
    .bsm-brand-showcase[data-columns="6"] .bsm-brands-grid {
        grid-template-columns: 1fr;
    }
    
    .bsm-brand-card {
        min-height: 250px;
    }
    
    .bsm-brand-title {
        font-size: 15px;
    }
    
    .bsm-placeholder-text {
        font-size: 15px;
        padding: 15px;
    }
}

/* Loading state */
.bsm-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.bsm-loading:before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Explore More Button */
.bsm-explore-more-wrapper {
    padding: 15px 0;
    background: transparent;
    display: flex;
}

.bsm-explore-more-btn {
    display: block;
    min-width: 175px;
    padding: 12px 24px;
    background: #fff;
    border: 2px solid #000;
    border-radius: 25px;
    color: #000 !important;
    text-decoration: none !important;
    text-align: center;
    transition: all 0.3s ease;
}

.bsm-explore-more-btn:hover {
    background: #fff;
    color: #000 !important;
}

.bsm-explore-more-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.bsm-btn-text {
    display: block;
    font-size: 13px;
    font-weight: 700;
}

/* Accessibility improvements */
.bsm-brand-link:focus,
.bsm-inventory-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .bsm-brand-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .bsm-brand-card:hover {
        transform: none;
    }
}