/* ===============================================
   Shopify WordPress Integration - Frontend CSS
   Salient Theme optimiert - Version 2.0.0
   =============================================== */

/* Container & Grid Layout */
.shopify-products-container {
    margin: 60px 0;
    position: relative;
    clear: both;
}

.shopify-products-grid {
    display: grid;
    gap: 40px;
    margin: 0;
    position: relative;
}

.shopify-products-grid.columns-2 { grid-template-columns: repeat(2, 1fr); }
.shopify-products-grid.columns-3 { grid-template-columns: repeat(3, 1fr); }
.shopify-products-grid.columns-4 { grid-template-columns: repeat(4, 1fr); }
.shopify-products-grid.columns-5 { grid-template-columns: repeat(5, 1fr); }

/* Responsive Grid Breakpoints */
@media (max-width: 1200px) {
    .shopify-products-grid.columns-4,
    .shopify-products-grid.columns-5 {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

/* Tablets und kleine Bildschirme - 2 Spalten */
@media (max-width: 999px) {
    .shopify-products-grid.columns-3,
    .shopify-products-grid.columns-4,
    .shopify-products-grid.columns-5 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
}

/* Smartphones - auch 2 Spalten (oder 1 wenn gewünscht) */
@media (max-width: 480px) {
    .shopify-products-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 2 Spalten auf Mobile */
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .shopify-products-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }
}

/* ===============================================
   Product Cards - Salient Style (Komplett klickbar)
   =============================================== */

.shopify-product-card {
    background: #ffffff;
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.shopify-product-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
    text-decoration: none;
    color: inherit;
}

.shopify-product-card:focus {
    outline: 2px solid #000000;
    outline-offset: 2px;
}

/* Product Image */
.shopify-product-image-wrap {
    position: relative !important;
    overflow: hidden !important;
    background: #ffffff !important;
    height: 200px !important;
    width: 100% !important;
    aspect-ratio: unset !important;
}

.shopify-product-image {
    width: 100% !important;
    height: 200px !important;
    object-fit: contain !important;
    display: block !important;
    transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    aspect-ratio: unset !important;
}

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

/* Product Overlay */
.shopify-product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.shopify-product-card:hover .shopify-product-overlay {
    opacity: 1;
}

/* ===============================================
   Badge & Indicators
   =============================================== */

/* Preis-Badge */
.shopify-product-price-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    letter-spacing: 0.3px;
    z-index: 2;
    pointer-events: none;
}

/* Verfügbarkeits-Indikator */
.shopify-availability-indicator {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
}

.availability-available {
    background: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.3);
}

.availability-unavailable {
    background: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.3);
}

/* ===============================================
   Product Content
   =============================================== */

.shopify-product-content {
    padding: 20px 20px 25px;
    text-align: left;
    position: relative;
    background: white;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.shopify-product-vendor {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    font-weight: 500;
    opacity: 0.8;
}

.shopify-product-title {
    font-size: 15px!important;
    font-weight: 600;
    margin: 0 0 15px 0;
    line-height: normal !important;
    color: #1a1a1a;
    min-height: 40px;
    font-family: inherit;
    letter-spacing: -0.3px;
    flex-grow: 1;
}

.shopify-product-price {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 20px 0;
    letter-spacing: -0.3px;
}

/* ===============================================
   Product Button
   =============================================== */

.shopify-product-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #000000;
    color: white !important;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 0;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 2px solid #000000;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 40px;
    margin-top: auto;
}

.shopify-product-button:before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.shopify-product-card:hover .shopify-product-button {
    background: transparent;
    color: #1a1a1a !important;
    text-decoration: none;
    transform: translateY(-2px);
}

.shopify-product-card:hover .shopify-product-button:before {
    left: 100%;
}

/* ===============================================
   Slider Layout
   =============================================== */

.shopify-products-slider {
    display: flex;
    overflow-x: auto;
    gap: 40px;
    padding: 20px 0 60px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.shopify-products-slider::-webkit-scrollbar {
    display: none;
}

.shopify-products-slider .shopify-product-card {
    min-width: 260px;
    flex-shrink: 0;
}

/* ===============================================
   Dark Theme Support
   =============================================== */

@media (prefers-color-scheme: dark) {
    .shopify-product-card {
        background: #1a1a1a;
        box-shadow: 0 2px 20px rgba(255, 255, 255, 0.05);
    }
    
    .shopify-product-card:hover {
        box-shadow: 0 25px 50px rgba(255, 255, 255, 0.1);
    }
    
    .shopify-product-content {
        background: #1a1a1a;
    }
    
    .shopify-product-title {
        color: #ffffff;
    }
    
    .shopify-product-price {
        color: #ffffff;
    }
    
    .shopify-product-button {
        background: #ffffff;
        color: #1a1a1a !important;
        border-color: #ffffff;
    }
    
    .shopify-product-card:hover .shopify-product-button {
        background: transparent;
        color: #ffffff !important;
    }
}

/* ===============================================
   Loading & Error States
   =============================================== */

.shopify-no-products {
    text-align: center;
    padding: 80px 40px;
    color: #666;
    background: #f8f8f8;
    border-radius: 0;
    margin: 40px 0;
    font-size: 16px;
    letter-spacing: 0.5px;
}

/* ===============================================
   Animations
   =============================================== */

/* Animation on Load */
.shopify-product-card {
    animation: fadeInUp 0.6s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}

.shopify-product-card:nth-child(1) { animation-delay: 0.1s; }
.shopify-product-card:nth-child(2) { animation-delay: 0.2s; }
.shopify-product-card:nth-child(3) { animation-delay: 0.3s; }
.shopify-product-card:nth-child(4) { animation-delay: 0.4s; }
.shopify-product-card:nth-child(5) { animation-delay: 0.5s; }
.shopify-product-card:nth-child(6) { animation-delay: 0.6s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===============================================
   Mobile Optimizations
   =============================================== */

@media (max-width: 768px) {
    .shopify-products-container {
        margin: 40px 0;
    }
    
    .shopify-product-image-wrap {
        height: 180px !important;
    }
    
    .shopify-product-image {
        height: 180px !important;
    }
    
    .shopify-product-content {
        padding: 18px 15px 22px;
    }
    
    .shopify-product-title {
        font-size: 14px !important;
        min-height: 36px;
    }
    
    .shopify-product-price {
        font-size: 16px;
    }
    
    .shopify-product-button {
        padding: 9px 18px;
        font-size: 10px;
        min-height: 36px;
    }
}

/* ===============================================
   Salient Theme Specific Integration
   =============================================== */

/* Spezielle Anpassungen für Salient Theme */
.nectar-slider-wrap .shopify-products-container,
.full-width-section .shopify-products-container {
    margin: 0;
}

.col .shopify-products-container {
    margin: 40px 0;
}

/* Bessere Integration in Salient Columns */
.wpb_column .shopify-product-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.wpb_column .shopify-product-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.wpb_column .shopify-product-button {
    margin-top: auto;
}

/* ===============================================
   Performance & Accessibility
   =============================================== */

/* Reduzierte Motion für Benutzer mit motion-reduce */
@media (prefers-reduced-motion: reduce) {
    .shopify-product-card,
    .shopify-product-image,
    .shopify-product-button,
    .shopify-product-overlay {
        transition: none;
        animation: none;
    }
    
    .shopify-product-card:hover {
        transform: none;
    }
    
    .shopify-product-card:hover .shopify-product-image {
        transform: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .shopify-product-card {
        border: 2px solid #000;
    }
    
    .shopify-product-button {
        border: 2px solid #000;
    }
}