/* ===============================
   KLEINES OVERLAY (Live-Ergebnisse)
   =============================== */
.woo-ajax-search-results {
    position: absolute;
    background: #fff;
    border: 1px solid #e2e2e2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    padding: 0;
    margin-top: 4px;
    z-index: 9999;
    width: 100%;
    max-width: 600px;
    font-family: sans-serif;
}

.woo-ajax-search-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #f2f2f2;
    transition: background 0.2s;
}

.woo-ajax-search-item:last-child {
    border-bottom: none;
}

.woo-ajax-search-item:hover {
    background-color: #f9f9f9;
}

.woo-ajax-search-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 12px;
}

.woo-ajax-search-item a {
    font-weight: 500;
    color: #333;
    text-decoration: none;
}

.woo-ajax-search-item span {
    display: block;
    color: #666;
    font-size: 14px;
    margin-top: 2px;
}


/* ===============================
   FULLSCREEN-OVERLAY (Doofinder-Stil)
   =============================== */
.woo-ajax-fullscreen-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 100vh;
    max-height: 80vh;
    background: #fff;
    z-index: 9999999 !important;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: sans-serif;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
}

@media (max-width: 768px) {
    .woo-ajax-fullscreen-overlay {
        max-height: 100vh;
    }
}
.woo-ajax-overlay-header {
    display: flex;
    justify-content: space-between;
    padding: 20px;
    background: #f4f4f4;
    border-bottom: 1px solid #ddd;
}

.woo-ajax-search-input {
    flex-grow: 1;
    padding: 10px 15px;
    font-size: 18px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.woo-ajax-overlay-close {
    font-size: 28px;
    background: none;
    border: none;
    margin-left: 15px;
    cursor: pointer;
    color: #555;
}


.woo-ajax-overlay-content {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
    height: 100%;
}


.woo-ajax-sidebar {
    width: 30%;
    padding: 20px;
    background: #f9f9f9;
    overflow-y: auto;
    border-right: 1px solid #eee;
}

.woo-ajax-results {
    display: grid;
    gap: 20px;
    padding: 20px;
    overflow-y: auto;
    width: 70%;

    /* Dynamische Spaltenanzahl per Variable */
    grid-template-columns: repeat(var(--woo-cols, 3), 1fr);

    /* Maximalbreite anpassen, damit keine Riesenlücken entstehen */
    max-width: calc((190px * var(--woo-cols, 3)) + (20px * (var(--woo-cols, 3) - 1)));
    box-sizing: border-box;
}

@media (max-width: 1024px) {
    .woo-ajax-results {
        grid-template-columns: repeat(var(--woo-cols-tablet, 2), 1fr);
        max-width: calc((190px * var(--woo-cols-tablet, 2)) + (20px * (var(--woo-cols-tablet, 2) - 1)));
    }
}

@media (max-width: 768px) {
    .woo-ajax-results {
        grid-template-columns: repeat(var(--woo-cols-mobile, 1), 1fr);
        max-width: calc((190px * var(--woo-cols-mobile, 1)) + (20px * (var(--woo-cols-mobile, 1) - 1)));
    }
}

.woo-ajax-grid-item {
    border: 1px solid #eee;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    transition: box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.woo-ajax-grid-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}



.woo-add-to-cart-icon {
    background: #0071a1;
    color: #fff;
    font-size: 18px;
    padding: 6px 10px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease;
}

.woo-add-to-cart-icon:hover {
    background: #005f87;
}



.woo-variable-modal {
    position: fixed;
    z-index: 99999999;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.woo-variable-modal-backdrop {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
}

.woo-variable-modal-content {
    position: relative;
    background: #fff;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    z-index: 10;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    font-family: sans-serif;
}

.woo-variable-modal-content h3 {
    margin-top: 0;
}

.woo-modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 24px;
    background: none;
    border: none;
    cursor: pointer;
}

.woo-modal-submit {
    background: #0071a1;
    color: #fff;
    border: none;
    padding: 10px 16px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
}


/* ===============================
   Aktionsbuttons (Ansehen + In den Warenkorb)
   =============================== */
.woo-ajax-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    justify-content: flex-start;
    align-items: center;
}

.woo-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: #f2f2f2;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
    text-decoration: none;
}

.woo-action-btn:hover {
    background: #0073aa;
    color: #fff;
    transform: scale(1.08);
}

.woo-action-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}
