/* Popup container */
.hd_popup {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 10px;
    margin-right: 10px;
}

#toplevel_page_pl-paythem-menu ul li a[href="admin.php?page=pl-paythem-stock-export"],
#toplevel_page_pl-paythem-menu ul li a[href="admin.php?page=pl-paythem-report-export"] {
    display: none;
}

/* The actual popup (appears on top) */
.hd_popup .hd_popuptext {
    visibility: hidden;
    width: 160px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 100%;
    left: -25%;
    margin-left: -80px;
    font-size: 0.7em;
    line-height: 1.3em;
}

/* Popup arrow */
.hd_popup .hd_popuptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

/* Toggle this class when clicking on the popup container (hide and show the popup) */
.hd_popup .show {
    visibility: visible;
    -webkit-animation: fadeIn 2s;
    animation: fadeIn 2s
}

/* Add animation (fade in the popup) */
@-webkit-keyframes fadeIn {
    from {opacity: 0;} 
    to {opacity: 1;}
}

@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity:1 ;}
}

.hd_popup {
    padding-top: 8px;
}

.hd_popup .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	color: #666;
}

/* Legacy height/offset hacks removed — they misaligned Local Stock and other toolbars.
   Per-screen toolbars use .pl-wcpt-catalog-* / .pl-wcpt-stock-toolbar instead. */

/* Catalog Products: Linked status = success (vs Map now action link) */
.toplevel_page_pl-paythem-menu .pl-wcpt-mapped-linked {
	color: #00a32a;
	font-weight: 600;
}

.toplevel_page_pl-paythem-menu a.pl-wcpt-mapped-linked:hover,
.toplevel_page_pl-paythem-menu a.pl-wcpt-mapped-linked:focus {
	color: #007017;
}

/* Catalog Products tab: align search/filter with bulk actions */
.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	height: auto;
	min-height: 30px;
	margin: 8px 0 16px;
	padding-top: 0;
	padding-bottom: 4px;
}

.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .bulkactions,
.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .pl-wcpt-catalog-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 16px;
	float: none;
	margin: 0;
	padding: 0;
}

.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .pl-wcpt-catalog-filter-group,
.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .pl-wcpt-catalog-per-page-group {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
}

.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .pl-wcpt-catalog-search,
.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .pl-wcpt-catalog-per-page,
.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top #doFilter,
.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .bulkactions select,
.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .bulkactions .button {
	height: 30px;
	margin: 0;
	position: static;
	top: auto;
	vertical-align: middle;
	box-sizing: border-box;
}

.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top .tablenav-pages {
	margin-left: auto;
	float: none;
}

.toplevel_page_pl-paythem-menu #it-rooster-list-warehouses-filter .tablenav.top br.clear {
	display: none;
}

/* Local Stock toolbar — no toplevel_page_* prefix (submenu uses paythem_page_*) */
.pl-wcpt-stock-tablenav {
	height: auto !important;
	margin: 8px 0 12px;
	padding: 0;
}

.pl-wcpt-stock-toolbar {
	display: flex !important;
	flex-wrap: nowrap;
	align-items: center;
	column-gap: 24px;
	row-gap: 10px;
	overflow-x: auto;
}

.pl-wcpt-stock-toolbar__group {
	display: flex !important;
	flex-wrap: nowrap;
	align-items: center;
	flex-shrink: 0;
	gap: 8px;
}

.pl-wcpt-stock-toolbar__pages {
	margin-left: auto;
	display: flex;
	align-items: center;
	flex-shrink: 0;
}

.pl-wcpt-stock-toolbar__pages .tablenav-pages {
	float: none;
	margin: 0;
	height: auto;
}

.pl-wcpt-stock-toolbar select,
.pl-wcpt-stock-toolbar input[type="text"],
.pl-wcpt-stock-toolbar .button,
.pl-wcpt-stock-toolbar input.button,
.pl-wcpt-stock-toolbar input[type="submit"] {
	float: none !important;
	margin: 0 !important;
	position: static !important;
	top: auto !important;
	box-sizing: border-box !important;
	height: 30px !important;
	min-height: 30px !important;
	max-height: 30px !important;
	font-size: 13px !important;
	line-height: 28px !important;
	border-radius: 3px;
	vertical-align: middle;
}

.pl-wcpt-stock-toolbar .button,
.pl-wcpt-stock-toolbar input.button,
.pl-wcpt-stock-toolbar input[type="submit"] {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 0 12px !important;
	line-height: 1 !important;
}

