/* Make parent blocks visible for dropdown elements */
.product-grid-item .product-element-top,
.product-grid-item,
.wd-product,
.product-wrapper {
    overflow: visible !important;
    transform: none !important;
    z-index: auto;
}

.product-element-top {
    position: relative;
}

/* The table itself - positioned relative to image area */
.hover-stock-table {
    position: absolute !important;
    /* Position will be set by JavaScript - follows mouse cursor */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    background: transparent;
    border: none;
    border-radius: 8px;
    box-shadow: none;

    z-index: 99999 !important;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease !important;
    pointer-events: none;

    margin: 0 !important;
    padding: 0;
    width: auto;
    max-width: none;
    min-width: 300px;
}

/* When JavaScript sets position, remove transform */
.hover-stock-table[style*="left"] {
    transform: none !important;
    transition: left 0.05s linear, top 0.05s linear !important;
}

/* Show on hover over product card - DISABLED: replaced by B2B popup button */
.product-grid-item:hover .hover-stock-table,
.wd-product:hover .hover-stock-table,
.product-element-top:hover .hover-stock-table {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Keep visible when hovering over table */
.hover-stock-table:hover {
    opacity: 1;
    visibility: visible;
}

/* Table internals styling */
.hover-stock-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    border: 1px solid rgba(0,0,0,0.1);
    font-family: "Noto Sans Armenian", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hover-stock-table th,
.hover-stock-table td {
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 13px;
    font-family: "Noto Sans Armenian", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hover-stock-table th {
    background-color: #f5f5f5;
    font-weight: 700;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0.3px;
    font-family: "Noto Sans Armenian", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.hover-stock-table th:first-child {
    text-align: left;
    background-color: #fafafa;
}

.hover-stock-table td:not(:first-child):hover {
    background-color: #f9f9f9;
}

.hover-stock-table .in-stock {
    background: #e8f5e9;
    color: #4CAF50;
    font-weight: 600;
}

.hover-stock-table .out-stock {
    background: #ffebee;
    color: #f44336;
    font-weight: 600;
}

.hover-stock-table .old-price {
    color: #f44336;
    text-decoration: line-through;
    font-size: 11px;
    margin-right: 4px;
    display: inline-block;
}

.hover-stock-table .new-price {
    color: #2196F3;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .hover-stock-table {
        font-size: 10px;
        padding: 6px;
        left: -5px;
        right: -5px;
    }

    .hover-stock-table th,
    .hover-stock-table td {
        padding: 6px 4px;
        font-size: 10px;
    }
}

/* Scrollbar styling */
.hover-stock-table::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.hover-stock-table::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.hover-stock-table::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.hover-stock-table::-webkit-scrollbar-thumb:hover {
    background: #555;
}
