/* Produkte Seite Styling */

/* ===== EXTRACTED FROM INLINE CSS ===== */

/* CSS Variables */
:root {
    --dark-gray: #1F2937;
    --anthracite: #111827;
    --deep-anthracite: #0F172A;
    --accent-red: #B83232;
    --accent-red-light: #D25050;
    --accent-red-dark: #8A2626;
    --white: #ffffff;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
}

/* Allgemeine Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--white);
    color: var(--dark-gray);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
}

/* Navigation styling (REMOVED: moved to shared-components.css) */

/* Button styling (REMOVED: moved to shared-components.css) */

/* Spezifisches Hintergrundbild nur für diese Seite */
.bg-pattern-card {
    background-image: url\('../bilder/pro-back.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.bg-pattern-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1;
}

.bg-pattern-card > * {
    position: relative;
    z-index: 2;
}

/* Paginierung Styles */
.page-number {
    width: 40px;
    height: 40px;
    display: -webkit-box;       /* Old webkit */
    display: -ms-flexbox;       /* IE10+ */
    display: flex;              /* Modern */
    -webkit-box-align: center;  /* Old webkit */
    -ms-flex-align: center;     /* IE10+ */
    align-items: center;        /* Modern */
    -webkit-box-pack: center;   /* Old webkit */
    -ms-flex-pack: center;      /* IE10+ */
    justify-content: center;    /* Modern */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.page-number:hover {
    background-color: #E5E7EB;
}

.page-number.active {
    background-color: #3B82F6;
    color: white;
}

.page-number.active:hover {
    background-color: #2563EB;
}

/* Mobile-Responsive Anpassungen */
@media (max-width: 1023px) {
    .product-item {
        margin-bottom: 1.5rem !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
        border-radius: 0.5rem;
        background-color: white;
        padding: 1rem;
        margin-left: 0;
        margin-right: 0;
    }
    
    .product-item .flex {
        -ms-flex-direction: column;
        flex-direction: column;
        padding: 0 !important;
        margin: 0 !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
    
    .product-item .flex > div:first-child {
        margin: 0 auto;
        align-self: center;
        width: 80px;
        height: 80px;
    }
    
    .product-item .flex > div:nth-child(2),
    .product-item .flex > div[class*="w-full"],
    .product-item .flex > div[class*="w-[336px]"],
    .product-item .flex > div[class*="min-w-0"] {
        width: 100% !important;
        margin-top: 1rem;
        text-align: center;
        display: -ms-flexbox;      /* IE 10+ */
        display: flex;             /* Spalte auf Mobile */
        -ms-flex-direction: column;
        flex-direction: column;    /* damit wir Reihenfolge steuern können */
        -ms-flex-align: center;
        align-items: center;       /* Inhalte zentrieren */
    }
    /* Spezifikations-Badges: horizontal scrollen auf Mobile */
    .product-item .flex > div:nth-child(2) .flex.gap-2,
    .product-item .flex > div[class*="w-full"] .flex.gap-2,
    .product-item .flex > div[class*="w-[336px]"] .flex.gap-2,
    .product-item .flex > div[class*="min-w-0"] .flex.gap-2 {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
        margin: 0 auto 0.5rem;
        padding-bottom: 0.25rem;
        -ms-flex-order: 1;
        order: 1;
    }
    .product-item .flex > div:nth-child(2) .flex.gap-2 span,
    .product-item .flex > div[class*="w-full"] .flex.gap-2 span,
    .product-item .flex > div[class*="w-[336px]"] .flex.gap-2 span,
    .product-item .flex > div[class*="min-w-0"] .flex.gap-2 span {
        padding: 0.2rem 0.45rem;
        font-size: 0.7rem;
        flex-shrink: 0 !important;
        white-space: nowrap !important;
    }
    /* Details/Preis-Zeile mobil untereinander anordnen wie bei 10W60 */
    .product-item .flex > div:nth-child(2) .flex.justify-between.items-center,
    .product-item .flex > div[class*="w-full"] .flex.justify-between.items-center,
    .product-item .flex > div[class*="w-[336px]"] .flex.justify-between.items-center,
    .product-item .flex > div[class*="min-w-0"] .flex.justify-between.items-center {
        -ms-flex-direction: column;
        flex-direction: column;
        -ms-flex-align: center;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        width: 100%;
        margin-top: 0.25rem;
        -ms-flex-order: 2;
        order: 2;                    /* Details/Preis darunter */
    }
    
    /* Allgemeine Regel für Links im Detail-Bereich */
    .product-item .flex > div:nth-child(2) > a,
    .product-item .flex > div[class*="w-full"] > a,
    .product-item .flex > div[class*="w-[336px]"] > a,
    .product-item .flex > div[class*="min-w-0"] > a {
        -ms-flex-order: 2;
        order: 2;
        margin-top: 0.5rem;
    }
    
    /* Link nach unten (unter Preis), mittig */
    .product-item .flex > div:nth-child(2) .flex.justify-between.items-center a,
    .product-item .flex > div[class*="w-full"] .flex.justify-between.items-center a,
    .product-item .flex > div[class*="w-[336px]"] .flex.justify-between.items-center a,
    .product-item .flex > div[class*="min-w-0"] .flex.justify-between.items-center a {
        -ms-flex-order: 2;
        order: 2;
        display: inline-block;
        text-align: center;
        margin-top: 0.25rem;
    }
    
    /* Mobile-Preisblock zuerst anzeigen */
    .product-item .flex > div:nth-child(2) .flex.justify-between.items-center .lg\:hidden,
    .product-item .flex > div[class*="w-full"] .flex.justify-between.items-center .lg\:hidden,
    .product-item .flex > div[class*="w-[336px]"] .flex.justify-between.items-center .lg\:hidden,
    .product-item .flex > div[class*="min-w-0"] .flex.justify-between.items-center .lg\:hidden {
        -ms-flex-order: 1;
        order: 1;
    }
    
    /* Letztes Kind nur stylen, wenn es NICHT hidden ist (z.B. Desktop-Block bleibt auf Mobile versteckt) */
    .product-item .flex > div:last-child:not(.hidden) {
        width: 100%;
        text-align: center;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px solid #e5e7eb;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 1rem;
    }
    
    /* Einzelne Preis-Blocks außerhalb der justify-between Container korrekt positionieren */
    .product-item .flex > div[class*="w-full"] > p.text-sm.text-gray-600,
    .product-item .flex > div[class*="w-[336px]"] > p.text-sm.text-gray-600,
    .product-item .flex > div[class*="min-w-0"] > p.text-sm.text-gray-600,
    .product-item .flex > div:nth-child(2) > p.text-sm.text-gray-600 {
        -ms-flex-order: 2;
        order: 2;
        margin-top: 0.25rem;
    }
    
    /* Separate Links so geordnet, dass sie nach den Preisblöcken erscheinen */
    .product-item .flex > div[class*="w-full"] > a.text-blue-600,
    .product-item .flex > div[class*="w-[336px]"] > a.text-blue-600,
    .product-item .flex > div[class*="min-w-0"] > a.text-blue-600,
    .product-item .flex > div:nth-child(2) > a.text-blue-600 {
        -ms-flex-order: 3;
        order: 3;
        margin-top: 0.5rem;
    }
    
    #mobile-filter-toggle {
        position: sticky;
        top: 80px;
        z-index: 20;
        font-weight: 600;
    }
    
    #filter-content {
        transition: all 0.3s ease-in-out;
        max-height: 80vh;
        overflow-y: auto;
        background-color: white;
        border-radius: 0.5rem;
        margin-top: 0.5rem;
        padding: 1rem;
    }
    
    .page-number {
        width: 35px;
        height: 35px;
    }
}

/* Zusätzliche Optimierung: sehr kleine Bildschirme (Mobile) */
@media (max-width: 640px) {
    /* Paginierung vertikal anordnen, Buttons volle Breite */
    #pagination {
        -ms-flex-direction: column;
        flex-direction: column;
        align-items: center; /* Buttons zentrieren statt strecken */
        gap: 0.5rem;
    }

    #pagination > button {
        width: auto;        /* nicht vollflächig */
        min-width: 180px;   /* angenehme Mindestbreite */
        max-width: 90%;     /* falls Viewport sehr schmal ist */
        min-height: 44px;   /* bessere Touch-Fläche */
        align-self: center; /* sicher zentriert */
    }

    /* Seitenzahlen als horizontal scrollbare Leiste */
    #page-numbers {
        -ms-flex-order: 2;
        order: 2;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        display: flex;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.25rem 0;
    }

    /* Reihenfolge: Zurück, Zahlen, Weiter */
    #prev-page { 
        -ms-flex-order: 1;
        order: 1; 
    }
    #next-page { 
        -ms-flex-order: 3;
        order: 3; 
    }

    /* Scrollbar ausblenden (optional, plattformabhängig) */
    #page-numbers::-webkit-scrollbar { display: none; }
    #page-numbers { -ms-overflow-style: none; scrollbar-width: none; }
}

