/* Foundation - Stock Notifications (frontend form)
 *
 * Deliberately low-specificity and mostly layout-only: the form sits inside
 * whatever the theme's product summary looks like, so colours come from the
 * theme's own button/input styles wherever possible.
 */

.foundation-stock-notify {
    margin: 15px 0;
}

/* Variable products render the form up front and reveal it when the picker
 * lands on an unavailable variation. Kept as a class rather than an inline
 * style so a theme can animate or re-style the transition. */
.foundation-stock-notify.is-hidden {
    display: none;
}

.foundation-stock-notify-title {
    margin: 0 0 8px;
    font-size: 16px;
    line-height: 1.3;
}

/* The field label.
 *
 * It used to carry only WordPress's `screen-reader-text` class and trust the
 * theme to hide it. Plenty of themes never define that class — Spy Equipment
 * UK doesn't — and on those the words "Your email address" simply appeared
 * above the input as stray text. The module hides its own label now rather
 * than depending on the theme, and the label always stays in the markup
 * because a placeholder is not an accessible label. */
.foundation-stock-notify-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Opt back in to a visible label (Config > Form wording). */
.foundation-stock-notify-label.is-visible {
    position: static;
    width: auto;
    height: auto;
    margin: 0 0 6px;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    display: block;
}

.foundation-stock-notify-fields {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: stretch;
}

.foundation-stock-notify-fields input[type="email"] {
    flex: 1 1 200px;
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 15px;
    line-height: 1.4;
}

.foundation-stock-notify-fields button {
    flex: 0 0 auto;
    cursor: pointer;
}

.foundation-stock-notify-fields button[disabled] {
    opacity: .6;
    cursor: default;
}

/* Honeypot - hidden from people, still fillable by bots. Kept out of the flow
 * without display:none, which some bots skip. */
.foundation-stock-notify-hp {
    position: absolute !important;
    left: -9999px !important;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.foundation-stock-notify-count {
    margin: 8px 0 0;
    font-size: 13px;
    opacity: .75;
}

.foundation-stock-notify-message {
    margin-top: 10px;
    font-size: 14px;
    line-height: 1.4;
}

.foundation-stock-notify-message:empty {
    margin-top: 0;
}

.foundation-stock-notify-message.is-success {
    color: #2e7d32;
}

.foundation-stock-notify-message.is-error {
    color: #c62828;
}

.foundation-stock-notify-error {
    margin: 15px 0;
    padding: 10px 12px;
    border-left: 4px solid #d54e21;
    background: #fff6f5;
    font-size: 14px;
}

@media (max-width: 480px) {
    .foundation-stock-notify-fields {
        flex-direction: column;
    }

    .foundation-stock-notify-fields button {
        width: 100%;
    }
}
