/* Product Page Fields */
#fam-product-fields {
    margin: 16px 0;
    clear: both;
    width: 100%;
    flex: 0 0 100%;
    order: 99;
}
/* Break out of WooCommerce flex row */
.woocommerce-variation-add-to-cart {
    flex-wrap: wrap !important;
}
.fam-product-fields-inner {
    background: var(--al-bg-secondary, #fff);
    border: 2px solid var(--al-primary, #2271b1);
    border-radius: 10px;
    padding: 20px;
}
.fam-fields-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--al-bg-quaternary, #eee);
    color: var(--al-text-primary, #1d2327);
}
.fam-fields-group-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--al-primary, #2271b1);
    margin: 16px 0 8px;
    padding: 8px 12px;
    background: var(--al-bg-tertiary, #f0f6fc);
    border-radius: 6px;
}
.fam-fields-group-label:first-of-type {
    margin-top: 0;
}
.fam-pf-field {
    margin-bottom: 14px;
}
.fam-pf-field:last-child {
    margin-bottom: 0;
}
.fam-pf-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--al-text-primary, #1d2327);
}
.fam-req {
    color: #d63638;
    font-weight: 700;
}
.fam-pf-field input[type="text"],
.fam-pf-field input[type="email"],
.fam-pf-field input[type="password"],
.fam-pf-field select,
.fam-pf-field textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--al-bg-quaternary, #c3c4c7);
    border-radius: 6px;
    font-size: 14px;
    color: var(--al-text-primary, #1d2327);
    background: var(--al-bg-tertiary, #f6f7f7);
    box-sizing: border-box;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.fam-pf-field input:focus,
.fam-pf-field select:focus,
.fam-pf-field textarea:focus {
    outline: none;
    border-color: var(--al-primary, #2271b1);
    background: var(--al-bg-secondary, #fff);
    box-shadow: 0 0 0 2px rgba(14,165,233,0.2);
}
.fam-pf-field textarea {
    min-height: 80px;
    resize: vertical;
}
.fam-pf-field select {
    cursor: pointer;
}
.fam-pf-error {
    border-color: #d63638 !important;
    background: #fcf0f1 !important;
    box-shadow: 0 0 0 2px rgba(214,54,56,0.2) !important;
}
/* Instructions block — uses theme variables for dark/light mode compat */
#fam-product-fields .fam-pf-instructions {
    padding: 12px 16px;
    background: var(--al-bg-tertiary, #f1f5f9);
    border-left: 4px solid var(--al-primary, #2271b1);
    border-radius: 0 6px 6px 0;
    margin-bottom: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--al-text-primary, #1d2327);
    opacity: 1;
}
#fam-product-fields .fam-pf-instructions h1,
#fam-product-fields .fam-pf-instructions h2,
#fam-product-fields .fam-pf-instructions h3 {
    margin: 8px 0 4px;
    font-size: 15px;
    color: var(--al-text-primary, #1d2327);
}
#fam-product-fields .fam-pf-instructions p,
#fam-product-fields .fam-pf-instructions li,
#fam-product-fields .fam-pf-instructions span {
    color: var(--al-text-primary, #1d2327);
    opacity: 1;
}
#fam-product-fields .fam-pf-instructions p { margin: 6px 0; }
#fam-product-fields .fam-pf-instructions ul,
#fam-product-fields .fam-pf-instructions ol {
    margin: 6px 0 6px 20px;
}
#fam-product-fields .fam-pf-instructions strong { color: var(--al-primary-dark, #0a4b78); }
#fam-product-fields .fam-pf-instructions a { color: var(--al-primary, #2271b1); text-decoration: underline; }

/* Button field */
.fam-pf-button {
    display: inline-block;
    padding: 10px 24px;
    background: #2271b1;
    color: #fff !important;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    text-align: center;
    transition: background 0.2s;
    cursor: pointer;
}
.fam-pf-button:hover {
    background: #135e96;
}

/* Existing cart entries */
.fam-existing-entries {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--al-bg-quaternary, #e2e6ea);
}
.fam-existing-header {
    font-size: 11px;
    font-weight: 600;
    color: var(--al-text-secondary, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.fam-existing-entry {
    padding: 12px 14px;
    background: var(--al-bg-tertiary, #f1f5f9);
    border: 1px solid var(--al-bg-quaternary, #e2e6ea);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}
.fam-existing-entry:last-child { margin-bottom: 0; }
.fam-existing-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.fam-existing-num {
    font-weight: 700;
    font-size: 13px;
    color: var(--al-text-primary, #1d2327);
}
.fam-existing-edit {
    background: transparent;
    border: 1px solid var(--al-bg-quaternary, #c3c4c7);
    border-radius: 4px;
    padding: 2px 10px;
    font-size: 12px;
    color: var(--al-primary, #2271b1);
    cursor: pointer;
    font-family: inherit;
}
.fam-existing-edit:hover {
    background: var(--al-bg-quaternary, #e2e6ea);
}
.fam-existing-field {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--al-bg-quaternary, #e9ecef);
}
.fam-existing-field:last-child { border-bottom: none; }
.fam-existing-label {
    color: var(--al-text-secondary, #6c757d);
    font-weight: 500;
    font-size: 12px;
}
.fam-existing-value {
    color: var(--al-text-primary, #1d2327);
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
}

/* Choice pills */
.fam-choice-pills {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.fam-choice-pill {
    padding: 8px 18px;
    border: 2px solid var(--al-bg-quaternary, #dee2e6);
    border-radius: 20px;
    background: var(--al-bg-tertiary, #f6f7f7);
    color: var(--al-text-primary, #1d2327);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}
.fam-choice-pill:hover {
    border-color: var(--al-primary, #2271b1);
    background: var(--al-bg-secondary, #fff);
}
.fam-choice-pill.fam-choice-selected {
    border-color: var(--al-primary, #2271b1);
    background: var(--al-primary, #2271b1);
    color: #fff;
}

.fam-pf-hint {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}
.fam-pf-hint strong { color: #2271b1; }
.fam-pf-error-msg {
    background: #fcf0f1;
    color: #d63638;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 14px;
    border: 1px solid #f0c0c0;
}
