/* ============================================================
   JR Forms – Frontend Styles
   ============================================================ */

/* Honeypot: visually hidden but not display:none (bots still fill it) */
.jrforms-hp-wrap {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
    height: 0;
    overflow: hidden;
}

.jrforms-form-wrap {
    max-width: 640px;
}

.jrforms-form-description {
    color: #555;
    margin-bottom: 20px;
}

/* ---- Field wrapper ---- */
.jrforms-field-wrap {
    margin-bottom: 20px;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.jrforms-field-wrap.jrforms-hidden {
    display: none;
}

/* ---- Labels ---- */
.jrforms-label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
    color: #333;
}

.jrforms-required {
    color: #d63638;
    margin-left: 2px;
}

/* ---- File input ---- */
.jrforms-file-input {
    padding: 6px 10px;
    cursor: pointer;
    background: #fafafa;
}

.jrforms-file-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* ---- Date input ---- */
.jrforms-input[type="date"] {
    cursor: pointer;
}

/* ---- Field notes ---- */
.jrforms-field-notes {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

/* ---- Inputs ---- */
.jrforms-input {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.15s ease;
}

.jrforms-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.2);
}

.jrforms-input.jrforms-error {
    border-color: #d63638;
}

/* ---- Options (radio / checkbox) ---- */
.jrforms-radio-group,
.jrforms-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jrforms-option-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
}

/* Explicitly visible — overrides theme resets that hide native inputs */
.jrforms-option-label input[type="checkbox"],
.jrforms-option-label input[type="radio"] {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    width: auto;
    height: auto;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

/* ---- Multiselect ---- */
.jrforms-multiselect {
    min-height: 120px;
}

/* ---- Error messages ---- */
.jrforms-error-msg {
    display: block;
    color: #d63638;
    font-size: 12px;
    margin-top: 4px;
    min-height: 16px;
}

/* ---- Submit button ---- */
.jrforms-submit-wrap {
    margin-top: 24px;
}

.jrforms-submit-btn {
    display: inline-block;
    padding: 10px 24px;
    background-color: #2271b1;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.jrforms-submit-btn:hover {
    background-color: #135e96;
}

.jrforms-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Response messages ---- */
.jrforms-response-msg {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
}

.jrforms-response-msg.jrforms-success {
    background: #edfaef;
    border: 1px solid #68de7c;
    color: #1d5e29;
}

.jrforms-response-msg.jrforms-error {
    background: #fce9ea;
    border: 1px solid #f9a8a8;
    color: #7a1414;
}

/* ---- Products field ---- */
.jrforms-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 12px;
}

.jrforms-product-card {
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    transition: border-color 0.15s ease;
    display: flex;
    flex-direction: column;
}

.jrforms-product-card:has(.jrforms-product-checkbox:checked) {
    border-color: #2271b1;
}

.jrforms-product-img-wrap {
    background: #f6f7f7;
    text-align: center;
    padding: 8px;
}

.jrforms-product-img {
    max-width: 100%;
    height: 120px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

.jrforms-product-info {
    padding: 10px 12px;
    flex: 1;
}

.jrforms-product-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
}

.jrforms-product-desc {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
    line-height: 1.4;
}

.jrforms-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #2271b1;
}

.jrforms-product-footer {
    padding: 8px 12px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.jrforms-product-select-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.jrforms-product-select-label input[type="checkbox"] {
    display: inline-block;
    visibility: visible;
    opacity: 1;
    width: auto;
    height: auto;
    margin: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.jrforms-product-qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.jrforms-product-qty {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
}

.jrforms-products-total {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-align: right;
    padding: 8px 0;
    border-top: 1px solid #e5e5e5;
}

.jrforms-products-error {
    border: 1px solid #d63638;
    border-radius: 4px;
    padding: 8px;
}

/* ---- File upload input ---- */
.jrforms-file-input {
    display: block;
    width: 100%;
    padding: 8px 0;
    font-size: 14px;
    color: #333;
    box-sizing: border-box;
    cursor: pointer;
}

.jrforms-file-hint {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

/* ---- Products ---- */
.jrforms-products-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 8px;
}

.jrforms-product-card {
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    width: 180px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.2s;
    background: #fff;
}

.jrforms-product-card:has(.jrforms-product-checkbox:checked) {
    border-color: #0073aa;
}

.jrforms-product-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
}

.jrforms-product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.jrforms-product-name {
    font-size: 14px;
}

.jrforms-product-desc {
    font-size: 12px;
    color: #666;
}

.jrforms-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #0073aa;
}

.jrforms-product-select-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    margin-top: auto;
}

.jrforms-product-qty-wrap {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.jrforms-product-qty-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
}

.jrforms-product-qty {
    width: 60px;
    padding: 4px 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 13px;
}

.jrforms-product-subtotal {
    font-size: 12px;
    color: #444;
}

.jrforms-product-subtotal-value {
    color: #0073aa;
}

.jrforms-products-total {
    width: 100%;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid #ccc;
    font-size: 15px;
    font-weight: 600;
    text-align: right;
}

.jrforms-products-total-value {
    color: #0073aa;
}