/* ===== END EXTRACTED FROM INLINE CSS ===== */

/* Anpassungen für Filter-Buttons - REDUCED (weniger bewegung) */
.filter-btn {
    transition: background-color 0.2s ease;
}
.filter-btn.active {
    /* transform: scale(1.05); */ /* Entfernt */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Reduziert */
}

/* Produkt-Karten Animation - DISABLED (störende Bewegung entfernt) */

/* Such-Animation */
#product-search {
    transition: box-shadow 0.3s ease;
}
#product-search:focus {
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 0, 71, 171), 0.3);
}

/* Keine Ergebnisse Nachricht */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Dark Mode Anpassung */
.dark .no-results {
    color: #9CA3AF;
}

/* Animation für das Einblenden */
.no-results {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Produkt-Übergänge */
section[id] {
    transition: opacity 0.5s ease;
}

/* Erweiterte Produkt-Karten Styles - DISABLED (störende Bewegung entfernt) */

/* Produkt-Bild Container */
.product-image-container {
    position: relative;
    height: 14rem;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.dark .product-image-container {
    background: linear-gradient(135deg, #374151 0%, #1F2937 100%);
}

/* Spezifikationen Badges */
.spec-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: #E5E7EB;
    color: #4B5563;
    border-radius: 0.25rem;
    margin: 0.125rem;
}

.dark .spec-badge {
    background: #374151;
    color: #9CA3AF;
}

/* Download Button Animation */
.download-btn {
    position: relative;
    overflow: hidden;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.download-btn:hover::before {
    width: 300px;
    height: 300px;
}

/* Produkt Info Hover Effects - DISABLED (störende Bewegung entfernt) */

/* Floating Labels für Produktkategorien */
.product-category-label {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    border-radius: 9999px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

/* Modal für Produktdetails */
.product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
}

.product-modal-content {
    position: relative;
    background: white;
    max-width: 1200px;
    margin: 2rem auto;
    border-radius: 1rem;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.dark .product-modal-content {
    background: #1F2937;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Grid Layout für Produktdarstellung */
.products-grid {
    display: -ms-grid;
    display: grid;
    grid-gap: 2rem;  /* IE11+ fallback */
    gap: 2rem;
    -webkit-animation: gridFadeIn 0.6s ease-out;
    animation: gridFadeIn 0.6s ease-out;
}

@media (min-width: 768px) {
    .products-grid {
        -ms-grid-columns: 1fr 2rem 1fr;  /* IE11+ with gap */
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .products-grid {
        -ms-grid-columns: 1fr 2rem 1fr 2rem 1fr;  /* IE11+ with gap */
        grid-template-columns: repeat(3, 1fr);
    }
}

@-webkit-keyframes gridFadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

@keyframes gridFadeIn {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
        transform: translateY(0);
    }
}

/* Schwebende Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background: #1F2937;
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
}

.tooltip:hover .tooltip-content {
    opacity: 1;
    transform: translateX(-50%) translateY(-12px);
}

/* Download Animation */
@keyframes downloadPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--primary-color-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--primary-color-rgb), 0);
    }
}

.download-active {
    animation: downloadPulse 1s;
}