.pl-wcpt-stock-toolbar select {
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	appearance: none !important;
	padding: 0 28px 0 8px !important;
	border: 1px solid #8c8f94 !important;
	background-color: #fff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: right 8px center !important;
	background-size: 12px 8px !important;
	color: #2c3338 !important;
}

.pl-wcpt-stock-toolbar input[type="text"].pl-wcpt-stock-search {
	width: 160px;
	padding: 0 8px !important;
	border: 1px solid #8c8f94 !important;
	background: #fff !important;
	color: #2c3338 !important;
	line-height: normal !important;
}

@media screen and (max-width: 782px) {
	.pl-wcpt-stock-toolbar {
		flex-wrap: wrap;
		column-gap: 12px;
	}

	.pl-wcpt-stock-toolbar__pages {
		margin-left: 0;
		width: 100%;
	}
}

/* Catalog numeric columns: right-align headers + cells */
.wp-list-table.wp_list_pl_products th.column-product_id,
.wp-list-table.wp_list_pl_products td.column-product_id,
.wp-list-table.wp_list_pl_products th.column-sell_price,
.wp-list-table.wp_list_pl_products td.column-sell_price,
.wp-list-table.wp_list_pl_products th.column-store_sell_price,
.wp-list-table.wp_list_pl_products td.column-store_sell_price,
.wp-list-table.wp_list_pl_products th.column-selling_price,
.wp-list-table.wp_list_pl_products td.column-selling_price,
.wp-list-table.wp_list_pl_products th.column-stock,
.wp-list-table.wp_list_pl_products td.column-stock,
.wp-list-table.wp_list_pl_products th.column-pt_stock,
.wp-list-table.wp_list_pl_products td.column-pt_stock,
.wp-list-table.wp_list_pl_products td.pl_align_right {
	text-align: right !important;
}

/* Keep all catalog headers on the same vertical baseline */
.wp-list-table.wp_list_pl_products thead td,
.wp-list-table.wp_list_pl_products thead th {
	vertical-align: middle;
	line-height: 1.4;
}

.wp-list-table.wp_list_pl_products thead th.sortable a,
.wp-list-table.wp_list_pl_products thead th.sorted a {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 8px 10px;
	box-sizing: border-box;
	float: none;
}

.wp-list-table.wp_list_pl_products thead th.column-product_id.sortable a,
.wp-list-table.wp_list_pl_products thead th.column-product_id.sorted a,
.wp-list-table.wp_list_pl_products thead th.column-sell_price.sortable a,
.wp-list-table.wp_list_pl_products thead th.column-sell_price.sorted a,
.wp-list-table.wp_list_pl_products thead th.column-store_sell_price.sortable a,
.wp-list-table.wp_list_pl_products thead th.column-store_sell_price.sorted a,
.wp-list-table.wp_list_pl_products thead th.column-selling_price.sortable a,
.wp-list-table.wp_list_pl_products thead th.column-selling_price.sorted a,
.wp-list-table.wp_list_pl_products thead th.column-stock.sortable a,
.wp-list-table.wp_list_pl_products thead th.column-stock.sorted a {
	justify-content: flex-end;
	width: 100%;
}

.wp-list-table.wp_list_pl_products thead th.sortable .sorting-indicator,
.wp-list-table.wp_list_pl_products thead th.sorted .sorting-indicator {
	float: none;
	margin: 0;
	flex: 0 0 auto;
}

.wp_list_pl_products #cb-select-all-1,
.wp_list_pl_products #cb-select-all-2,
.wp_list_pl_import_products #cb-select-all-1,
.wp_list_pl_import_products #cb-select-all-2 {
	position: relative;
	top: 10px;
	left: 3px;
}

.pl_wcpt_settings_status_balance {
	border: 2px dashed #afafaf;
    padding: 10px;	
    margin: 10px 0px;
    width: 50%;
}

.pl_purchase_button {
	text-align: center;
}

.pl-wcpt-buy-local-stock .pl_purchase_button {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin: 12px 0 0;
}

.pl-wcpt-buy-local-stock .pl_purchase_button .pl-wcpt-purchase-aside {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 0;
	float: none;
}

@media only screen and (max-width: 960px) {
	.pl_wcpt_settings_status_balance {
		float: none;
	    position: inherit;
	}
}

.pl_align_right {
	text-align: right;
}

#_pt_redemption_instructions {
	height: 6em;
}

.pl-wcpt-hidden {
	display: none;
}

/* Keep label + readonly copy on the same 24px WC form-field rhythm (not the 40px input rule). */
.woocommerce_options_panel p._pt_default_redemption_instructions_field > label {
	line-height: 24px !important;
}

#_pt_default_redemption_instructions {
	display: block;
	line-height: 24px;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
}

