/* ═══ iMatrix Quick View Slide-In ═══ */

/* ─── Overlay ─── */
.imatrix-qv-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9996;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}
.imatrix-qv-overlay.imatrix-qv-open {
    opacity: 1;
    visibility: visible;
}

/* ─── Quick View Slide-in Panel ─── */
.imatrix-qv-slidein {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: #fff;
    z-index: 9997;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
    transition: right 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
}
.imatrix-qv-slidein.imatrix-qv-open {
    right: 0;
}

/* ─── Header ─── */
.imatrix-qv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-bottom: 1px solid #e5e5e5;
    background: #1a73e8;
    color: #fff;
    flex-shrink: 0;
}
.imatrix-qv-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: calc(100% - 50px);
}
.imatrix-qv-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
    flex-shrink: 0;
}
.imatrix-qv-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ─── Body (scrollable) ─── */
.imatrix-qv-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 22px;
    -webkit-overflow-scrolling: touch;
}

/* ─── Product Image ─── */
.imatrix-qv-image-wrap {
    text-align: center;
    margin-bottom: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
}
.imatrix-qv-image-wrap img {
    max-width: 100%;
    max-height: 240px;
    height: auto;
    width: auto;
    object-fit: contain;
    display: inline-block;
}

/* ─── Product Title ─── */
.imatrix-qv-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

/* ─── Short Description ─── */
.imatrix-qv-desc {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    margin-bottom: 14px;
}
.imatrix-qv-desc p {
    margin: 0 0 8px 0;
}

/* ─── Price ─── */
.imatrix-qv-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a73e8;
    margin-bottom: 18px;
    display: block;
}
.imatrix-qv-price .woocommerce-Price-amount {
    font-size: 1.5rem;
}

/* ─── Domain Field (reuses product styles) ─── */
.imatrix-qv-body .imatrix-osint-domain-field-wrapper {
    margin-bottom: 18px;
    padding: 14px 16px;
    background: #f8f9fa;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
}
.imatrix-qv-body .imatrix-osint-domain-field-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: #1a1a1a;
}
.imatrix-qv-body .imatrix-osint-domain-field-wrapper .input-text {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.imatrix-qv-body .imatrix-osint-domain-field-wrapper .input-text:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
    outline: none;
}
.imatrix-qv-body .imatrix-domain-hint {
    display: block;
    font-size: 0.8rem;
    color: #666;
    margin-top: 4px;
}
.imatrix-qv-body .imatrix-domain-msg {
    display: block;
    font-size: 0.85rem;
    margin-top: 4px;
    min-height: 1.2em;
}

/* ─── Quick View Buy Button (inside slide-in) ─── */
.imatrix-qv-buy {
    width: 100%;
    padding: 14px 20px !important;
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    border: none !important;
    background: #1a73e8 !important;
    color: #fff !important;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.imatrix-qv-buy:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    background: #1557b0 !important;
}
.imatrix-qv-buy:disabled,
.imatrix-qv-buy.imatrix-loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
    transform: none;
}

/* ─── Quick View Button on Product Cards ─── */
.imatrix-qv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 10px 16px;
    margin-top: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: #1a73e8;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    text-decoration: none;
}
.imatrix-qv-btn:hover {
    background: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}
.imatrix-qv-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.2);
}

/* ─── Single Product "Jetzt kaufen" Button ─── */
.imatrix-single-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 24px;
    margin-top: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    background: #1a73e8;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
}
.imatrix-single-buy-btn:hover {
    background: #1557b0;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.3);
}
.imatrix-single-buy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.2);
}
.imatrix-single-buy-btn:disabled,
.imatrix-single-buy-btn.imatrix-loading {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
    transform: none;
}

/* ─── Single product domain wrapper adjustments ─── */
.imatrix-single-domain-wrapper {
    margin-top: 12px;
}

/* ─── Loading State ─── */
.imatrix-qv-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}
.imatrix-qv-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 2px solid #1a73e8;
    border-top-color: transparent;
    border-radius: 50%;
    animation: imatrix-qv-spin 0.8s linear infinite;
}
@keyframes imatrix-qv-spin {
    to { transform: rotate(360deg); }
}

/* ─── Loading in body area ─── */
.imatrix-qv-body-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    color: #666;
    font-size: 1rem;
}

/* ─── Error message ─── */
.imatrix-qv-error {
    padding: 20px;
    text-align: center;
    color: #c0392b;
    background: #fdf2f2;
    border-radius: 6px;
    margin: 10px 0;
}

/* ─── Success message after add to cart ─── */
.imatrix-qv-success {
    padding: 12px 16px;
    background: #e8f5e9;
    border: 1px solid #27ae60;
    border-radius: 6px;
    color: #1b5e20;
    margin-bottom: 14px;
    font-weight: 600;
    text-align: center;
}

/* ─── Desktop tweaks ─── */
@media (min-width: 769px) {
    .tax-product_cat.woocommerce ul.products li.product .imatrix-qv-btn,
    .post-type-archive-product.woocommerce ul.products li.product .imatrix-qv-btn {
        align-self: stretch;
        width: 100%;
    }
}

/* ─── Mobile width ─── */
@media (max-width: 768px) {
    .imatrix-qv-btn {
        font-size: 0.95rem;
        padding: 12px 14px;
    }
    .imatrix-single-buy-btn {
        font-size: 1rem;
        padding: 12px 18px;
    }
}

@media (max-width: 480px) {
    .imatrix-qv-slidein {
        width: 100vw;
        right: -100vw;
    }
    .imatrix-qv-slidein.imatrix-qv-open {
        right: 0;
    }
    .imatrix-qv-body {
        padding: 16px;
    }
    .imatrix-qv-image-wrap img {
        max-height: 180px;
    }
    .imatrix-qv-title {
        font-size: 1.2rem;
    }
    .imatrix-qv-price {
        font-size: 1.25rem;
    }
    .imatrix-qv-price .woocommerce-Price-amount {
        font-size: 1.25rem;
    }
    .imatrix-qv-buy {
        padding: 12px 16px !important;
        font-size: 1rem !important;
    }
    .imatrix-qv-header h2 {
        font-size: 1rem;
    }
    .imatrix-single-buy-btn {
        font-size: 1rem;
        padding: 12px 16px;
    }
}

/* ═── Quick View Footer (Buttons like Cart Slide-in) ─══ */
.imatrix-qv-footer {
    padding: 16px 22px;
    border-top: 1px solid #e5e5e5;
    background: #fafafa;
    flex-shrink: 0;
    margin-top: auto;
}
.imatrix-qv-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.imatrix-qv-actions .button {
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s, background 0.2s;
    cursor: pointer;
}
.imatrix-qv-actions .button:hover {
    opacity: 0.9;
}
.imatrix-qv-buy-btn {
    background: #1a73e8;
    color: #fff;
    border: none;
}
.imatrix-qv-cart-btn {
    background: #fff;
    color: #1a73e8;
    border: 1px solid #1a73e8;
}
.imatrix-qv-cart-btn:hover {
    background: #f0f7ff;
}
