/* search/css/product-modal-new.css */

/* --- Z-INDEX FIX für Notifications --- */
.toast-notification,
.notification-container,
.toast {
    z-index: 2147483647 !important;
    /* Max möglicher Wert */
}

/* --- Modal Container --- */
#productModal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#productModal.show {
    display: flex !important;
    opacity: 1;
}

.product-modal-content {
    background-color: var(--bg-card, #141414);
    border: 1px solid var(--border, #2a2a2a);
    color: var(--text, #fff);

    /* ROUNDED CORNERS */
    border-radius: 24px;

    max-width: 1100px;
    /* Slightly wider */
    width: 90%;
    height: 600px;
    /* Fixed Height for Premium Look on Desktop */
    margin: auto;
    position: relative;
    box-shadow: 0 40px 80px -12px rgba(0, 0, 0, 0.6);

    display: grid;
    /* 55% Image, 45% Info */
    grid-template-columns: 55% 45%;
    overflow: hidden;
    transform: translateY(20px) scale(0.98);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#productModal.show .product-modal-content {
    transform: translateY(0) scale(1);
}

/* --- Close Button --- */
.new-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 100;
    background: rgba(40, 40, 40, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.new-modal-close:hover {
    background: var(--primary, #c77dff);
    border-color: var(--primary, #c77dff);
    transform: rotate(90deg);
}

/* --- Galerie (Links) --- */
.new-modal-gallery {
    background: #000;
    padding: 0;
    width: 100%;
    height: 100%;
    /* Fill Grid Cell */
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.new-modal-main-image-container {
    flex: 1;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    /* Fallback */
    position: relative;
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
    z-index: 1;
}

/* BLURRED BACKGROUND EFFECT */
.new-modal-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(20px) brightness(0.6);
    transform: scale(1.2);
    /* Prevent blur edges */
    z-index: 0;
    opacity: 0.5;
}

.new-modal-main-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    transition: opacity 0.3s ease;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
    position: relative;
    z-index: 2;
}

/* --- Buttons Oben Links (Like & Report) --- */
.modal-image-actions {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 20;
}

/* FIX: Klasse angepasst an dein JS (.product-action-btn statt .modal-action-btn) */
/* FIX: Apply to Modal Only */
#productModal .product-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
}

#productModal .product-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

#productModal .product-action-btn .action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Like Active State */
/* Like Active State */
#productModal .product-action-btn.like-btn.liked {
    background: var(--like-red, #ff4757);
    border-color: var(--like-red, #ff4757);
    color: white;
}

#productModal .product-action-btn.like-btn.liked svg {
    fill: currentColor;
}

/* Report Button Styling (Grey Circle, Yellow Icon) */
/* Report Button Styling (Grey Circle, Yellow Icon) */
/* Report Button Styling (Synced with Grid) */
/* Report Button Styling (Synced with Grid - FORCED) */
#productModal .product-action-btn.report-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    /* Pure Circle */
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(80, 80, 80, 0.4);
    /* Keep greyish tint but add blur */
    backdrop-filter: blur(15px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    color: #FFD700;
    /* Yellow Icon */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    transition: all 0.2s ease;
    flex-shrink: 0 !important;
    /* Prevent squash */
    margin: 0;
    /* Reset margins */
}

#productModal .product-action-btn.report-btn:hover {
    background: rgba(100, 100, 100, 0.6);
    transform: scale(1.05);
    border-color: rgba(255, 215, 0, 0.5);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

#productModal .product-action-btn.report-btn .action-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#productModal .product-action-btn.report-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    stroke: none;
}

/* QC Button Styles in Modal */
/* QC Button Styles in Modal Actions */
#productModal .new-modal-actions .product-action-btn.qc-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #00b09b, #96c93d);
    /* Green Gradient */
    opacity: 1;
    transition: width 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), background-color 0.3s ease;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
    padding: 0;
    box-shadow: 0 4px 15px rgba(0, 176, 155, 0.2);
}

#productModal .new-modal-actions .product-action-btn.qc-btn .qc-text {
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-width 0.3s ease, opacity 0.3s ease, margin-left 0.3s ease;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
}

#productModal .new-modal-actions .product-action-btn.qc-btn.wip-active {
    width: 160px;
    /* Expand to fit text */
    justify-content: flex-start;
    padding-left: 16px !important;
}

