/**
 * Back In Stock Notifications - Frontend Styles
 * Styled to match Storefront Child Theme
 */

/* Hide WooCommerce default out-of-stock message when form is present */
.ctg-bisn-form-wrapper ~ .stock.out-of-stock,
.stock.out-of-stock:has(~ .ctg-bisn-form-wrapper),
.ctg-bisn-form-wrapper + .stock.out-of-stock,
.summary .stock.out-of-stock {
    display: none !important;
}

/* Variables matching theme */
:root {
    --bisn-primary: #0072bc;
    --bisn-secondary: #2c2d33;
    --bisn-text: #43454b;
    --bisn-text-light: #767676;
    --bisn-background: #ffffff;
    --bisn-border: #e2e2e2;
    --bisn-success: #0f834d;
    --bisn-error: #e2401c;
    --bisn-info: #3d9cd2;
    --bisn-radius: 4px;
    --bisn-radius-lg: 8px;
    --bisn-transition: all 0.3s ease;
}

.ctg-bisn-form-wrapper {
    background: var(--bisn-background);
    border: 1px solid var(--bisn-border);
    border-radius: var(--bisn-radius-lg);
    padding: 24px;
    margin: 20px 0;
    transition: var(--bisn-transition);
}

.ctg-bisn-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.ctg-bisn-icon {
    display: flex;
    align-items: center;
    line-height: 1;
}

.ctg-bisn-bell-icon {
    width: 23px;
    height: 23px;
    filter: brightness(0) saturate(100%);
    opacity: 0.7;
}

.ctg-bisn-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--bisn-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ctg-bisn-description {
    color: var(--bisn-text-light);
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.ctg-bisn-form {
    margin: 0;
}

.ctg-bisn-input-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ctg-bisn-email {
    flex: 1;
    min-width: 200px;
    padding: 8px 16px;
    font-size: 16px;
    border: 1px solid var(--bisn-border);
    border-radius: var(--bisn-radius);
    transition: var(--bisn-transition);
    background: var(--bisn-background);
    color: var(--bisn-text);
    font-family: inherit;
}

.ctg-bisn-email:focus {
    outline: none;
    border-color: var(--bisn-primary);
    box-shadow: 0 0 0 2px rgba(0, 114, 188, 0.2);
}

.ctg-bisn-email::placeholder {
    color: var(--bisn-text-light);
}

.ctg-bisn-submit {
    display: inline-block;
    padding: 8px 24px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    background-color: var(--bisn-primary) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--bisn-radius) !important;
    cursor: pointer;
    transition: var(--bisn-transition) !important;
    white-space: nowrap;
    text-align: center;
    text-decoration: none;
}

.ctg-bisn-submit:hover {
    background-color: #005a94 !important;
    color: #fff !important;
}

.ctg-bisn-submit:focus {
    outline: 2px solid var(--bisn-primary);
    outline-offset: 2px;
}

.ctg-bisn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.ctg-bisn-submit.loading {
    position: relative;
    color: transparent !important;
}

.ctg-bisn-submit.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ctg-bisn-spin 0.8s linear infinite;
}

@keyframes ctg-bisn-spin {
    to {
        transform: rotate(360deg);
    }
}

.ctg-bisn-message {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--bisn-radius);
    font-size: 14px;
    line-height: 1.6;
}

.ctg-bisn-message.success {
    background-color: rgba(15, 131, 77, 0.1);
    border: 1px solid var(--bisn-success);
    color: var(--bisn-success);
}

.ctg-bisn-message.error {
    background-color: rgba(226, 64, 28, 0.1);
    border: 1px solid var(--bisn-error);
    color: var(--bisn-error);
}

.ctg-bisn-message.info {
    background-color: rgba(61, 156, 210, 0.1);
    border: 1px solid var(--bisn-info);
    color: var(--bisn-info);
}

/* Variable product container */
.ctg-bisn-variation-container {
    margin-top: 16px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .ctg-bisn-form-wrapper {
        padding: 16px;
    }
    
    .ctg-bisn-input-group {
        flex-direction: column;
    }
    
    .ctg-bisn-email,
    .ctg-bisn-submit {
        width: 100%;
    }
}
