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

/* Container */
.wc-filter-gallery-container {
   width: 100%;
   max-width: 100%;
}

/* 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 Container - NUR POSITIONIERUNG, KEIN STYLING */
.product-actions {
   position: absolute;
   top: 10px;
   right: 10px;
   display: flex;
   gap: 8px;
   z-index: 10;
}

/* 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;
   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 - KORRIGIERT */
.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;
   pointer-events: none;
}

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

.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) {
   /* Mobile - SEARCH UND SORT NEBENEINANDER */
   .gallery-sorting-bar {
       display: grid !important;
       grid-template-columns: 1fr auto !important;
       grid-template-rows: auto auto !important;
       gap: 12px !important;
       padding: 15px 0;
   }
   
   /* Results Count bleibt oben */
   .results-count {
       grid-column: 1 / -1 !important;
       grid-row: 1 !important;
       width: 100%;
       text-align: center;
       padding-bottom: 0;
   }
   
   /* Search Box links */
   .gallery-search-box {
       grid-column: 1 !important;
       grid-row: 2 !important;
       max-width: none;
   }
   
   /* Sort Box rechts */
   .sorting-options {
       grid-column: 2 !important;
       grid-row: 2 !important;
       width: auto !important;
   }
   
   /* Sort Select anpassen */
   .gallery-sort-select {
       width: auto !important;
       min-width: 120px !important;
       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;
   }
}

@media (max-width: 991px) {
   .wc-products-grid.columns-3,
   .wc-products-grid.columns-4 {
       grid-template-columns: repeat(2, 1fr);
       gap: 15px;
   }
   
   /* Desktop Elements verstecken */
   .product-variations-bar {
       display: none !important;
   }
   
   /* Mobile Elements anzeigen - KORRIGIERT */
   .has-variations .mobile-variations-button {
       display: block;
   }
   
   /* Mobile Overlay bleibt display block aber versteckt durch transform */
   .mobile-variations-overlay {
       display: block;
       transform: translateY(100%) !important;
       pointer-events: none !important;
   }
   
   .mobile-variations-overlay.active {
       transform: translateY(0) !important;
       pointer-events: auto !important;
   }
   
   /* 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: 10px !important;
   }
   
   /* Kleinere Sortierung */
   .gallery-sort-select {
       min-width: 100px !important;
       font-size: 13px !important;
       padding: 6px 10px !important;
   }
   
   /* 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 */
   .gallery-sorting-bar {
       gap: 8px !important;
   }
   
   .results-count {
       font-size: 13px;
   }
   
   /* Noch kompaktere Sortierung */
   .gallery-sort-select {
       min-width: 90px !important;
       font-size: 12px !important;
   }
   
   /* 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;
   }
}

/* Unterkategorien-Navigation */
.category-item-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 5px;
}

.category-item-wrapper .filter-checkbox-item {
    flex: 1;
    margin-bottom: 0;
}

.show-subcategories {
    background: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 2px 8px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.show-subcategories:hover {
    background: #f0f0f0;
    border-color: #999;
}

.show-subcategories .dashicons {
    font-size: 16px;
    line-height: 20px;
    width: 16px;
    height: 20px;
}

.back-to-main-categories {
    margin-bottom: 15px;
    width: 100%;
    justify-content: flex-start;
    padding-left: 25px;
    position: relative;
}

.back-to-main-categories:before {
    content: "←";
    position: absolute;
    left: 10px;
}

/* Größen-Filter Styling */
.size-filter .filter-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}

.size-item {
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 8px 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-item:hover {
    border-color: #999;
    background: #f9f9f9;
}

.size-item input[type="checkbox"] {
    display: none;
}

.size-item input[type="checkbox"]:checked + .checkbox-label {
    background: #333;
    color: #fff;
}

.size-item .checkbox-label {
    display: block;
    padding: 5px;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.size-item .label-text {
    font-weight: 600;
    display: block;
}

.size-item .item-count {
    font-size: 11px;
    opacity: 0.7;
    display: block;
}

/* Mobile Anpassungen */
@media (max-width: 768px) {
    .category-item-wrapper {
        padding: 5px 0;
    }
    
    .show-subcategories {
        padding: 5px 10px;
    }
    
    .size-filter .filter-content {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }
    
    .size-item {
        padding: 6px 3px;
    }
}

/* Farben Varianten Fix */
.pkonfig-farben-horizontal {
    display: flex !important;
    gap: 8px !important;
    overflow-x: auto !important;
    padding: 5px 0 !important;
}

.pkonfig-farben-item-h {
    flex-shrink: 0 !important;
    width: 60px !important;
    height: 60px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 4px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    background: #fff !important;
}

.pkonfig-farben-item-h:hover {
    border-color: #E30613 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.pkonfig-farben-item-h img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

.color-swatch-h {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
}

/* Scrollbar für Farben */
.pkonfig-farben-horizontal::-webkit-scrollbar {
    height: 6px;
}

.pkonfig-farben-horizontal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.pkonfig-farben-horizontal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.pkonfig-farben-horizontal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Farben-Leiste NUR HORIZONTAL scrollbar */
.pkonfig-farben-horizontal {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    max-height: 80px !important;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

.pkonfig-farben-horizontal::-webkit-scrollbar {
    height: 6px !important;
    width: 0 !important;
}

.pkonfig-farben-horizontal::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.pkonfig-farben-horizontal::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.pkonfig-farben-horizontal::-webkit-scrollbar-thumb:hover {
    background: #555;
}

