/**
 * Den Braven B2B - Dimensions tooltip
 * Ruler-icon tooltip showing weight (kg) and L x W x H (cm) next to the
 * "balení" cell in the Variants Table for WooCommerce plugin.
 */

.dimensions-info-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 6px;
    cursor: help;
    color: #777;
    vertical-align: middle;
    line-height: 1;
    position: relative;
    top: -2px;
}

@media screen and (max-width: 767px) {
    .dimensions-info-trigger {
        cursor: pointer;
    }
}

.dimensions-info-trigger:hover {
    color: #ec1016;
}

.dimensions-info-trigger svg {
    width: 14px;
    height: 14px;
    display: block;
}

.dimensions-tooltip {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    min-width: 240px;
    font-size: 14px;
    line-height: 1.4;
    display: none;
}

.dimensions-tooltip h4 {
    margin: 0;
    padding: 12px 15px 6px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.dimensions-tooltip .dimensions-list {
    padding: 0 15px 12px;
}

.dimensions-tooltip .dimensions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #f5f5f5;
}

.dimensions-tooltip .dimensions-row:last-child {
    border-bottom: none;
}

.dimensions-tooltip .dimensions-label {
    font-weight: 500;
    color: #777;
}

.dimensions-tooltip .dimensions-value {
    font-weight: bold;
    color: #333;
}

.dimensions-tooltip .dimensions-empty {
    padding: 0 15px 15px;
    color: #777;
    font-style: italic;
}

/* Mobile modal overlay (shared with storage tooltip if needed) */
.dimensions-tooltip-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

.dimensions-tooltip-close {
    display: none;
}

@media screen and (max-width: 767px) {
    .dimensions-tooltip.dimensions-tooltip-modal {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
        min-width: 280px;
    }

    .dimensions-tooltip-close {
        display: flex;
        justify-content: center;
        position: absolute;
        top: 10px;
        right: 10px;
        width: 32px;
        height: 32px;
        border: none;
        background: #f5f5f5;
        border-radius: 50%;
        font-size: 24px;
        line-height: 28px;
        color: #666;
        cursor: pointer;
        padding: 0;
        z-index: 1;
    }

    .dimensions-tooltip-close:hover {
        background: #e0e0e0;
        color: #333;
    }

    .dimensions-tooltip.dimensions-tooltip-modal h4 {
        padding-right: 40px;
    }
}
