/**
 * ATP Sector Manager — Stylesheet
 * Covers vendor registration, profile, and product form sector UI.
 */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.atp-sector-wrap,
.atp-sector-profile-wrap {
    width: 100%;
    margin-top: 12px;
    margin-bottom: 12px;
}

/* ── Notices ─────────────────────────────────────────────────────────────── */
.atp-sector-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.atp-sector-notice.notice-info {
    background: #e8f4fd;
    border-left: 4px solid #2196f3;
    color: #1a5276;
}

.atp-sector-notice.notice-warning {
    background: #fff8e1;
    border-left: 4px solid #ffc107;
    color: #7d5a00;
}

.atp-sector-notice .dashicons {
    margin-top: 1px;
    flex-shrink: 0;
}

/* ── Locked input ────────────────────────────────────────────────────────── */
.atp-locked-input,
input.atp-locked-input[type="text"] {
    background-color: #f7f7f7 !important;
    color: #555 !important;
    border-color: #ddd !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

.atp-sector-locked-badge {
    display: inline-block;
    font-size: 0.9em;
    margin-left: 5px;
    cursor: help;
    opacity: 0.75;
    vertical-align: middle;
}

/* ── Error state ─────────────────────────────────────────────────────────── */
.atp-field-error {
    border-color: #e2401c !important;
    box-shadow: 0 0 0 2px rgba(226, 64, 28, 0.15) !important;
}

.wcfm_error_tip {
    display: none;
    color: #e2401c;
    font-size: 12px;
    margin-top: 4px;
}

/* ── Product sector section ──────────────────────────────────────────────── */
#atp_product_sector_wrap {
    margin-top: 20px;
    margin-bottom: 20px;
}

#atp_product_sector_wrap .page_collapsible {
    cursor: default;
}

/* ── Select styling ──────────────────────────────────────────────────────── */
.atp-main-sector-select,
.atp-sub-sector-select {
    width: 100%;
    max-width: 400px;
}

/* ── Admin: user profile table ───────────────────────────────────────────── */
#atp-admin-sector-table .regular-text {
    width: 300px;
}

/* ── Hide default WCFM category tree (CSS fallback for selectors not
      caught by JS MutationObserver) ──────────────────────────────────────── */

/* Applied when our product wrap exists on page */
body:has(#atp_product_sector_wrap) .wcfm_product_simple_categories,
body:has(#atp_product_sector_wrap) .product_cat_checklist,
body:has(#atp_product_sector_wrap) #product_category_block,
body:has(#atp_product_sector_wrap) .wcfm-product-categories,
body:has(#atp_product_sector_wrap) .wcfm_product_categories_block {
    display: none !important;
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .atp-main-sector-select,
    .atp-sub-sector-select {
        max-width: 100%;
    }

    .atp-sector-wrap .wcfm_half_ele {
        width: 100% !important;
    }
}