.pl_wcp_discontinued_row {
	color: red;
}

.pl_wcpt_bulk_import_results {
	width: 80%;
	border-spacing: 20px;
}

.pl_wcpt_bulk_import_results tr {
	text-align: center;
}

.wp_list_pl_import_products th.column-category,
.wp_list_pl_import_products th.column-product_name,
.wp_list_pl_import_products th.column-sku {
	width: 12%;
}

.wp_list_pl_import_products th {
	width: 10%;
}

.wp_list_pl_import_products th.column-buy_now {
	width: 7%;
}

table.wp_list_pl_products th.column-sell_price span, table.wp_list_pl_products th.column-store_sell_price span, table.wp_list_pl_products th.column-auto_sell_price span, table.wp_list_pl_products th.column-selling_price span {
	/*float: right !important;*/
}

.pl_wcpt_bulk_import_results .pt_align_left {
	text-align: left;
}

.pl_wcpt_bulk_import_results .pt_align_right {
	text-align: right;
}

.pl-pt-promo-banner {
	width: 600px !important;
	height: auto;
	margin-top: 20px;
}

@media only screen and (max-width: 480px) {
	.pl-pt-promo-banner {
		width: 300px !important;
		height: auto;
	}
}

ul.pl-pt-pro-features li { 
   margin-bottom: 15px;  
}

/* Products list: Cost needs a hard width — .wp-list-table.fixed ignores min-width. */
body.post-type-product table.wp-list-table th.column-pl_wcpt_cost,
body.post-type-product table.wp-list-table td.column-pl_wcpt_cost {
	width: 150px !important;
	white-space: nowrap !important;
	word-break: normal !important;
	overflow-wrap: normal !important;
}

body.post-type-product th.column-pl_wcpt_cost .pl-wcpt-cost-tip {
	display: inline-block;
	margin: 0 0 0 4px;
	vertical-align: middle;
	float: none;
}

body.post-type-product .column-pl_wcpt_cost .pl-wcpt-cost-cell {
	display: inline-block;
	min-width: 140px;
	max-width: 100%;
	white-space: nowrap;
	word-break: normal;
	overflow-wrap: normal;
	vertical-align: top;
}

body.post-type-product .column-pl_wcpt_cost .pl-wcpt-cost-meta {
	display: block;
	margin-top: 4px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: #646970;
	font-size: 12px;
}

body.post-type-product table.wp-list-table .column-is_in_stock {
	width: 14%;
	min-width: 10em;
}

body.post-type-product th.column-is_in_stock .pl-wcpt-stock-tip {
	display: inline-block;
	margin: 0 0 0 4px;
	vertical-align: middle;
	float: none;
}

body.post-type-product .column-is_in_stock .pl-wcpt-stock-meta {
	display: inline-block;
	margin-top: 4px;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: #646970;
	font-size: 12px;
}

body.post-type-product .column-is_in_stock .pl-wcpt-stock-discontinued {
	color: #b32d2e;
	font-weight: 600;
}

body.post-type-product #tiptip_content {
	white-space: pre-line;
	text-align: left;
}

.pl-wcpt-buy-local-stock {
	font-size: 13px;
}

.pl-wcpt-buy-local-intro {
	margin-top: 0;
}

.woocommerce_options_panel .form-field.pl-wcpt-buy-carry-field .pl-wcpt-buy-carry-controls {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px 10px;
	vertical-align: middle;
	max-width: calc(100% - 12px);
}

.woocommerce_options_panel .form-field.pl-wcpt-buy-carry-field .pl-wcpt-buy-carry-qty {
	width: 5em;
	max-width: 5em;
	margin: 0;
}

.woocommerce_options_panel .form-field.pl-wcpt-buy-carry-field .pl-wcpt-buy-carry-summary {
	display: inline;
	margin: 0;
	padding: 0;
	color: #646970;
	line-height: 1.4;
	white-space: nowrap;
	vertical-align: middle;
}

/*
 * WC WP 7.0+ sets margin-top: 12px on tips in non-checkbox rows (specificity ~0,5,1).
 * Beat that so the tip stays centered next to the Buy & Carry qty input.
 */
.wc-wp-version-gte-70 .woocommerce_options_panel .form-field.pl-wcpt-buy-carry-field .pl-wcpt-buy-carry-controls > .woocommerce-help-tip,
.woocommerce_options_panel .form-field.pl-wcpt-buy-carry-field .pl-wcpt-buy-carry-controls > .woocommerce-help-tip {
	float: none !important;
	display: inline-block !important;
	margin: 0 !important;
	vertical-align: middle;
	position: relative;
	top: 0;
	flex-shrink: 0;
}

