/**
 * AIEO Waitlist — front-end form for "Notify me when back in stock".
 * Visual mirror of om-ppe-wait-list so the shopper experience stays
 * identical when the admin flips AIEO's frontend toggle on.
 */
.aieo-waitlist-container {
    position: relative;
    margin: 20px 0;
    padding: 20px;
    background-color: var(--aieo-wl-bg, #f8f9fa);
    border: var(--aieo-wl-border-w, 1px) solid var(--aieo-wl-border, #e9ecef);
    border-radius: var(--aieo-wl-border-r, 8px);
    opacity: 1 !important;
}

.aieo-waitlist-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    z-index: 10;
}
.aieo-waitlist-overlay.is-loading { display: flex !important; }

.aieo-waitlist-loader svg {
    width: 40px;
    height: 40px;
    color: #0073aa;
    animation: aieo-waitlist-spin 1s linear infinite;
}
@keyframes aieo-waitlist-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.aieo-waitlist-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 1 !important;
}

.aieo-waitlist-title {
    margin: 0 0 5px 0 !important;
    font-size: var(--aieo-wl-title-size, 16px) !important;
    font-weight: 600 !important;
    color: #333 !important;
    line-height: 1.4 !important;
    opacity: 1 !important;
}

.aieo-waitlist-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.aieo-waitlist-field label {
    font-size: var(--aieo-wl-text-size, 14px) !important;
    font-weight: 500 !important;
    color: #555 !important;
    opacity: 1 !important;
}
.aieo-waitlist-field label .required { color: #e74c3c; font-weight: 700; }

.aieo-waitlist-field input[type="email"] {
    width: 100%;
    padding: 12px 15px;
    font-size: var(--aieo-wl-text-size, 14px);
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}
.aieo-waitlist-field input[type="email"]:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}
.aieo-waitlist-field input[type="email"]::placeholder { color: #999; }

.aieo-waitlist-submit {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 25px !important;
    font-size: var(--aieo-wl-text-size, 14px) !important;
    font-weight: 600 !important;
    color: var(--aieo-wl-btn-text, #ffffff) !important;
    background-color: var(--aieo-wl-btn-bg, #0073aa) !important;
    border: var(--aieo-wl-btn-border-w, 0) solid var(--aieo-wl-btn-border, #0073aa) !important;
    border-radius: var(--aieo-wl-btn-border-r, 4px) !important;
    cursor: pointer !important;
    transition: background-color 0.3s ease, transform 0.2s ease, filter 0.2s ease;
    align-self: flex-start;
    opacity: 1 !important;
}
.aieo-waitlist-submit:hover  { filter: brightness(0.92); transform: translateY(-1px); }
.aieo-waitlist-submit:active { transform: translateY(0); }
.aieo-waitlist-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.aieo-waitlist-message {
    display: none;
    margin-top: 10px;
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
}
.aieo-waitlist-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}
.aieo-waitlist-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* Variable products — show/hide based on the picked variation's stock state. */
.product-type-variable .aieo-waitlist-container { display: none; }
.product-type-variable .aieo-waitlist-container.show { display: block; }

@media (max-width: 768px) {
    .aieo-waitlist-container { padding: 15px; }
    .aieo-waitlist-submit { width: 100%; justify-content: center; }
}
