/* =========================================================
   ALA STOCK INDICATOR — Frontend CSS
   Version: 1.0.3  —  pixel-matched to original UI
   ========================================================= */

.ala-si-stock-indicator,
.ala-si-stock-indicator *,
.ala-si-stock-indicator *::before,
.ala-si-stock-indicator *::after {
    box-sizing: border-box;
}

/* Wrapper — sits directly below the Buy Now button area */
.ala-si-stock-indicator {
    width: 100%;
    max-width: 100%;
    margin: 16px 0 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    color: #111111;
    font-family: inherit;
    font-size: 14px;
    font-style: normal;
    text-align: left;
    clear: both;
}

/* ---------------------------------------------------------
   HEADER ROW  —  "Stock available" … "18 in stock"
   --------------------------------------------------------- */

.ala-si-stock-indicator .ala-si-stock-header {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    background: transparent;
}

/* "Stock available" — regular weight, dark gray */
.ala-si-stock-indicator .ala-si-stock-label {
    display: block;
    margin: 0;
    padding: 0;
    color: #333333;
    font-family: inherit;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

/* "18 in stock" — bold, black */
.ala-si-stock-indicator .ala-si-stock-count {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: baseline;
    justify-content: flex-end;
    gap: 4px;
    margin: 0;
    padding: 0;
    color: #111111;
    font-family: inherit;
    font-size: 14px;
    font-style: normal;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}

.ala-si-stock-indicator .ala-si-stock-number,
.ala-si-stock-indicator .ala-si-stock-suffix {
    color: inherit;
    font: inherit;
    line-height: inherit;
}

/* ---------------------------------------------------------
   PROGRESS TRACK  —  matches old UI bar height exactly
   --------------------------------------------------------- */

.ala-si-stock-indicator .ala-si-stock-track {
    position: relative;
    display: block;
    width: 100%;
    height: 8px;
    min-height: 8px;
    max-height: 8px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #e0e0e0;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
}

/* Black fill */
.ala-si-stock-indicator .ala-si-stock-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    display: block;
    height: 8px;
    min-height: 8px;
    margin: 0;
    padding: 0;
    background: #000000;
    border: 0;
    border-radius: 999px;
    box-shadow: none;
    transition: width 180ms ease;
}

/* ---------------------------------------------------------
   "Only 18 units available"  —  small gray text
   --------------------------------------------------------- */

.ala-si-stock-indicator .ala-si-stock-message {
    display: block;
    width: 100%;
    margin: 8px 0 0;
    padding: 0;
    color: #777777;
    font-family: inherit;
    font-size: 13px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    text-decoration: none;
}

.ala-si-stock-indicator .ala-si-message-number {
    color: inherit;
    font: inherit;
    font-weight: 400;
}

/* ---------------------------------------------------------
   RECENT PURCHASES ROW
   --------------------------------------------------------- */

.ala-si-stock-indicator .ala-si-recent-purchases {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    color: #111111;
    background: transparent;
    border: 0;
    box-shadow: none;
}

/* ---------------------------------------------------------
   PEOPLE ICON  —  small, same height as one line of text
   --------------------------------------------------------- */

.ala-si-stock-indicator .ala-si-customers-icon {
    display: flex;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    color: #000000;
    line-height: 0;
}

.ala-si-stock-indicator .ala-si-customers-icon svg {
    display: block;
    width: 20px;
    height: 18px;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    fill: currentColor;
    color: #000000;
}

/* ---------------------------------------------------------
   PURCHASE TEXT
   "38 customers" = bold  |  " purchased recently" = normal
   --------------------------------------------------------- */

.ala-si-stock-indicator .ala-si-purchase-text {
    display: block;
    min-width: 0;
    margin: 0;
    padding: 0;
    color: #111111;
    font-family: inherit;
    font-size: 14px;
    font-style: normal;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: 0;
    text-decoration: none;
}

/* Number + first word (e.g. "38 customers") — bold */
.ala-si-stock-indicator .ala-si-purchase-text strong,
.ala-si-stock-indicator .ala-si-purchase-text .ala-si-purchase-bold {
    font-weight: 700;
    font-style: normal;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
}

/* Remainder of text (e.g. " purchased recently") — normal */
.ala-si-stock-indicator .ala-si-purchase-text .ala-si-purchase-rest {
    font-weight: 400;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
    font-family: inherit;
}

/* Legacy: if PHP only wraps the number */
.ala-si-stock-indicator .ala-si-purchase-number {
    font-weight: 700;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* =========================================================
   MOBILE  (≤ 767px)
   ========================================================= */

@media screen and (max-width: 767px) {

    .ala-si-stock-indicator {
        margin-top: 16px;
    }

    .ala-si-stock-indicator .ala-si-stock-header {
        gap: 8px;
        margin-bottom: 8px;
    }

    .ala-si-stock-indicator .ala-si-stock-label {
        font-size: 14px;
    }

    .ala-si-stock-indicator .ala-si-stock-count {
        font-size: 14px;
    }

    .ala-si-stock-indicator .ala-si-stock-track {
        height: 8px;
        min-height: 8px;
        max-height: 8px;
    }

    .ala-si-stock-indicator .ala-si-stock-fill {
        height: 8px;
        min-height: 8px;
    }

    .ala-si-stock-indicator .ala-si-stock-message {
        margin-top: 8px;
        font-size: 13px;
    }

    .ala-si-stock-indicator .ala-si-recent-purchases {
        gap: 8px;
        margin-top: 14px;
    }

    .ala-si-stock-indicator .ala-si-customers-icon {
        flex-basis: 20px;
        width: 20px;
        height: 20px;
    }

    .ala-si-stock-indicator .ala-si-customers-icon svg {
        width: 20px;
        height: 18px;
    }

    .ala-si-stock-indicator .ala-si-purchase-text {
        font-size: 14px;
        font-weight: 400;
    }
}

/* =========================================================
   VERY SMALL MOBILE  (≤ 359px)
   ========================================================= */

@media screen and (max-width: 359px) {

    .ala-si-stock-indicator .ala-si-stock-label,
    .ala-si-stock-indicator .ala-si-stock-count,
    .ala-si-stock-indicator .ala-si-purchase-text {
        font-size: 13px;
    }

    .ala-si-stock-indicator .ala-si-stock-header {
        gap: 6px;
    }

    .ala-si-stock-indicator .ala-si-stock-message {
        font-size: 12px;
    }

    .ala-si-stock-indicator .ala-si-recent-purchases {
        gap: 7px;
    }

    .ala-si-stock-indicator .ala-si-customers-icon {
        flex-basis: 18px;
        width: 18px;
        height: 18px;
    }

    .ala-si-stock-indicator .ala-si-customers-icon svg {
        width: 18px;
        height: 16px;
    }
}
