/**
 * WooCommerce Product Data - Topping Sets Styles
 *
 * @package Foodord
 */

/* Main Panel Container */
.foodord-topping-panel {
	padding: 20px;
	background: #fff;
}

.foodord-topping-panel__header {
	margin-bottom: 20px;
	border-bottom: 1px solid #e0e0e0;
	padding-bottom: 15px;
}

.foodord-topping-panel__title {
	margin: 0 0 8px 0;
}

/* Higher specificity to override WooCommerce styles */
#woocommerce-product-data #foodord_topping_sets_data.panel.woocommerce_options_panel .foodord-topping-panel .foodord-topping-panel__header .foodord-topping-panel__description,
#woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-topping-panel__description,
#foodord_topping_sets_data .foodord-topping-panel__description,
.woocommerce_options_panel .foodord-topping-panel .foodord-topping-panel__description,
body.post-type-product #woocommerce-product-data .foodord-topping-panel__description {
	margin: 0;
	padding: 0;
	font-style: normal;
	display: block;
}

/* Empty State */
.foodord-topping-panel__empty {
	padding: 40px 20px;
	text-align: center;
	background: #f8f9fa;
	border-radius: 4px;
	border: 1px dashed #c3c4c7;
}

/* Higher specificity for empty state paragraphs */
#woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-topping-panel__empty p,
#foodord_topping_sets_data .foodord-topping-panel__empty p,
.woocommerce_options_panel .foodord-topping-panel__empty p,
body.post-type-product #woocommerce-product-data .foodord-topping-panel__empty p {
	margin: 0 0 15px;
	font-style: normal;
}

/* Topping Sets Container with Scroll */
.foodord-topping-panel__sets {
	margin-bottom: 20px;
	max-height: 320px;
	overflow-y: auto;
	overflow-x: hidden;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 10px;
	background: #fafafa;
	scroll-behavior: smooth;
}

.foodord-topping-panel__sets::-webkit-scrollbar {
	width: 8px;
}

.foodord-topping-panel__sets::-webkit-scrollbar-track {
	background: #f1f1f1;
	border-radius: 4px;
}

.foodord-topping-panel__sets::-webkit-scrollbar-thumb {
	background: #c3c4c7;
	border-radius: 4px;
}

.foodord-topping-panel__sets::-webkit-scrollbar-thumb:hover {
	background: #8c8f94;
}

/* Topping Card - Compact Row Design */
.foodord-topping-card {
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin-bottom: 8px;
	transition: all 0.3s ease;
	position: relative;
}

.foodord-topping-card:last-child {
	margin-bottom: 0;
}

.foodord-topping-card:hover {
	border-color: #8c8f94;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.foodord-topping-card.is-selected {
	border-color: #2271b1;
	background: #f0f8ff;
}

/* Card Header */
.foodord-topping-card__header {
	display: flex;
	align-items: center;
	padding: 12px 15px;
	border-bottom: 1px solid #e0e0e0;
	gap: 12px;
}


.foodord-topping-card.is-selected .foodord-topping-card__header {
	border-bottom-color: #d4e4f1;
}

/* Drag Handle */
.foodord-topping-card__drag-handle {
	display: flex;
	align-items: center;
	cursor: move;
	transition: color 0.2s;
}.foodord-topping-card__drag-handle .dashicons {
	width: 20px;
	height: 20px;
}

/* Card Info */
.foodord-topping-card__info {
	flex: 1;
	min-width: 0;
}

