/**
 * FEF eCommerce Widgets — shared styles
 * Powers: fef_check_availability + fef_delivery_estimator
 */

/* ===================== CHECK AVAILABILITY ===================== */
.fef-ca-wrap{
    box-sizing:border-box;
    background:#f8fafc;
    border-radius:12px;
    padding:20px
}
.fef-ca-heading{font-size:16px;font-weight:600;margin-bottom:4px;color:#1e293b}
.fef-ca-sub{font-size:13px;color:#64748b;margin-bottom:12px}

.fef-ca-row{display:flex;gap:8px;align-items:stretch}
.fef-ca-input{
    flex:1;min-width:0;
    padding:10px 12px;
    border:1px solid #e2e8f0;
    border-radius:8px;
    font-size:14px;
    background:#fff;
    color:#1e293b;
    outline:none;
    transition:border-color 0.15s ease,box-shadow 0.15s ease
}
.fef-ca-input:focus{border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,0.1)}

.fef-ca-btn{
    display:inline-flex;align-items:center;justify-content:center;gap:6px;
    padding:10px 18px;
    background:#1e293b;color:#fff;
    border:none;border-radius:8px;
    font-size:14px;font-weight:600;
    cursor:pointer;
    transition:background-color 0.15s ease,transform 0.1s ease
}
.fef-ca-btn:hover{background:#334155}
.fef-ca-btn:active{transform:scale(0.98)}
.fef-ca-btn:disabled{opacity:0.6;cursor:not-allowed}
.fef-ca-btn .fa-spinner{animation:fef-ca-spin 0.8s linear infinite}

.fef-ca-result{
    margin-top:10px;
    padding:10px 12px;
    border-radius:8px;
    font-size:13px;
    line-height:1.5;
    display:flex;align-items:flex-start;gap:8px
}
.fef-ca-result-ok{background:#dcfce7;color:#166534}
.fef-ca-result-fail{background:#fee2e2;color:#991b1b}
.fef-ca-result i{flex-shrink:0;margin-top:2px}
.fef-ca-result-eta{font-weight:600;margin-top:2px;display:block}

@keyframes fef-ca-spin{to{transform:rotate(360deg)}}

/* ===================== DELIVERY ESTIMATOR ===================== */
.fef-de-wrap{
    box-sizing:border-box;
    display:flex;flex-direction:column;gap:10px
}
.fef-de-result{display:flex;flex-direction:column;gap:2px}
.fef-de-prefix{
    display:inline-flex;align-items:center;gap:6px;
    font-size:13px;color:#64748b
}
.fef-de-value{
    font-size:15px;font-weight:600;color:#1e293b;
    display:inline-flex;align-items:center;gap:6px
}
.fef-de-value.fef-de-loading{color:#94a3b8;font-weight:400}
.fef-de-value.fef-de-loading::before{
    content:"";display:inline-block;
    width:12px;height:12px;
    border:2px solid #e2e8f0;border-top-color:#64748b;
    border-radius:50%;
    animation:fef-ca-spin 0.8s linear infinite
}
.fef-de-note{font-size:12px;color:#94a3b8;margin-top:2px}
.fef-de-change{
    display:inline-block;margin-top:6px;
    font-size:12px;color:#3b82f6;text-decoration:none
}
.fef-de-change:hover{text-decoration:underline}

.fef-de-manual{margin-top:8px}
.fef-de-manual-fields{
    display:flex;gap:6px;flex-wrap:wrap;margin-bottom:6px
}
.fef-de-field{
    flex:1;min-width:120px;
    padding:8px 10px;
    border:1px solid #e2e8f0;
    border-radius:6px;
    font-size:13px;
    background:#fff;color:#1e293b;
    outline:none;
    transition:border-color 0.15s ease
}
.fef-de-field:focus{border-color:#3b82f6}
.fef-de-btn{
    padding:8px 14px;
    background:#1e293b;color:#fff;
    border:none;border-radius:6px;
    font-size:13px;font-weight:600;
    cursor:pointer;
    transition:background-color 0.15s ease
}
.fef-de-btn:hover{background:#334155}

/* ===================== ADD TO CART WIDGET ===================== */
.fef-atc-wrap{
    display:flex;flex-direction:column;gap:12px;
    box-sizing:border-box
}

/* Price */
.fef-atc-price{
    font-size:22px;font-weight:700;color:#1e293b;
    line-height:1.2
}
.fef-atc-price ins{background:none;text-decoration:none;color:#dc2626}
.fef-atc-price del{color:#94a3b8;margin-right:8px;font-weight:500}

/* Stock badges */
.fef-atc-stock{
    display:inline-block;font-size:12px;font-weight:600;
    padding:4px 10px;border-radius:12px;width:fit-content
}
.fef-atc-stock-out{background:#fee2e2;color:#991b1b}
.fef-atc-stock-back{background:#fef3c7;color:#92400e}
.fef-atc-stock-pre{background:#dbeafe;color:#1e40af}

/* Quantity selector */
.fef-atc-qty{
    display:inline-flex;align-items:stretch;
    background:#f8fafc;border:1px solid #e2e8f0;
    border-radius:8px;overflow:hidden;
    width:fit-content
}
.fef-atc-qty-btn{
    background:transparent;border:none;
    width:36px;font-size:16px;font-weight:600;
    color:#1e293b;cursor:pointer;
    display:flex;align-items:center;justify-content:center
}
.fef-atc-qty-btn:hover{background:#e2e8f0}
.fef-atc-qty-input{
    width:48px;text-align:center;
    background:transparent;border:none;
    font-size:14px;font-weight:600;color:#1e293b;
    outline:none;
    -moz-appearance:textfield
}
.fef-atc-qty-input::-webkit-outer-spin-button,
.fef-atc-qty-input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}

/* Button group layouts */
.fef-atc-buttons{display:flex;gap:8px;flex-wrap:wrap}
.fef-atc-layout-stacked .fef-atc-buttons{flex-direction:column}
.fef-atc-layout-stacked .fef-atc-btn{width:100%}
.fef-atc-layout-inline  .fef-atc-buttons{flex-direction:row}
.fef-atc-layout-inline  .fef-atc-btn{flex:1;min-width:140px}
.fef-atc-layout-grid    .fef-atc-buttons{display:grid;grid-template-columns:repeat(auto-fit,minmax(140px,1fr))}

/* Buttons */
.fef-atc-btn{
    display:inline-flex;align-items:center;justify-content:center;gap:8px;
    padding:12px 20px;
    border:none;border-radius:8px;
    font-size:14px;font-weight:600;
    cursor:pointer;
    transition:background-color 0.15s ease,transform 0.1s ease,box-shadow 0.15s ease;
    text-decoration:none
}
.fef-atc-btn:hover{transform:translateY(-1px)}
.fef-atc-btn:active{transform:translateY(0)}
.fef-atc-btn:disabled{opacity:0.6;cursor:not-allowed;transform:none}
.fef-atc-btn .fa-spinner{animation:fef-ca-spin 0.8s linear infinite}

.fef-atc-btn-add{background:#1e293b;color:#fff}
.fef-atc-btn-add:hover{background:#334155}
.fef-atc-btn-buy{background:#dc2626;color:#fff}
.fef-atc-btn-buy:hover{background:#b91c1c}
.fef-atc-btn-enq{background:#3b82f6;color:#fff}
.fef-atc-btn-enq:hover{background:#2563eb}
.fef-atc-btn-rem{background:#f59e0b;color:#fff}
.fef-atc-btn-rem:hover{background:#d97706}
.fef-atc-btn-pre{background:#0ea5e9;color:#fff}
.fef-atc-btn-pre:hover{background:#0284c7}

/* Pre-order note */
.fef-atc-pre-note{
    font-size:12px;color:#64748b;line-height:1.4;
    padding:8px 12px;background:#f0f9ff;border-radius:6px
}

/* Remind Me form */
.fef-atc-rem-form{
    display:flex;flex-direction:column;gap:8px;
    padding:12px;background:#fffbeb;border:1px solid #fde68a;border-radius:8px
}
.fef-atc-rem-heading{font-size:13px;font-weight:600;color:#92400e}
.fef-atc-rem-form input{
    padding:9px 12px;
    border:1px solid #fcd34d;border-radius:6px;
    font-size:14px;background:#fff;
    outline:none;
    transition:border-color 0.15s ease
}
.fef-atc-rem-form input:focus{border-color:#f59e0b}
.fef-atc-btn-rem-submit{background:#f59e0b;color:#fff;padding:10px 16px}
.fef-atc-btn-rem-submit:hover{background:#d97706}

/* Message (post-action) */
.fef-atc-message{
    padding:10px 12px;border-radius:8px;
    font-size:13px;line-height:1.4
}
.fef-atc-msg-ok{background:#dcfce7;color:#166534}
.fef-atc-msg-fail{background:#fee2e2;color:#991b1b}