/**
 * Stock, Brand & Model Wrapper + Low-Stock Tooltip Styles
 * Loaded on single product pages
 */

.cfwc-stock-brand-model-wrapper{
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin: 15px 0;
}
.cfwc-brand-field, .cfwc-model-field, .cfwc-stock-info{
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    justify-content: flex-start;
    background: #f1f1f1;
    border-radius: 10px;
    padding: 10px 5px;
}
.cfwc-model-field .field-title, .cfwc-brand-field .field-title {
    color: #000000;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
}
.cfwc-stock-brand-model-wrapper .stock{
     display: flex !important;
    flex-direction: column;
}
.cfwc-model-field .field-value, .cfwc-brand-field .field-value{
    text-align: center;
    font-size: 16px;
    margin: auto;
}
.content-area p.stock.in-stock{
    margin: 0;
    height: 100%;

}
.cfwc-stock-brand-model-wrapper .stock-title{
    margin-bottom: 5px;
}
.cfwc-stock-brand-model-wrapper .stock-instock{
    margin: auto;
}
.cfwcl-custom-field-wrapper.lead-timee{
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    height: 100%
}
.cfwcl-custom-field-wrapper.lead-timee .cfwc-lead-time{
    margin: auto;
}

/* Low Stock Styles */
.stock-low {
    color: #d97706;
    font-weight: 600;
    font-size: 13px;
    cursor: help;
    position: relative;
    padding: 5px 10px;
    border-radius: 15px;
    display: inline-block;
    transition: all 0.3s ease;
    border: 1px solid #c9c9c9;
    line-height: 15px;
}

.low-stock-wrapper {
    position: relative;
    display: inline-block;
}

.low-stock-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1f2937;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.5;
    white-space: normal;
    width: 280px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-weight: normal;
}

.low-stock-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #1f2937;
}

.low-stock-wrapper:hover .low-stock-tooltip {
    opacity: 1;
    visibility: visible;
}

.stock-low:hover {
    transform: scale(1.05);
}

/* Media query for mobile responsiveness */
@media (max-width: 768px) {
    .low-stock-tooltip {
        width: 220px;
        font-size: 14px;
        padding: 12px 16px;
        /* Adjust positioning for mobile */
        left: 0;
        transform: translateX(0);
        margin-left: -20px; /* Shift slightly to the right */
    }

    /* Adjust arrow position for mobile */
    .low-stock-tooltip::after {
        left: 30px; /* Position arrow closer to left side */
        transform: translateX(0);
    }

    /* For very small screens, adjust further */
    @media (max-width: 375px) {
        .low-stock-tooltip {
            width: 200px;
            margin-left: -10px;
        }
    }
}

/* Alternative solution: Position tooltip to the right on mobile if space allows */
@media (max-width: 768px) {
    .cfwc-stock-info:first-child .low-stock-tooltip {
        /* If stock is the first column, position tooltip differently */

        right: -10px;
        transform: none;
        margin-left: 0;
    }

    .cfwc-stock-info:first-child .low-stock-tooltip::after {
        left: 20px;
    }
}