.foodord-topping-card__title {
	margin: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.foodord-topping-card__label {
	display: inline-block;
	margin-top: 4px;
}

/* Toggle Switch - Ultra High Specificity to override WooCommerce */
body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-topping-card__toggle,
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-topping-card__header .foodord-topping-card__toggle {
	display: contents;
}

body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-toggle-switch,
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-topping-card__header .foodord-toggle-switch {
	position: relative;
	display: inline-block;
	width: 42px;
	height: 24px;
	min-width: 42px;
	max-width: 42px;
}

body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-toggle-switch input[type="checkbox"],
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-topping-card__header .foodord-toggle-switch input[type="checkbox"] {
	opacity: 0;
	width: 0;
	height: 0;
	min-width: 0;
	max-width: none;
	margin: 0;
	padding: 0;
	position: absolute;
}

body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-toggle-switch__slider,
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-toggle-switch__slider {
	position: absolute;
	cursor: pointer;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background-color: rgba(120, 120, 128, 0.16);
	border-radius: 24px;
	width: auto;
	height: auto;
	min-width: auto;
	max-width: none;
	transition: background-color 0.3s ease;
}

body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-toggle-switch__slider:before,
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-toggle-switch__slider:before {
	position: absolute;
	content: "";
	height: 20px;
	width: 20px;
	left: 2px;
	bottom: 2px;
	background-color: white;
	border-radius: 50%;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	min-width: 20px;
	max-width: 20px;
	transition: transform 0.3s ease;
}

body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-toggle-switch input[type="checkbox"]:checked + .foodord-toggle-switch__slider,
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-toggle-switch input[type="checkbox"]:checked + .foodord-toggle-switch__slider {
	background-color: #34c759;
}

body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-toggle-switch input[type="checkbox"]:focus + .foodord-toggle-switch__slider,
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-toggle-switch input[type="checkbox"]:focus + .foodord-toggle-switch__slider {
	box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.3);
}

body.post-type-product #wpwrap #wpbody #wpbody-content #woocommerce-product-data .panel.woocommerce_options_panel .foodord-topping-panel .foodord-toggle-switch input[type="checkbox"]:checked + .foodord-toggle-switch__slider:before,
#woocommerce-product-data #foodord_topping_sets_data .foodord-topping-panel .foodord-toggle-switch input[type="checkbox"]:checked + .foodord-toggle-switch__slider:before {
	transform: translateX(18px);
}

/* WordPress Admin Blue Theme Alternative - High Specificity */
#woocommerce-product-data .foodord-topping-panel .foodord-topping-card.is-selected .foodord-toggle-switch input[type="checkbox"]:checked + .foodord-toggle-switch__slider {
	background-color: #2271b1;
}

#woocommerce-product-data .foodord-topping-panel .foodord-topping-card.is-selected .foodord-toggle-switch input[type="checkbox"]:focus + .foodord-toggle-switch__slider {
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.3);
}

/* Card Body */
.foodord-topping-card__body {
	padding: 10px 15px;
}

.foodord-topping-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
}

.foodord-topping-card__meta-item {
	display: flex;
	align-items: center;
	gap: 10px;
}

.foodord-topping-card__meta-item .dashicons {
	width: 16px;
	height: 16px;
	padding-bottom: 5px;
}

.foodord-topping-card__more {
	display: inline-block;
	padding: 2px 6px;
	background: #f0f0f1;
	border-radius: 3px;
	margin-left: 4px;
}

/* Drag & Drop Styles */
.foodord-topping-card--placeholder {
	background: #f0f0f1;
	border: 2px dashed #8c8f94;
	border-radius: 4px;
	margin-bottom: 8px;
	height: 80px;
}

.foodord-topping-card.is-dragging {
	opacity: 0.5;
}

.foodord-topping-panel__sets[data-sortable="active"] {
	user-select: none;
}

/* Footer */
.foodord-topping-panel__footer {
	margin-top: 20px;
	padding-top: 15px;
	border-top: 1px solid #e0e0e0;
}

.foodord-topping-panel__footer .description {
	margin: 0;
	font-style: italic;
}

/* Responsive Design */
@media screen and (max-width: 782px) {
	.foodord-topping-card__header {
		flex-wrap: wrap;
		padding: 10px;
	}

	.foodord-topping-card__drag-handle {
		order: -1;
		width: 100%;
		justify-content: center;
		margin-bottom: 8px;
		padding-bottom: 8px;
		border-bottom: 1px solid #e0e0e0;
	}

	.foodord-topping-card__info {
		flex: 1;
	}

	.foodord-topping-card__meta {
		flex-direction: column;
		align-items: flex-start;
		gap: 8px;
	}
}

/* WooCommerce Tab Integration */
#woocommerce-product-data .foodord-topping-panel {
	padding: 10px;
}

#woocommerce-product-data .foodord-topping-panel__header {
	margin-bottom: 15px;
}

/* Disabled State for Phase 1 */
.foodord-topping-card__drag-handle.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Animation for future drag-drop */
.foodord-topping-card.ui-sortable-helper {
	opacity: 0.8;
	box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}