/* Align compact PayThem value fields with the existing 50% product Select2. */
#pl_pt_product_div .pl-wcpt-compact-field-wrap input.pl-wcpt-compact-field,
#pl_pt_product_div .pl-wcpt-compact-field-wrap select.pl-wcpt-compact-field,
.woocommerce_options_panel #_pt_price.pl-wcpt-compact-field,
.woocommerce_options_panel #_pt_autoselling_fixed_currency.pl-wcpt-compact-field,
.woocommerce_options_panel #_pt_autoselling_fixed_currency_value.pl-wcpt-compact-field,
.woocommerce_options_panel #_pt_autoselling_price_percentage.pl-wcpt-compact-field {
	width: 50% !important;
	max-width: 320px;
}

.woocommerce_options_panel ._pt_product_field .select2-container {
	width: 50% !important;
	max-width: 320px;
}

.pl-wcpt-buy-local-snapshot {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 12px;
}

.pl-wcpt-buy-local-snapshot th,
.pl-wcpt-buy-local-snapshot td {
	padding: 4px 0;
	text-align: left;
	vertical-align: top;
}

.pl-wcpt-buy-local-snapshot th {
	font-weight: 600;
	width: 42%;
	padding-right: 8px;
}

.pl-wcpt-buy-local-order {
	margin: 0 0 10px;
}

.pl-wcpt-buy-local-qty-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	margin: 0 0 8px;
}

.pl-wcpt-buy-local-qty-label {
	margin: 0;
}

.pl-wcpt-buy-local-qty-row input[type="number"] {
	width: 72px;
	margin: 0;
}

.pl-wcpt-buy-local-finance {
	width: 100%;
	margin-top: 8px;
}

.pl-wcpt-buy-local-finance-table {
	width: 100%;
	border-collapse: collapse;
	border: 0;
}

.pl-wcpt-buy-local-finance-table th,
.pl-wcpt-buy-local-finance-table td {
	border: 0;
	padding: 2px 0;
	vertical-align: baseline;
	line-height: 1.4;
}

.pl-wcpt-buy-local-finance-table th {
	width: 1%;
	white-space: nowrap;
	padding-right: 12px;
	font-weight: 600;
	text-align: left;
}

.pl-wcpt-buy-local-finance-table td.pl-wcpt-money {
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	padding-left: 8px;
}

.pl-wcpt-buy-local-finance-table .pl-wcpt-snap-cost-pt,
.pl-wcpt-buy-local-finance-table .pl-wcpt-snap-wallet-pt {
	display: none;
	color: #646970;
	padding-left: 12px;
}

.pl-wcpt-buy-local-finance.pl-wcpt-finance-dual .pl-wcpt-snap-cost-pt,
.pl-wcpt-buy-local-finance.pl-wcpt-finance-dual .pl-wcpt-snap-wallet-pt {
	display: table-cell;
}

.pl-wcpt-buy-local-warning,
.pl-wcpt-wallet-warning {
	color: #b32d2e;
	font-weight: 600;
}

.pl-wcpt-buy-local-scheduled {
	border: 1px solid #c3c4c7;
	background: #f6f7f7;
	padding: 8px 10px;
	margin: 0 0 12px;
	border-radius: 4px;
}

.pl-wcpt-buy-local-scheduled h4 {
	margin: 0 0 6px;
}

.pl-wcpt-buy-local-topup-status {
	margin: 0 0 6px;
}

.pl-wcpt-buy-local-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.pl-wcpt-buy-local-notices .notice {
	margin: 0 0 10px;
	padding: 6px 10px;
}

#pl_wcpt_purchase_spinner.is-active {
	visibility: visible;
	float: none;
	margin: 0 0 0 6px;
}

.pl-wcpt-refresh-snapshot {
	margin-left: 6px !important;
}

/* PayThem product mapping Select2 (product edit General tab) */
.woocommerce_options_panel .pl-wcpt-pt-product-select + .select2-container {
	max-width: 100%;
	min-width: 200px;
}

.woocommerce_options_panel .select2-container--open {
	z-index: 100100;
}

body .select2-container--open .select2-dropdown {
	z-index: 100101;
}

/* FX fixed-price preview spinner (next to Currency select on product edit) */
.woocommerce_options_panel .pl-wcpt-fx-preview-spinner {
	float: none;
	margin: 0 0 0 6px;
	vertical-align: middle;
	visibility: hidden;
}

.woocommerce_options_panel .pl-wcpt-fx-preview-spinner.is-active {
	visibility: visible;
}