#productModal .new-modal-actions .product-action-btn.qc-btn.wip-active .qc-text {
    max-width: 120px;
    opacity: 1;
    margin-left: 8px;
}

/* Mobile Adjustments for QC Button */
@media (max-width: 768px) {
    #productModal .new-modal-actions .product-action-btn.qc-btn {
        width: 56px;
        height: 56px;
        border-radius: 16px;
    }

    #productModal .new-modal-actions .product-action-btn.qc-btn.wip-active {
        width: 180px;
    }
}

/* --- Modal Navigation Buttons (Under Modal) --- */
.modal-nav-container {
    position: absolute;
    bottom: -80px;
    /* Position below the modal content */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 1000;
    width: 100%;
    justify-content: center;
    pointer-events: auto;
}

.modal-nav-btn {
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 24px;
    border-radius: 14px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    min-width: 140px;
    justify-content: center;
}

.modal-nav-btn:hover {
    background: rgba(40, 40, 40, 0.9);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.modal-nav-btn:active {
    transform: translateY(0);
}

.modal-nav-btn svg {
    width: 20px;
    height: 20px;
}

/* --- Action Buttons Fix --- */
.new-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
    width: 100%;
    /* Ensure full width */
    box-sizing: border-box;
    /* Prevent overflow */
}

