/**
 * NF Digital Shop - Category Showcase Widget Styles
 * Grid Layout with Fixed Aspect Ratio - Auto-sizing
 */

/* Container */
.nfds-category-showcase-wrapper {
    width: 100%;
    display: block;
    position: relative;
}

.nfds-category-showcase-flex {
    display: grid;
    gap: 10px;
    width: 100%;
    min-height: 0;
    height: auto;
}

/* Desktop Grid Columns */
.nfds-cols-1.nfds-category-showcase-flex {
    grid-template-columns: 1fr;
}

.nfds-cols-2.nfds-category-showcase-flex {
    grid-template-columns: repeat(2, 1fr);
}

.nfds-cols-3.nfds-category-showcase-flex {
    grid-template-columns: repeat(3, 1fr);
}

.nfds-cols-4.nfds-category-showcase-flex {
    grid-template-columns: repeat(4, 1fr);
}

/* Category Item with Fixed Aspect Ratio */
.nfds-category-showcase-item {
    position: relative;
    width: 100%;
    aspect-ratio: 320 / 370;
    background-color: #000000;
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Link overlay for clickable area */
.nfds-category-showcase-item-link {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    text-decoration: none;
}

.nfds-category-showcase-link-overlay {
    display: block;
    width: 100%;
    height: 100%;
}

/* Overlay Content - Always at Bottom */
.nfds-category-showcase-content {
    position: absolute !important;
    bottom: 15px;
    left: 10px;
    right: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    z-index: 2; /* Above link overlay */
    pointer-events: none; /* Allow clicks to pass through to link */
}

/* Title */
.nfds-category-showcase-title {
    margin: 0;
    padding: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    display: inline-block;
}

/* Button - Compact like Badge */
.nfds-category-showcase-button {
    display: inline-block;
    padding: 8px 14px 8px 10px;
    background-color: #e74c3c;
    color: #ffffff;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.nfds-category-showcase-button:hover {
    background-color: #c0392b;
    transform: translateY(-1px);
}

/* Tablet Responsive */
@media (max-width: 1024px) {
    .nfds-cols-tablet-1.nfds-category-showcase-flex {
        grid-template-columns: 1fr !important;
    }
    
    .nfds-cols-tablet-2.nfds-category-showcase-flex {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .nfds-cols-tablet-3.nfds-category-showcase-flex {
        grid-template-columns: repeat(3, 1fr) !important;
    }
    
    .nfds-cols-tablet-4.nfds-category-showcase-flex {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .nfds-category-showcase-wrapper {
        margin-bottom: 20px;
    }
    
    .nfds-category-showcase-flex {
        gap: 8px;
    }
    
    .nfds-cols-mobile-1.nfds-category-showcase-flex {
        grid-template-columns: 1fr !important;
    }
    
    .nfds-cols-mobile-2.nfds-category-showcase-flex {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .nfds-category-showcase-content {
        position: absolute;
        bottom: 15px;
        left: 10px;
    }
    
    .nfds-category-showcase-title {
        font-size: 16px;
    }
    
    .nfds-category-showcase-button {
        padding: 7px 12px;
        font-size: 11px;
    }
}

/* Hover Effects */
.nfds-category-showcase-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    cursor: pointer;
}

.nfds-category-showcase-item:hover .nfds-category-showcase-button {
    background-color: #c0392b;
}

/* Elementor Editor */
.elementor-editor-active .nfds-category-showcase-item {
    min-height: 200px;
}

/* Fix for z-index stacking issues - removed universal selector to prevent content issues */

/* Ensure proper layout flow */
.elementor-widget-nfds-category-showcase {
    display: block;
    width: 100%;
}

.elementor-widget-nfds-category-showcase .elementor-widget-container {
    display: block;
    width: 100%;
}

/* Mobile specific fixes */
@media (max-width: 767px) {
    .nfds-category-showcase-wrapper {
        display: block;
        width: 100%;
        clear: both;
    }
    
    /* Ensure items take proper space */
    .nfds-category-showcase-item {
        display: block;
        margin-bottom: 10px;
    }
    
    /* Ensure last item has enough bottom space */
    .nfds-category-showcase-item:last-child {
        margin-bottom: 30px;
    }
}

/* Animation entfernt - keine Fade-In Effekte mehr */

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 320 / 370) {
    .nfds-category-showcase-item {
        position: relative;
    }
    
    .nfds-category-showcase-item::before {
        content: "";
        display: block;
        padding-bottom: 115.625%; /* 370/320 * 100 */
    }
    
    .nfds-category-showcase-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
    }
}