/* WooCommerce Basic Layout */

/* WooCommerce Archive Hero Section */
.woo-hero-section {
    position: relative;
    background-color: #f8f9fa;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: scroll; /* iOS Fix: scroll statt fixed */
    -webkit-background-size: cover; /* iOS Safari Fix */
    -moz-background-size: cover;
    -o-background-size: cover;
    color: #fff;
    text-align: center;
    padding: 4rem 0;
    /* iOS Fix: Hardware-Beschleunigung */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: background-image;
    /* Sicherstellen, dass das Element gerendert wird */
    min-height: 200px;
    display: block;
}

.woo-hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(19, 54, 81, 0.7);
    z-index: 1;
}

.woo-hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.woo-hero-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.woo-hero-text {
    font-size: 1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.woo-hero-button {
    display: inline-block;
    background: linear-gradient(135deg, #FF8C42 0%, #FF6B35 100%);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(255, 140, 66, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.woo-hero-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 140, 66, 0.4);
    color: #fff;
    background: linear-gradient(135deg, #FF6B35 0%, #e55a2b 100%);
}



/* Mobile: Volle Breite */
@media (max-width: 768px) {
    .woo-hero-section {
        padding: 2rem 0;
        margin: 0 -20px 2rem -20px;
        width: calc(100% + 40px);
    }
    
    .woo-hero-title {
        font-size: 1.75rem;
    }
    
    .woo-hero-text {
        font-size: 0.9rem;
    }
    
    .woo-hero-button {
        padding: 0.625rem 1.5rem;
        font-size: 0.85rem;
    }
}

/* Desktop: Maximale Höhe 400px */
@media (min-width: 768px) {
    .woo-hero-section {
        max-height: 400px !important;
        min-height: 300px;
        padding: 0;
        display: flex;
        align-items: center;
        overflow: hidden;
    }
    
    .woo-hero-title {
        font-size: 2.5rem;
    }
    
    .woo-hero-text {
        font-size: 1.25rem;
    }
    
    .woo-hero-button {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
}

.shop-page {
    padding: 2rem 0;
}

.shop-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.shop-controls {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 50px;
}

/* WooCommerce Hook Elemente korrekt positionieren */
.shop-controls > *:first-child {
    /* Erste Element (notices) - verstecken oder links positionieren */
    order: 1;
}

.shop-controls .woocommerce-ordering {
    /* Ordering-Feld ganz rechts */
    order: 3;
    margin-left: auto;
}

.shop-controls .shop-filter-button {
    /* Filter-Button links */
    order: 2;
}

/* Filter Button */
.shop-filter-button {
    flex: 0 0 auto;
}

.bw-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #133651;
    color: white;
    border: none;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(19, 54, 81, 0.2);
    height: 48px;
    box-sizing: border-box;
    line-height: 1;
}

.bw-filter-btn:hover {
    background-color: #0f2a3f;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(19, 54, 81, 0.3);
}

.bw-filter-btn.active {
    background-color: #0f2a3f;
}

.bw-filter-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

/* WooCommerce Ordering Styling */
.woocommerce-ordering {
    flex: 0 0 auto;
    display: flex;
    margin: 0 !important;
}


.woocommerce-ordering select {
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: white;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.875rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    width: auto;
    min-width: 0;
    height: 48px;
    box-sizing: border-box;
    line-height: 1;
}

.woocommerce-ordering select:focus {
    outline: none;
    border-color: #FF8C42;
    box-shadow: 0 0 0 3px rgba(255, 140, 66, 0.1);
}

.woocommerce-ordering select:hover {
    border-color: #FF8C42;
}

/* Products Grid - 4 Spalten */
.products-grid ul {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 2rem !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: 100% !important;
}

.products-grid ul li {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    width: auto !important;
    float: none !important;
    display: block !important;
    min-height: 0 !important;
}

/* Leere Listenelemente verstecken */
.products-grid ul li:empty {
    display: none !important;
}

/* Alle Listenelemente korrekt anzeigen */
.products-grid ul li {
    display: block !important;
}

/* Tablet: 2 Spalten */
@media (max-width: 960px) and (min-width: 481px) {
    .shop-controls {
        margin-bottom: 1rem;
    }
    
    .products-grid ul {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    /* ::before Pseudo-Element auf ul entfernen/deaktivieren */
    .products-grid ul::before {
        content: none !important;
        display: none !important;
    }
    
    /* Grid-Column-Positionierung komplett zurücksetzen für Tablet */
    .products-grid ul li {
        grid-column: auto !important;
        grid-row: auto !important;
    }
    
    /* Alle spezifischen nth-child-Regeln zurücksetzen */
    .products-grid ul li:first-child,
    .products-grid ul li:nth-child(2),
    .products-grid ul li:nth-child(3),
    .products-grid ul li:nth-child(4) {
        grid-column: auto !important;
        grid-row: auto !important;
    }
}

/* Mobile: 1 Spalte */
@media (max-width: 480px) {
    .shop-page {
        padding-top: 0.25rem;
    }
    
    .shop-controls {
        margin-bottom: 0.75rem;
    }
    
    /* Sortierungs-Dropdown auf Mobile schmaler machen */
    .woocommerce-ordering {
        flex: 0 0 auto;
        max-width: 180px;
    }
    
    .woocommerce-ordering select {
        width: auto;
        min-width: 0;
        max-width: 180px;
        font-size: 0.8rem;
        padding: 0.625rem 0.875rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Dropdown-Optionen auf Mobile anpassen */
    .woocommerce-ordering select option {
        font-size: 0.75rem;
        max-width: 180px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .products-grid ul {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* ::before Pseudo-Element auf ul entfernen/deaktivieren */
    .products-grid ul::before {
        content: none !important;
        display: none !important;
    }
    
    /* Grid-Column-Positionierung zurücksetzen für Mobile */
    .products-grid ul li {
        grid-column: auto !important;
    }
}

/* Desktop: Explizite Grid-Positionierung - NUR auf Desktop */
@media (min-width: 961px) {
    /* Erste Produktkarte korrekt anzeigen */
    .products-grid ul li:first-child {
        display: block !important;
        grid-column: 1 !important;
    }

    /* Zweite Produktkarte */
    .products-grid ul li:nth-child(2) {
        grid-column: 2 !important;
    }

    /* Dritte Produktkarte */
    .products-grid ul li:nth-child(3) {
        grid-column: 3 !important;
    }

    /* Vierte Produktkarte */
    .products-grid ul li:nth-child(4) {
        grid-column: 4 !important;
    }
}

/* Standard WooCommerce SALE Badge verstecken */
.onsale {
    display: none !important;
}

/* Benutzerdefinierte Pagination - Sauber und funktional */
.custom-pagination-wrapper {
    margin: 3rem 0;
    text-align: center;
}

.custom-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.custom-pagination li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.custom-pagination a,
.custom-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    background-color: #ffffff;
    color: #133651;
    text-decoration: none;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-pagination a:hover {
    background-color: #FF6B35;
    color: white;
    border-color: #FF6B35;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.custom-pagination span.current {
    background-color: #133651;
    color: white;
    border-color: #133651;
    box-shadow: 0 2px 8px rgba(19, 54, 81, 0.3);
}

.custom-pagination .prev,
.custom-pagination .next {
    font-weight: 700;
    min-width: 48px;
}

.custom-pagination .dots {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6b7280;
    cursor: default;
    min-width: 32px;
}

.custom-pagination .dots:hover {
    background-color: #f8f9fa;
    color: #6b7280;
    transform: none;
    box-shadow: none;
}

/* Produktkarten Styling */
.product-item {
    list-style: none;
    margin: 0;
    padding: 0;
}

.product-link {
    display: block;
    text-decoration: none;
    color: inherit;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    height: 100%;
}

.product-link:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.product-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #f8f9fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

/* SALE Badge */
.sale-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FF8C42 0%, #FF6B35 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
    z-index: 2;
}

.sale-badge span {
    font-size: 0.7rem;
    font-weight: 800;
}

.product-details {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Produktpreis */
.product-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #133651;
}

.product-price del {
    color: #9ca3af;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.product-price ins {
    text-decoration: none;
    color: #FF6B35;
}

/* Preis-Info Text */
.price-info {
    font-size: 0.7rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 0.1rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    line-height: 1.2;
}

/* Produkttitel - nur für Shop-Liste */
.woocommerce-loop-product__title,
.woocommerce-loop-product__title.product-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 5.6em; /* 4 Zeilen * 1.4 line-height */
}

/* Produktmaße */
.product-dimensions {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    opacity: 0.8;
    line-height: 1.2;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .product-details {
        padding: 0.875rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .product-title {
        font-size: 0.9rem;
    }
    
    .sale-badge {
        top: 8px;
        right: 8px;
        padding: 4px 10px;
        font-size: 0.7rem;
    }
    
    /* Pagination responsive */
    .woocommerce-pagination {
        margin-top: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .woocommerce-pagination ul {
        gap: 0.25rem;
    }
    
    .woocommerce-pagination a,
    .woocommerce-pagination span {
        min-width: 40px;
        height: 40px;
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .woocommerce-pagination .prev,
    .woocommerce-pagination .next {
        min-width: 44px;
    }
}

@media (max-width: 480px) {
    .product-details {
        padding: 0.75rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .product-title {
        font-size: 0.85rem;
    }
    
    .sale-badge {
        top: 6px;
        right: 6px;
        padding: 3px 8px;
        font-size: 0.65rem;
    }
    
    /* Pagination mobile */
    .woocommerce-pagination {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .woocommerce-pagination ul {
        gap: 0.2rem;
    }
    
    .woocommerce-pagination a,
    .woocommerce-pagination span {
        min-width: 36px;
        height: 36px;
        padding: 0.4rem;
        font-size: 0.75rem;
    }
    
    .woocommerce-pagination .prev,
    .woocommerce-pagination .next {
        min-width: 40px;
    }
}