/* Buy Button - Ensure it takes available space properly */
.new-btn-buy {
    flex: 1;
    /* Grow to fill */
    background: linear-gradient(135deg, var(--primary, #c77dff), var(--primary-dark, #9c27b0));
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center text/icon */
    gap: 8px;
    border: none;
    white-space: nowrap;
    /* Prevent text wrap */
    min-width: 0;
    /* Flexbox text overflow fix */
}

/* Icon Buttons (Copy, Like) */
.new-btn-copy,
.new-btn-like {
    width: 50px;
    height: 50px;
    /* Fixed height matching buy button approx */
    flex-shrink: 0;
    /* Don't shrink */
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface, #2a2a2a);
    border: 1px solid var(--border, #333);
    color: var(--text-secondary, #aaa);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}

/* --- Image Indicators (Dots) --- */
.modal-image-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
    pointer-events: none;
}

.modal-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(4px);
    transition: all 0.3s;
}

.modal-indicator-dot.active {
    background: #fff;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* --- Floating Buttons (Mobile Fix) --- */
/* Ensure all floating buttons share base size/styles */
.floating-btn,
.likes-cart-btn {
    width: 48px;
    height: 48px;
}

/* --- Global Layout & Typography Fixes --- */
.new-modal-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    /* Force Font */
}

.new-modal-header-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.new-badge {
    padding: 0;
    border-radius: 0;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: transparent;
    font-family: inherit;
}

.badge-brand {
    color: #aaa;
    font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.badge-brand::after {
    content: "•";
    margin-left: 8px;
    color: #555;
}

.badge-category {
    color: var(--primary, #c77dff);
    text-shadow: 0 0 15px rgba(199, 125, 255, 0.4);
}

.new-modal-title {
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 24px 0;
    color: #fff;
    letter-spacing: normal;
}

.new-modal-price-box {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.new-price {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
}

.old-price {
    font-size: 1.2rem;
    color: #555;
    text-decoration: line-through;
}

.new-modal-actions {
    margin-top: auto;
    /* Force to bottom */
    display: flex;
    gap: 12px;
    width: 100%;
    padding-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .floating-actions {
        bottom: 80px;
        /* Adjust based on new nav bar or other needs */
        right: 20px;
        gap: 12px;
    }

    .floating-btn {
        width: 56px;
        /* Standardize Mobile Size to Match Like FAB */
        height: 56px;
    }

    /* Keybinds Tooltip Mobile Fix */
    .btn-tooltip {
        width: 90vw !important;
        /* Use screen width percentage */
        max-width: 300px;
        position: fixed !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        right: auto !important;
        bottom: 80px !important;
        /* Above the FABs */
        white-space: normal !important;
        z-index: 3000 !important;
        /* Ensure on top */
        background: rgba(20, 20, 20, 0.95);
        border: 1px solid rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
    }

    #productModal {
        padding: 0;
        align-items: center;
        /* Center for gap verification */
    }

    /* --- Info Panel (Right) - Creative Rework --- */
    /* --- Info Panel (Right) - Mobile Override --- */
    .new-modal-info {
        padding: 24px;
        /* Revert to mobile padding */
        height: auto;
        flex: 1;
        overflow-y: auto;
        border-left: none;
    }

    /* Adjust typography for mobile */
    .new-modal-title {
        font-size: 1.8rem;
        /* Mobile size */
        margin-bottom: 16px;
    }

    .new-price {
        font-size: 1.8rem;
    }

    /* Ensure actions pushed to bottom on mobile too if needed, 
       but global style handles margin-top: auto. 
       Just ensure layout is correct. */
    .new-modal-actions {
        padding-top: 16px;
    }

    /* Buy Button - Glowing & Premium */
    .new-btn-buy {
        flex: 2;
        /* Take more space */
        background: linear-gradient(135deg, var(--primary, #c77dff), #9c27b0);
        color: #fff;
        padding: 16px 24px;
        border-radius: 16px;
        /* High radius */
        text-decoration: none;
        font-weight: 700;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 20px rgba(199, 125, 255, 0.2);
        transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    }

    .new-btn-buy:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 30px rgba(199, 125, 255, 0.4);
        filter: brightness(1.1);
    }

    /* Secondary Buttons (Copy, Like) */
    .new-btn-copy,
    .new-btn-like {
        width: 56px;
        height: 56px;
        /* Match Buy Button Height */
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: #ccc;
        border-radius: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .new-btn-copy:hover,
    .new-btn-like:hover {
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        transform: translateY(-2px);
        border-color: rgba(255, 255, 255, 0.3);
    }

    .new-btn-like.liked {
        background: rgba(255, 71, 87, 0.1);
        border-color: #ff4757;
        color: #ff4757;
        box-shadow: 0 5px 15px rgba(255, 71, 87, 0.2);
    }
}


/* Responsive */
@media (max-width: 768px) {
    /* ... existing mobile overrides ... */

    .product-modal-content {
        grid-template-columns: 1fr;
        height: auto;
        max-height: 85vh;

        /* 1: Make modal smaller (GAPS) */
        width: 90% !important;
        margin: auto;

        border-radius: 20px;
        /* Fully rounded */
        transform: none !important;
        display: flex;
        flex-direction: column;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    }

    .new-modal-info {
        padding: 24px;
        justify-content: flex-start;
        /* Normal flow on mobile */
        height: auto;
        flex: 1;
        overflow-y: auto;
    }

    .new-modal-title {
        font-size: 1.5rem;
        /* Smaller on mobile */
    }

    .new-price {
        font-size: 1.5rem;
    }

    /* Restore Mobile Gallery Stacking */
    .new-modal-gallery {
        border-radius: 20px 20px 0 0;
        /* Updated radius */
        height: 40vh;
        flex-shrink: 0;
        width: 100%;
    }

    .new-modal-main-image-container {
        height: 100% !important;
        width: 100%;
        min-height: auto;
        border-radius: 20px 20px 0 0;
    }

    .product-modal-content {
        touch-action: pan-y;
        /* FIX: Allow vertical scroll, block horizontal for JS swipe */
    }

    .new-modal-close {
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.6);
        width: 36px;
        height: 36px;
        z-index: 200;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
}

/* ======================================================================= */
/* FULLSCREEN IMAGE ZOOM                                                  */
/* ======================================================================= */
.fullscreen-zoom-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 2147483647;
    /* Max Z-Index */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow: hidden;
    /* Prevent scrolling body inside overlay */
}

.fullscreen-zoom-overlay.show {
    opacity: 1;
}

.fullscreen-zoom-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: zoom-in;
    will-change: transform;
}

.fullscreen-zoom-image.zoomed {
    max-width: none;
    max-height: none;
    height: auto;
    width: auto;
    cursor: zoom-out;
    transform: scale(2.5);
    /* Simple zoom */
}

.fullscreen-scroll-container {
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Enable panning when zoomed */
    display: flex;
    align-items: center;
    /* Center initially */
    justify-content: center;
    touch-action: pan-x pan-y;
}

.fullscreen-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    backdrop-filter: blur(5px);
}