/* WC Filter Gallery Styles - MIT WC SEARCH BAR INTEGRATION V1.0.9 */

/* Container */
.wc-filter-gallery-container {
    width: 100%;
    max-width: 100%;
@media (max-width: 380px) {
    /* Extrem kleine Screens - noch kompakter */
    .gallery-sorting-bar {
        gap: 6px;
    }
    
    .results-count {
        font-size: 13px;
    }
    
    /* Minimale Anpassungen für sehr kleine Screens */
    .gallery-search-box .wc-search-inner {
        height: 40px !important;
    }
    
    .gallery-search-box .wc-search-input {
        font-size: 13px !important;
    }
}

/* Sorting Bar - ANGEPASST FÜR SEARCH */
.gallery-sorting-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    gap: 20px;
}

.results-count {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
    font-weight: 500;
}

.results-count .product-count {
    display: inline !important;
    background: none !important;
    border: none !important;
    color: #666 !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Gallery Search Integration */
.gallery-search-box {
    flex: 1;
    max-width: 400px;
    min-width: 200px;
}

/* Integration mit WC Search Bar */
.gallery-search-box .wc-search-bar-wrapper {
    max-width: 100%;
}

.gallery-search-box .wc-search-inner {
    height: 42px;
}

.gallery-search-box .wc-search-input {
    font-size: 14px;
}

.gallery-search-box .wc-search-submit {
    width: 50px;
}

.sorting-options {
    flex-shrink: 0;
}

.gallery-sort-select {
    padding: 8px 15px;
    border: 1px solid #bbb !important;
    border-radius: 5px !important;
    font-size: 14px;
    background: #fff !important;
    cursor: pointer;
    height: 42px;
    transition: all 0.3s ease !important;
    color: #444 !important;
}

.gallery-sort-select:hover {
    border-color: #999 !important;
}

.gallery-sort-select:focus {
    outline: none !important;
    border-color: #e30613 !important;
}

/* Products Grid */
.wc-products-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.wc-products-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wc-products-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wc-products-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-inner {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Image Container */
.product-image-container {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: #f8f8f8;
}

.product-image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

/* Action Buttons */
.product-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.wishlist-button,
.compare-button {
    background: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.wishlist-button:hover,
.compare-button:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

/* SKU Badge */
.product-sku {
    display: none;
    position: absolute;
    top: 10px;
    left: 10px;
    background: #E30613;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.product-card.on-sale .product-sku {
    display: block;
}

/* Product Info Container */
.product-info {
    position: relative;
    overflow: visible;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* VARIATIONS BAR - Z-INDEX 5 MIT PADDING */
.product-variations-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    width: 100%;
    height: 80px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 2px solid #e0e0e0;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 5 !important;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

/* PRODUCT DETAILS CONTAINER - Z-INDEX 10 MIT WEISSEM HINTERGRUND */
.product-details-container {
    position: relative;
    padding: 15px;
    background: #fff !important;
    z-index: 10 !important;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Desktop Hover Effect */
@media (min-width: 992px) {
    .product-card:hover .product-variations-bar {
        transform: translateY(0);
    }
}

.variations-scroll-container {
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 20px; /* MEHR PADDING LINKS/RECHTS */
    display: flex;
    gap: 10px;
    align-items: center;
    -webkit-overflow-scrolling: touch;
}

/* FORCE HORIZONTAL LAYOUT FÜR SHORTCODE */
.variations-scroll-container .pkonfig-farben-horizontal {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    height: 100%;
    align-items: center;
}

.variations-scroll-container .pkonfig-farben {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    height: 100%;
}

.variations-scroll-container .pkonfig-farben-item {
    width: 60px !important;
    height: 60px !important;
    flex-shrink: 0 !important;
    border-radius: 4px !important;
    padding: 0 !important;
    border: 2px solid #e0e0e0 !important;
}

.variations-scroll-container .pkonfig-farben-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.variations-scroll-container .pkonfig-farben-item span {
    display: none !important;
}

/* Scrollbar */
.variations-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.variations-scroll-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.variations-scroll-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.variations-scroll-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Product Title */
.product-title {
    margin: 0 0 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.product-title a {
    color: #333 !important;
    text-decoration: none;
    transition: color 0.2s ease;
}

.product-title a:hover {
    color: #E30613 !important;
}

/* Price */
.product-price {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 15px;
}

.product-price .amount {
    color: #000 !important;
    text-shadow: 
        1px 1px 0 #fff,
        -1px -1px 0 #fff,
        1px -1px 0 #fff,
        -1px 1px 0 #fff,
        2px 2px 4px rgba(0, 0, 0, 0.2);
}

.product-price small {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin-top: 2px;
    text-shadow: none;
}

/* Buttons */
.product-button {
    margin-top: auto;
}

.product-link-button {
    display: block;
    width: 100%;
    text-align: center;
    background: #000 !important;
    color: #fff !important;
    padding: 12px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
}

.product-link-button:hover {
    background: linear-gradient(135deg, #FCAE00, #E30613) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3);
}

/* Mobile Variations Button */
.mobile-variations-button {
    display: none;
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #FCAE00, #E30613) !important;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    color: #fff !important;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(227, 6, 19, 0.3);
}

.mobile-variations-button:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(227, 6, 19, 0.3);
}

/* Mobile Variations Overlay */
.mobile-variations-overlay {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    border-top: 2px solid #e0e0e0;
    height: 100%;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 25;
}

.mobile-variations-overlay.active {
    transform: translateY(0);
}

.mobile-variations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px;
    padding-left: 25px;
    border-bottom: 1px solid #e0e0e0;
}

.mobile-variations-title {
    font-weight: 600;
    font-size: 14px;
}

.close-variations {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.close-variations:hover {
    color: #E30613;
}

/* Mobile Variations Container mit weniger Padding */
.mobile-variations-overlay .variations-scroll-container {
    padding: 10px 15px;
}

/* Graues Overlay beim Öffnen */
.product-image-container.variations-open::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 20;
}

/* Loading */
.gallery-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #E30613;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pagination */
.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.gallery-pagination a,
.gallery-pagination span {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.gallery-pagination a:hover {
    background: linear-gradient(135deg, #FCAE00, #E30613);
    color: #fff;
    border-color: #E30613;
}

.gallery-pagination .current {
    background: #E30613;
    color: #fff;
    border-color: #E30613;
}

/* No Products */
.no-products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 1200px) {
    .gallery-search-box {
        max-width: 300px;
    }
}

@media (max-width: 991px) and (min-width: 768px) {
    /* Tablet spezifische Anpassungen - NEBENEINANDER */
    .gallery-sorting-bar {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 12px !important;
    }
    
    .results-count {
        grid-column: 1 / -1 !important;
        order: 1 !important;
        width: 100% !important;
        text-align: center !important;
    }
    
    .gallery-search-box {
        order: 2 !important;
        max-width: none !important;
    }
    
    .sorting-options {
        order: 3 !important;
    }
}

@media (max-width: 767px) {
    /* Phones - ALLES UNTEREINANDER */
    .gallery-sorting-bar {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
    }
}

@media (max-width: 991px) {
    .wc-products-grid.columns-3,
    .wc-products-grid.columns-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    /* Sorting Bar Mobile Anpassung - UNTEREINANDER AUF MOBILE */
    .gallery-sorting-bar {
        display: flex;
        flex-direction: column;
        gap: 15px;
        padding: 15px 0;
    }
    
    .results-count {
        order: 1;
        width: 100%;
        text-align: center;
        padding-bottom: 0;
    }
    
    .gallery-search-box {
        order: 2;
        width: 100%;
        max-width: none;
    }
    
    .sorting-options {
        order: 3;
        width: 100%;
    }
    
    .gallery-sort-select {
        width: 100%;
        height: 45px !important;
        font-size: 14px !important;
        padding: 8px 15px !important;
    }
    
    /* Gallery Search Mobile Anpassungen */
    .gallery-search-box .wc-search-bar-wrapper {
        max-width: 100%;
    }
    
    .gallery-search-box .wc-search-inner {
        height: 45px !important;
    }
    
    .gallery-search-box .wc-search-input {
        font-size: 14px !important;
    }
    
    .gallery-search-box .wc-search-submit {
        width: 50px !important;
    }
    
    /* Desktop Elements verstecken */
    .product-variations-bar {
        display: none !important;
    }
    
    /* Mobile Elements anzeigen */
    .has-variations .mobile-variations-button {
        display: block;
    }
    
    .mobile-variations-overlay {
        display: block;
    }
    
    /* Größere Produktbilder */
    .product-image {
        max-width: 90%;
        max-height: 90%;
    }
    
    /* Größere Varianten Items */
    .mobile-variations-overlay .pkonfig-farben-item-h {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* MOBILE VARIATIONS BUTTON POSITION FIX */
    .has-variations .mobile-variations-button {
        display: block;
        margin-top: auto !important;
        margin-bottom: 10px;
    }
    
    /* Product button bleibt am Ende */
    .has-variations .product-button {
        margin-top: 0 !important;
    }
}

@media (max-width: 576px) {
    /* Kompaktere Darstellung auf sehr kleinen Screens */
    .gallery-sorting-bar {
        padding: 10px 0;
        gap: 12px;
    }
    
    /* Volle Breite für alle Elemente */
    .gallery-search-box .dgwt-wcas-sf-wrapp {
        height: 42px !important;
    }
    
    .gallery-search-box .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
        height: 40px !important;
        line-height: 40px !important;
        font-size: 14px !important;
        padding: 0 40px 0 12px !important;
    }
    
    .gallery-search-box .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
        width: 48px !important;
    }
    
    .gallery-search-box .dgwt-wcas-sf-wrapp .dgwt-wcas-ico-magnifier {
        width: 18px !important;
        height: 18px !important;
    }
    
    .gallery-search-box .dgwt-wcas-sf-wrapp .dgwt-wcas-ico-arrow {
        right: 10px !important;
        width: 8px !important;
        height: 8px !important;
    }
    
    .gallery-sort-select {
        height: 42px !important;
        font-size: 14px !important;
        padding: 8px 15px !important;
    }
    
    .product-details-container {
        padding: 12px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-price {
        font-size: 18px;
    }
}

@media (max-width: 380px) {
    /* Extrem kleine Screens - noch kompakter */
    .gallery-sorting-bar {
        gap: 6px;
    }
    
    .results-count {
        font-size: 13px;
    }
    
    /* Minimale Padding für Suchfeld */
    .gallery-search-box .dgwt-wcas-sf-wrapp input[type="search"] {
        padding: 5px 8px !important;
    }
}

/* Utility Classes */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

@media (max-width: 991px) {
    .desktop-only {
        display: none !important;
    }
    
    .mobile-only {
        display: block !important;
    }
}