/**
 * OnCloudWine My Releases - Modern UI/UX Styles
 *
 * Design System: WordPress Block Theme + Material-UI + Airbnb Principles
 * @package OnCloudWine
 * @version 2.0.0
 */

/* ===========================
   CSS Custom Properties - Easy Customization
   =========================== */
:root {
	/* Colors - Integrates with WordPress Block Themes */
	--ocw-color-primary: var(--wp--preset--color--primary, #000000);
	--ocw-color-primary-hover: var(--wp--preset--color--primary-hover, #333333);
	--ocw-color-secondary: var(--wp--preset--color--secondary, #666666);
	--ocw-color-background: var(--wp--preset--color--background, #ffffff);
	--ocw-color-surface: var(--wp--preset--color--neutral, #f8f9fa);
	--ocw-color-border: var(--wp--preset--color--border, #e5e7eb);
	--ocw-color-text: var(--wp--preset--color--foreground, #111827);
	--ocw-color-text-muted: var(--wp--preset--color--secondary, #6b7280);
	--ocw-color-success: var(--wp--preset--color--success, #10b981);
	--ocw-color-warning: var(--wp--preset--color--warning, #f59e0b);
	--ocw-color-error: var(--wp--preset--color--error, #ef4444);
	--ocw-color-info: var(--wp--preset--color--info, #3b82f6);
	
	/* Spacing System (8px base unit) */
	--ocw-spacing-xs: 0.5rem;   /* 8px */
	--ocw-spacing-sm: 1rem;      /* 16px */
	--ocw-spacing-md: 1.5rem;    /* 24px */
	--ocw-spacing-lg: 2rem;      /* 32px */
	--ocw-spacing-xl: 3rem;      /* 48px */
	--ocw-spacing-2xl: 4rem;     /* 64px */
	
	/* Typography */
	--ocw-font-family: var(--wp--preset--font-family--system-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif);
	--ocw-font-size-xs: 0.75rem;    /* 12px */
	--ocw-font-size-sm: 0.875rem;   /* 14px */
	--ocw-font-size-base: 1rem;     /* 16px */
	--ocw-font-size-lg: 1.125rem;   /* 18px */
	--ocw-font-size-xl: 1.25rem;    /* 20px */
	--ocw-font-size-2xl: 1.5rem;    /* 24px */
	--ocw-font-size-3xl: 1.875rem;  /* 30px */
	--ocw-font-weight-normal: 400;
	--ocw-font-weight-medium: 500;
	--ocw-font-weight-semibold: 600;
	--ocw-font-weight-bold: 700;
	--ocw-line-height-tight: 1.25;
	--ocw-line-height-normal: 1.5;
	--ocw-line-height-relaxed: 1.75;
	
	/* Shadows (Material-UI inspired) */
	--ocw-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--ocw-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
	--ocw-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--ocw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--ocw-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
	
	/* Border Radius */
	--ocw-radius-sm: 0.25rem;    /* 4px */
	--ocw-radius: 0.375rem;      /* 6px */
	--ocw-radius-md: 0.5rem;     /* 8px */
	--ocw-radius-lg: 0.75rem;    /* 12px */
	--ocw-radius-full: 9999px;
	
	/* Transitions */
	--ocw-transition-fast: 150ms ease-in-out;
	--ocw-transition: 200ms ease-in-out;
	--ocw-transition-slow: 300ms ease-in-out;
	
	/* Z-index Scale */
	--ocw-z-dropdown: 100;
	--ocw-z-sticky: 200;
	--ocw-z-modal: 300;
	--ocw-z-popover: 400;
	--ocw-z-tooltip: 500;
}

/* ===========================
   Base Reset & Typography
   =========================== */
.oncloudwine-my-releases-archive *,
.oncloudwine-single-release * {
	box-sizing: border-box;
}

.oncloudwine-my-releases-archive,
.oncloudwine-single-release {
	font-family: var(--ocw-font-family);
	font-size: var(--ocw-font-size-base);
	line-height: var(--ocw-line-height-normal);
	color: var(--ocw-color-text);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* ===========================
   Container & Layout
   =========================== */
.oncloudwine-my-releases-archive,
.oncloudwine-single-release {
	max-width: 1280px;
	margin: 0 auto;
	padding: var(--ocw-spacing-lg) var(--ocw-spacing-md);
}

/* ===========================
   Tabs Component
   =========================== */
.oncloudwine-release-tabs {
	margin-bottom: var(--ocw-spacing-lg);
	border-bottom: 1px solid var(--ocw-color-border);
}

.oncloudwine-release-tabs .tab-list {
	display: flex;
	gap: var(--ocw-spacing-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.oncloudwine-release-tabs .tab-item {
	margin: 0;
}

.oncloudwine-release-tabs .tab-link {
	display: inline-flex;
	align-items: center;
	padding: var(--ocw-spacing-sm) var(--ocw-spacing-md);
	color: var(--ocw-color-text-muted);
	text-decoration: none;
	font-weight: var(--ocw-font-weight-medium);
	font-size: var(--ocw-font-size-base);
	border-bottom: 2px solid transparent;
	transition: all var(--ocw-transition);
	position: relative;
	bottom: -1px;
}

.oncloudwine-release-tabs .tab-link:hover {
	color: var(--ocw-color-text);
}

.oncloudwine-release-tabs .tab-item.active .tab-link {
	color: var(--ocw-color-primary);
	border-bottom-color: var(--ocw-color-primary);
}

/* ===========================
   Headers
   =========================== */
.oncloudwine-releases-header,
.oncloudwine-release-header {
	margin-bottom: var(--ocw-spacing-lg);
}

.releases-title,
.release-title {
	margin: 0 0 var(--ocw-spacing-xs);
	font-size: var(--ocw-font-size-2xl);
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-text);
	line-height: var(--ocw-line-height-tight);
}

/* ===========================
   Grid Layout
   =========================== */
.oncloudwine-releases-grid {
	display: grid;
	gap: var(--ocw-spacing-md);
	margin-bottom: var(--ocw-spacing-xl);
}

.oncloudwine-releases-grid.columns-1 {
	grid-template-columns: 1fr;
}

.oncloudwine-releases-grid.columns-2 {
	grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.oncloudwine-releases-grid.columns-3 {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.oncloudwine-releases-grid.columns-4 {
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

/* ===========================
   Release Cards
   =========================== */
.oncloudwine-release-card {
	background: var(--ocw-color-background);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius-md);
	padding: var(--ocw-spacing-md);
	transition: all var(--ocw-transition);
	display: flex;
	flex-direction: column;
	height: 100%;
}

.oncloudwine-release-card:hover {
	box-shadow: var(--ocw-shadow-md);
	transform: translateY(-2px);
}

.release-card-header {
	margin-bottom: var(--ocw-spacing-md);
	padding-bottom: var(--ocw-spacing-sm);
	border-bottom: 1px solid var(--ocw-color-border);
}

.release-card-header .release-title {
	margin: 0 0 var(--ocw-spacing-xs);
	font-size: var(--ocw-font-size-lg);
	font-weight: var(--ocw-font-weight-semibold);
}

.release-card-header .release-title a {
	color: var(--ocw-color-text);
	text-decoration: none;
	transition: color var(--ocw-transition);
}

.release-card-header .release-title a:hover {
	color: var(--ocw-color-primary);
}

.release-card-content {
	flex: 1;
	margin-bottom: var(--ocw-spacing-md);
}

.release-meta {
	display: flex;
	justify-content: space-between;
	margin-bottom: var(--ocw-spacing-xs);
	font-size: var(--ocw-font-size-sm);
}

.release-meta .meta-label {
	color: var(--ocw-color-text-muted);
	font-weight: var(--ocw-font-weight-medium);
}

.release-meta .meta-value {
	color: var(--ocw-color-text);
}

.release-meta .points-value {
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-success);
}

.release-card-footer {
	margin-top: auto;
	padding-top: var(--ocw-spacing-sm);
}

/* ===========================
   Status Badges
   =========================== */
.release-stage {
	display: inline-block;
	padding: var(--ocw-spacing-xs) var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-xs);
	font-weight: var(--ocw-font-weight-semibold);
	text-transform: uppercase;
	letter-spacing: 0.025em;
	border-radius: var(--ocw-radius-full);
}

.release-stage.stage-pending {
	background-color: var(--ocw-color-warning);
	color: white;
}

.release-stage.stage-completed {
	background-color: var(--ocw-color-success);
	color: white;
}

.release-stage.stage-draft {
	background-color: var(--ocw-color-secondary);
	color: white;
}

/* ===========================
   Buttons
   =========================== */
.oncloudwine-button,
.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--ocw-spacing-sm) var(--ocw-spacing-md);
	font-size: var(--ocw-font-size-base);
	font-weight: var(--ocw-font-weight-medium);
	font-family: var(--ocw-font-family);
	line-height: 1;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: var(--ocw-radius);
	cursor: pointer;
	transition: all var(--ocw-transition);
	gap: var(--ocw-spacing-xs);
}

.oncloudwine-button:focus,
.button:focus {
	outline: 2px solid var(--ocw-color-primary);
	outline-offset: 2px;
}

.oncloudwine-button-primary,
.button-primary {
	background-color: var(--ocw-color-primary);
	color: white;
	border-color: var(--ocw-color-primary);
}

.oncloudwine-button-primary:hover,
.button-primary:hover {
	background-color: var(--ocw-color-primary-hover);
	border-color: var(--ocw-color-primary-hover);
	transform: translateY(-1px);
	box-shadow: var(--ocw-shadow);
}

.oncloudwine-button-secondary,
.button-secondary {
	background-color: var(--ocw-color-background);
	color: var(--ocw-color-text);
	border-color: var(--ocw-color-border);
}

.oncloudwine-button-secondary:hover,
.button-secondary:hover {
	background-color: var(--ocw-color-surface);
	border-color: var(--ocw-color-text-muted);
}

.oncloudwine-button:disabled,
.button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none !important;
}

/* ===========================
   Product Grid & Items
   =========================== */
.oncloudwine-release-products {
	margin-top: var(--ocw-spacing-lg);
}

.product-selection-container {
	display: flex;
	flex-direction: column;
	gap: var(--ocw-spacing-xl);
}

.selected-products-section,
.available-products-section {
	margin-bottom: var(--ocw-spacing-lg);
}

.selected-products-section h3,
.available-products-section h3 {
	margin: 0 0 var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-lg);
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-text);
}

.section-description {
	margin: 0 0 var(--ocw-spacing-md);
	color: var(--ocw-color-text-muted);
	font-size: var(--ocw-font-size-sm);
}

/* Product Grid Layouts */
.products-grid,
.products-list {
	display: grid;
	gap: var(--ocw-spacing-md);
}

/* Default grid layout */
.products-grid {
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.products-list {
	grid-template-columns: 1fr;
}

/* Specific column layouts - force exact column count */
.products-grid.columns-1 {
	grid-template-columns: 1fr !important;
}

.products-grid.columns-2 {
	grid-template-columns: repeat(2, 1fr) !important;
}

.products-grid.columns-3 {
	grid-template-columns: repeat(3, 1fr) !important;
}

.products-grid.columns-4 {
	grid-template-columns: repeat(4, 1fr) !important;
}

/* Selected products list should use same grid as products-grid */
#selected-products-list {
	display: grid !important;
	gap: var(--ocw-spacing-md);
}

/* Apply same column rules to selected products */
#selected-products-list.columns-1 {
	grid-template-columns: 1fr !important;
}

#selected-products-list.columns-2 {
	grid-template-columns: repeat(2, 1fr) !important;
}

#selected-products-list.columns-3 {
	grid-template-columns: repeat(3, 1fr) !important;
}

/* Enhanced Product Item Card Layout */
.product-item {
	display: flex;
	flex-direction: column;
	padding: 0;
	background: var(--ocw-color-background);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius-md);
	transition: all var(--ocw-transition);
	height: 100%;
	overflow: hidden;
	position: relative;
}

.product-item:hover {
	box-shadow: var(--ocw-shadow-lg);
	transform: translateY(-4px);
	border-color: var(--ocw-color-primary);
}

/* Quantity updated animation */
.product-item.quantity-updated {
	animation: flash-green 1s ease;
}

@keyframes flash-green {
	0%, 100% { 
		border-color: var(--ocw-color-border);
		box-shadow: none;
	}
	50% { 
		border-color: var(--ocw-color-success);
		box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
	}
}

/* Custom product indicator */
.product-item[data-is-custom="true"]::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: var(--ocw-color-success);
	z-index: 1;
}

/* Product Image Section */
.product-image {
	width: 100%;
	height: 200px;
	margin: 0;
	overflow: hidden;
	background: var(--ocw-color-surface);
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
}

.product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--ocw-transition-slow);
}

.product-item:hover .product-image img {
	transform: scale(1.1);
}

/* Product image placeholder */
.product-image-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ocw-color-surface);
}

.product-image-placeholder .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: var(--ocw-color-text-muted);
	opacity: 0.3;
}

/* Product Details Section */
.product-details {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: var(--ocw-spacing-xs);
	padding: var(--ocw-spacing-md);
	padding-bottom: var(--ocw-spacing-sm);
}

.product-name {
	margin: 0;
	font-size: var(--ocw-font-size-base);
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-text);
	line-height: var(--ocw-line-height-tight);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.product-variant {
	margin: 0;
	font-size: var(--ocw-font-size-sm);
	color: var(--ocw-color-text-muted);
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.product-sku {
	margin: 0;
	font-size: var(--ocw-font-size-xs);
	color: var(--ocw-color-text-muted);
	font-family: monospace;
}

.product-price {
	margin: var(--ocw-spacing-xs) 0 0;
	font-size: var(--ocw-font-size-lg);
	font-weight: var(--ocw-font-weight-bold);
	color: var(--ocw-color-primary);
}

/* Product Badges */
.product-badges {
	display: flex;
	gap: var(--ocw-spacing-xs);
	flex-wrap: wrap;
	margin-top: auto;
	padding-top: var(--ocw-spacing-xs);
}

.product-required,
.product-custom-added {
	display: inline-flex;
	align-items: center;
	padding: 2px var(--ocw-spacing-xs);
	font-size: 10px;
	font-weight: var(--ocw-font-weight-semibold);
	border-radius: var(--ocw-radius-sm);
	text-transform: uppercase;
	letter-spacing: 0.025em;
	line-height: 1.2;
}

.product-required {
	background: var(--ocw-color-error);
	color: white;
}

.product-custom-added {
	background: var(--ocw-color-success);
	color: white;
}

/* ===========================
   Forms & Inputs
   =========================== */
.product-controls {
	display: flex;
	flex-direction: column;
	gap: var(--ocw-spacing-sm);
	margin-top: auto;
	padding: var(--ocw-spacing-md);
	padding-top: var(--ocw-spacing-sm);
	border-top: 1px solid var(--ocw-color-border);
	background: var(--ocw-color-surface);
}

.quantity-selector {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ocw-spacing-sm);
}

.quantity-selector label {
	font-size: var(--ocw-font-size-sm);
	font-weight: var(--ocw-font-weight-medium);
	color: var(--ocw-color-text-muted);
	white-space: nowrap;
}

.quantity-selector input[type="number"] {
	width: 60px;
	text-align: center;
	padding: var(--ocw-spacing-xs);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius-sm);
	background: var(--ocw-color-background);
}

.quantity-selector input[type="number"]:focus {
	outline: none;
	border-color: var(--ocw-color-primary);
	box-shadow: 0 0 0 2px rgba(var(--ocw-color-primary-rgb, 0, 0, 0), 0.1);
}

/* Quantity Controls in Modals */
.quantity-controls {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-xs);
}

.quantity-btn {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ocw-color-surface);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius-sm);
	cursor: pointer;
	transition: all var(--ocw-transition);
}

.quantity-btn:hover {
	background: var(--ocw-color-primary);
	color: white;
	border-color: var(--ocw-color-primary);
}

.quantity-input {
	width: 50px;
	text-align: center;
	padding: var(--ocw-spacing-xs);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius-sm);
}

input[type="number"],
input[type="text"],
input[type="email"],
select,
textarea {
	padding: var(--ocw-spacing-xs) var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-base);
	font-family: var(--ocw-font-family);
	color: var(--ocw-color-text);
	background: var(--ocw-color-background);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius);
	transition: all var(--ocw-transition);
}

input[type="number"]:focus,
input[type="text"]:focus,
input[type="email"]:focus,
select:focus,
textarea:focus {
	outline: 2px solid var(--ocw-color-primary);
	outline-offset: -1px;
	border-color: var(--ocw-color-primary);
}

input[type="number"] {
	width: 80px;
	text-align: center;
}

/* ===========================
   Product Actions
   =========================== */
.remove-product-btn,
.add-to-selection-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--ocw-spacing-xs);
	padding: var(--ocw-spacing-xs) var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-sm);
	border-radius: var(--ocw-radius);
	cursor: pointer;
	transition: all var(--ocw-transition);
	border: 1px solid transparent;
	width: 100%;
}

.remove-product-btn {
	background: transparent;
	color: var(--ocw-color-error);
	border-color: var(--ocw-color-error);
}

.remove-product-btn:hover {
	background: var(--ocw-color-error);
	color: white;
	transform: none;
}

.remove-product-btn .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
	line-height: 1;
}

.add-to-selection-btn {
	background: var(--ocw-color-success);
	color: white;
	border-color: var(--ocw-color-success);
}

.add-to-selection-btn:hover {
	background: var(--ocw-color-success);
	opacity: 0.9;
	transform: translateY(-1px);
}

/* ===========================
   Available Product Cards
   =========================== */
.available-product-card {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-md);
	padding: var(--ocw-spacing-sm);
	background: var(--ocw-color-surface);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius-md);
	transition: all var(--ocw-transition);
}

.available-product-card:hover {
	background: var(--ocw-color-background);
	box-shadow: var(--ocw-shadow-sm);
}

.available-product-image {
	width: 60px;
	height: 60px;
	border-radius: var(--ocw-radius);
	overflow: hidden;
	flex-shrink: 0;
}

.available-product-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.available-product-info {
	flex: 1;
}

.available-product-name {
	margin: 0 0 var(--ocw-spacing-xs);
	font-size: var(--ocw-font-size-base);
	font-weight: var(--ocw-font-weight-medium);
}

.available-product-variant,
.available-product-sku,
.available-product-price {
	margin: 0;
	font-size: var(--ocw-font-size-sm);
	color: var(--ocw-color-text-muted);
}

.available-product-sku {
	font-size: var(--ocw-font-size-xs);
	font-family: monospace;
}

/* ===========================
   Notices & Alerts
   =========================== */
.oncloudwine-notice {
	padding: var(--ocw-spacing-sm) var(--ocw-spacing-md);
	margin-bottom: var(--ocw-spacing-md);
	border-radius: var(--ocw-radius);
	border-left: 4px solid;
}

.oncloudwine-notice {
	background: var(--ocw-color-surface);
	border-left-color: var(--ocw-color-text-muted);
	color: var(--ocw-color-text);
}

.oncloudwine-notice-info {
	background: rgba(59, 130, 246, 0.1);
	border-left-color: var(--ocw-color-info);
	color: var(--ocw-color-text);
}

.oncloudwine-notice-success {
	background: rgba(16, 185, 129, 0.1);
	border-left-color: var(--ocw-color-success);
	color: var(--ocw-color-text);
}

.oncloudwine-notice-warning {
	background: rgba(245, 158, 11, 0.1);
	border-left-color: var(--ocw-color-warning);
	color: var(--ocw-color-text);
}

.oncloudwine-notice-error {
	background: rgba(239, 68, 68, 0.1);
	border-left-color: var(--ocw-color-error);
	color: var(--ocw-color-text);
}

/* ===========================
   Form Actions
   =========================== */
.form-actions {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-sm);
	margin-top: var(--ocw-spacing-lg);
	padding-top: var(--ocw-spacing-lg);
	border-top: 1px solid var(--ocw-color-border);
}

.add-products-section {
	margin-top: var(--ocw-spacing-lg);
	padding-top: var(--ocw-spacing-lg);
	border-top: 1px solid var(--ocw-color-border);
}

.add-products-btn {
	display: inline-flex;
	align-items: center;
	gap: var(--ocw-spacing-xs);
	padding: var(--ocw-spacing-sm) var(--ocw-spacing-md);
	background: transparent;
	color: var(--ocw-color-primary);
	border: 2px dashed var(--ocw-color-primary);
	border-radius: var(--ocw-radius);
	font-weight: var(--ocw-font-weight-medium);
	cursor: pointer;
	transition: all var(--ocw-transition);
}

.add-products-btn:hover {
	background: var(--ocw-color-primary);
	color: white;
	border-style: solid;
}

/* ===========================
   Read-only / Completed Releases
   =========================== */
.release-order-details .product-item {
	background: var(--ocw-color-background);
	border-color: var(--ocw-color-border);
}

.product-quantity-display,
.product-fixed-quantity {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ocw-spacing-sm);
	padding: var(--ocw-spacing-md);
	padding-top: var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-base);
	border-top: 1px solid var(--ocw-color-border);
	background: var(--ocw-color-surface);
	margin-top: auto;
}

.product-quantity-display .label,
.product-fixed-quantity .label {
	font-weight: var(--ocw-font-weight-medium);
	color: var(--ocw-color-text-muted);
	font-size: var(--ocw-font-size-sm);
}

.product-quantity-display .value,
.product-fixed-quantity .value {
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-text);
	font-size: var(--ocw-font-size-lg);
}

/* ===========================
   Empty States
   =========================== */
.oncloudwine-no-releases,
.no-products {
	text-align: center;
	padding: var(--ocw-spacing-2xl) var(--ocw-spacing-lg);
	background: var(--ocw-color-surface);
	border-radius: var(--ocw-radius-md);
	border: 1px solid var(--ocw-color-border);
}

.oncloudwine-no-releases p,
.no-products {
	margin: 0;
	color: var(--ocw-color-text-muted);
	font-size: var(--ocw-font-size-lg);
}

/* ===========================
   Loading States
   =========================== */
.oncloudwine-releases-wrapper.loading {
	position: relative;
	min-height: 200px;
	opacity: 0.6;
	pointer-events: none;
}

.oncloudwine-releases-wrapper.loading::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 32px;
	height: 32px;
	border: 3px solid var(--ocw-color-border);
	border-top-color: var(--ocw-color-primary);
	border-radius: 50%;
	animation: ocw-spin 0.8s linear infinite;
}

.spinner {
	display: none; /* Hidden by default */
	width: 20px;
	height: 20px;
	border: 2px solid var(--ocw-color-border);
	border-top-color: var(--ocw-color-primary);
	border-radius: 50%;
	animation: ocw-spin 0.8s linear infinite;
}

.form-actions.loading .spinner,
.form.loading .spinner,
.spinner.active {
	display: inline-block;
}

@keyframes ocw-spin {
	to { transform: rotate(360deg); }
}

/* ===========================
   Modal Styles
   =========================== */
.oncloudwine-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: var(--ocw-z-modal);
}

.oncloudwine-modal .modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

.oncloudwine-modal .modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: var(--ocw-color-background);
	border-radius: var(--ocw-radius-lg);
	max-width: 900px;
	width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: var(--ocw-shadow-xl);
}

.modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--ocw-spacing-md);
	border-bottom: 1px solid var(--ocw-color-border);
}

.modal-title {
	margin: 0;
	font-size: var(--ocw-font-size-xl);
	font-weight: var(--ocw-font-weight-semibold);
}

.modal-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	background: transparent;
	border: none;
	border-radius: var(--ocw-radius);
	cursor: pointer;
	transition: background var(--ocw-transition);
}

.modal-close:hover {
	background: var(--ocw-color-surface);
}

.modal-body {
	flex: 1;
	padding: var(--ocw-spacing-md);
	overflow-y: auto;
	overflow-x: hidden;
}

.modal-footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: var(--ocw-spacing-sm);
	padding: var(--ocw-spacing-md);
	border-top: 1px solid var(--ocw-color-border);
}

/* Product Search Modal Specific */
.product-search-controls {
	margin-bottom: var(--ocw-spacing-lg);
}

.search-bar {
	display: flex;
	gap: var(--ocw-spacing-sm);
	margin-bottom: var(--ocw-spacing-md);
}

.product-search-input {
	flex: 1;
}

.search-button {
	padding: var(--ocw-spacing-xs) var(--ocw-spacing-sm);
	background: var(--ocw-color-primary);
	color: white;
	border: none;
	border-radius: var(--ocw-radius);
	cursor: pointer;
	transition: background var(--ocw-transition);
}

.search-button:hover {
	background: var(--ocw-color-primary-hover);
}

.search-filters {
	display: flex;
	gap: var(--ocw-spacing-sm);
}

.category-filter {
	min-width: 200px;
}

/* Product Search Results */
.product-search-results {
	margin-top: var(--ocw-spacing-md);
}

.products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: var(--ocw-spacing-md);
}

.product-search-item {
	display: flex;
	flex-direction: column;
	padding: var(--ocw-spacing-sm);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius);
	transition: all var(--ocw-transition);
}

.product-search-item:hover {
	box-shadow: var(--ocw-shadow);
	border-color: var(--ocw-color-primary);
}

.product-search-item .product-image {
	width: 100%;
	height: 150px;
	object-fit: cover;
	border-radius: var(--ocw-radius-sm);
	margin-bottom: var(--ocw-spacing-sm);
}

.product-search-item .product-name {
	font-weight: var(--ocw-font-weight-medium);
	margin-bottom: var(--ocw-spacing-xs);
}

.product-search-item .product-sku {
	font-size: var(--ocw-font-size-xs);
	color: var(--ocw-color-text-muted);
	margin-bottom: var(--ocw-spacing-xs);
}

.product-search-item .product-price {
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-primary);
	margin-bottom: var(--ocw-spacing-sm);
}

.product-search-item .add-to-selection,
.product-search-item .select-variations {
	margin-top: auto;
	padding: var(--ocw-spacing-xs) var(--ocw-spacing-sm);
	background: var(--ocw-color-primary);
	color: white;
	border: none;
	border-radius: var(--ocw-radius-sm);
	font-size: var(--ocw-font-size-sm);
	cursor: pointer;
	transition: all var(--ocw-transition);
}

.product-search-item .add-to-selection:hover,
.product-search-item .select-variations:hover {
	background: var(--ocw-color-primary-hover);
	transform: translateY(-1px);
}

.product-search-loading {
	text-align: center;
	padding: var(--ocw-spacing-xl);
	color: var(--ocw-color-text-muted);
}

.product-search-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: var(--ocw-spacing-md);
	margin-top: var(--ocw-spacing-lg);
	padding-top: var(--ocw-spacing-md);
	border-top: 1px solid var(--ocw-color-border);
}

.prev-page,
.next-page {
	padding: var(--ocw-spacing-xs) var(--ocw-spacing-sm);
	background: var(--ocw-color-surface);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius);
	cursor: pointer;
	transition: all var(--ocw-transition);
}

.prev-page:not(:disabled):hover,
.next-page:not(:disabled):hover {
	background: var(--ocw-color-primary);
	color: white;
	border-color: var(--ocw-color-primary);
}

.prev-page:disabled,
.next-page:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.page-info {
	font-size: var(--ocw-font-size-sm);
	color: var(--ocw-color-text-muted);
}

/* Selected Products Summary */
.selected-products-summary {
	padding: var(--ocw-spacing-md);
	background: var(--ocw-color-surface);
	border-radius: var(--ocw-radius);
	margin-bottom: var(--ocw-spacing-md);
}

.selected-products-summary h3 {
	margin: 0 0 var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-base);
	font-weight: var(--ocw-font-weight-semibold);
}

.selected-products-list {
	display: flex;
	flex-direction: column;
	gap: var(--ocw-spacing-xs);
}

.selected-product-item {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--ocw-spacing-xs);
	background: var(--ocw-color-background);
	border-radius: var(--ocw-radius-sm);
}

.selected-product-info {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-sm);
}

.remove-selected {
	padding: 2px;
	background: transparent;
	border: none;
	color: var(--ocw-color-error);
	cursor: pointer;
	transition: all var(--ocw-transition);
}

.remove-selected:hover {
	transform: scale(1.1);
}

.add-selected-products {
	width: 100%;
	padding: var(--ocw-spacing-sm) var(--ocw-spacing-md);
	background: var(--ocw-color-success);
	color: white;
	border: none;
	border-radius: var(--ocw-radius);
	font-weight: var(--ocw-font-weight-medium);
	cursor: pointer;
	transition: all var(--ocw-transition);
}

.add-selected-products:hover:not(:disabled) {
	background: var(--ocw-color-success);
	opacity: 0.9;
	transform: translateY(-1px);
}

.add-selected-products:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Variation Selection Modal */
#variation-selection-modal {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: calc(var(--ocw-z-modal) + 10);
}

#variation-selection-modal .modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
}

#variation-selection-modal .modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: var(--ocw-color-background);
	border-radius: var(--ocw-radius-lg);
	max-width: 700px;
	width: 90%;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
	box-shadow: var(--ocw-shadow-xl);
}

.variations-list {
	display: flex;
	flex-direction: column;
	gap: var(--ocw-spacing-sm);
	max-height: 400px;
	overflow-y: auto;
}

.variation-item {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-md);
	padding: var(--ocw-spacing-sm);
	border: 1px solid var(--ocw-color-border);
	border-radius: var(--ocw-radius);
	transition: all var(--ocw-transition);
}

.variation-item:hover {
	background: var(--ocw-color-surface);
	border-color: var(--ocw-color-primary);
}

.variation-image {
	width: 60px;
	height: 60px;
	border-radius: var(--ocw-radius-sm);
	overflow: hidden;
	flex-shrink: 0;
}

.variation-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.variation-details {
	flex: 1;
}

.variation-attributes {
	font-size: var(--ocw-font-size-sm);
	color: var(--ocw-color-text-muted);
	margin: var(--ocw-spacing-xs) 0;
}

.variation-sku {
	font-size: var(--ocw-font-size-xs);
	color: var(--ocw-color-text-muted);
}

.variation-price {
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-primary);
}

.variation-controls {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-sm);
}

.variations-loading {
	text-align: center;
	padding: var(--ocw-spacing-xl);
	color: var(--ocw-color-text-muted);
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
	:root {
		--ocw-spacing-md: 1rem;
		--ocw-spacing-lg: 1.5rem;
		--ocw-spacing-xl: 2rem;
	}
	
	.oncloudwine-my-releases-archive,
	.oncloudwine-single-release {
		padding: var(--ocw-spacing-md) var(--ocw-spacing-sm);
	}
	
	.oncloudwine-releases-grid.columns-2,
	.oncloudwine-releases-grid.columns-3,
	.oncloudwine-releases-grid.columns-4 {
		grid-template-columns: 1fr;
	}
	
	/* Stack all product grids on mobile */
	.products-grid,
	.products-grid.columns-2,
	.products-grid.columns-3,
	.products-grid.columns-4,
	#selected-products-list,
	#selected-products-list.columns-2,
	#selected-products-list.columns-3,
	#selected-products-list.columns-4 {
		grid-template-columns: 1fr !important;
	}
	
	.release-meta {
		flex-direction: column;
		gap: var(--ocw-spacing-xs);
	}
	
	.form-actions {
		flex-direction: column;
		align-items: stretch;
	}
	
	.form-actions .button {
		width: 100%;
		justify-content: center;
	}
	
	.available-product-card {
		flex-direction: column;
		text-align: center;
	}
	
	.available-product-image {
		width: 100px;
		height: 100px;
		margin: 0 auto;
	}
	
	/* Product card adjustments for mobile */
	.product-item {
		border-radius: var(--ocw-radius);
	}
	
	.product-image {
		height: 150px;
	}
	
	.product-details {
		padding: var(--ocw-spacing-sm);
	}
	
	.product-controls,
	.product-quantity-display,
	.product-fixed-quantity {
		padding: var(--ocw-spacing-sm);
	}
}

/* ===========================
   Release Info Section
   =========================== */
.release-info-section {
	margin-bottom: var(--ocw-spacing-lg);
}

/* Fulfillment Method Selector */
.fulfillment-method-section {
	margin-bottom: var(--ocw-spacing-lg);
	padding: var(--ocw-spacing-md);
	background: var(--ocw-color-background-light);
	border-radius: var(--ocw-border-radius);
	border: 1px solid var(--ocw-color-border);
}

.fulfillment-method-section h3 {
	margin-top: 0;
	margin-bottom: var(--ocw-spacing-md);
	font-size: var(--ocw-font-size-lg);
	color: var(--ocw-color-text);
}

.fulfillment-method-selector {
	display: flex;
	gap: var(--ocw-spacing-md);
	flex-wrap: wrap;
}

.fulfillment-option {
	flex: 1;
	min-width: 200px;
	display: flex;
	align-items: center;
	padding: var(--ocw-spacing-sm) var(--ocw-spacing-md);
	background: var(--ocw-color-white);
	border: 2px solid var(--ocw-color-border);
	border-radius: var(--ocw-border-radius);
	cursor: pointer;
	transition: all var(--ocw-transition);
}

.fulfillment-option:hover {
	border-color: var(--ocw-color-primary);
	background: var(--ocw-color-background-light);
}

.fulfillment-option input[type="radio"] {
	margin-right: var(--ocw-spacing-sm);
}

.fulfillment-option input[type="radio"]:checked + .option-label {
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-primary);
}

.fulfillment-option:has(input[type="radio"]:checked) {
	border-color: var(--ocw-color-primary);
	background: var(--ocw-color-primary-light);
}

.fulfillment-option .option-label {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-xs);
	font-size: var(--ocw-font-size-base);
}

.fulfillment-option .dashicons {
	width: 20px;
	height: 20px;
	font-size: 20px;
}

.fulfillment-method-display {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-xs);
	margin: 0;
	font-size: var(--ocw-font-size-base);
	color: var(--ocw-color-text-muted);
}

.fulfillment-method-display .dashicons {
	color: var(--ocw-color-primary);
}

/* Fulfillment Save Action */
.fulfillment-save-action {
	margin-top: var(--ocw-spacing-md);
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-md);
}

.fulfillment-save-status {
	display: inline-flex;
	align-items: center;
	gap: var(--ocw-spacing-xs);
	color: var(--ocw-color-success);
	font-weight: var(--ocw-font-weight-medium);
	animation: fadeIn 0.3s ease-in;
}

.fulfillment-save-status .dashicons {
	font-size: 20px;
	width: 20px;
	height: 20px;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateX(-10px);
	}
	to {
		opacity: 1;
		transform: translateX(0);
	}
}

/* Tablet adjustments */
@media (min-width: 769px) and (max-width: 1024px) {
	.oncloudwine-releases-grid.columns-3,
	.oncloudwine-releases-grid.columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
	
	/* Adjust product grids for tablet - max 2 columns */
	.products-grid.columns-3,
	.products-grid.columns-4,
	#selected-products-list.columns-3,
	#selected-products-list.columns-4 {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

/* ===========================
   Accessibility
   =========================== */
.screen-reader-text {
	position: absolute !important;
	clip: rect(1px, 1px, 1px, 1px);
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
}

.screen-reader-text:focus {
	position: static !important;
	clip: auto;
	width: auto;
	height: auto;
	margin: 0;
	overflow: visible;
}

/* Focus visible for keyboard navigation */
*:focus-visible {
	outline: 2px solid var(--ocw-color-primary);
	outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
	.oncloudwine-release-card,
	.product-item {
		border-width: 2px;
	}
	
	.oncloudwine-button,
	.button {
		border-width: 2px;
	}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ===========================
   Print Styles
   =========================== */
@media print {
	.oncloudwine-release-tabs,
	.form-actions,
	.add-products-section,
	.remove-product-btn,
	.add-to-selection-btn {
		display: none !important;
	}
	
	.oncloudwine-release-card,
	.product-item {
		page-break-inside: avoid;
	}
}

/* ===========================
   Custom Theme Overrides
   Allow easy customization by theme developers
   =========================== */
.oncloudwine-custom-primary {
	color: var(--ocw-color-primary) !important;
}

.oncloudwine-custom-bg-primary {
	background-color: var(--ocw-color-primary) !important;
}

.oncloudwine-custom-border-primary {
	border-color: var(--ocw-color-primary) !important;
}

/* ===========================
   Eligibility Warnings
   =========================== */
.oncloudwine-eligibility-warnings {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: var(--ocw-border-radius-lg, 8px);
	padding: var(--ocw-spacing-md);
	margin-bottom: var(--ocw-spacing-lg);
}

.oncloudwine-eligibility-warnings h3 {
	color: #991b1b;
	margin: 0 0 var(--ocw-spacing-xs);
	font-size: var(--ocw-font-size-lg);
}

.oncloudwine-eligibility-warnings > p {
	color: #b91c1c;
	margin: 0 0 var(--ocw-spacing-sm);
	font-size: var(--ocw-font-size-sm);
}

.oncloudwine-eligibility-warnings ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.oncloudwine-eligibility-warnings li {
	display: flex;
	align-items: center;
	gap: var(--ocw-spacing-xs);
	padding: var(--ocw-spacing-xs) 0;
	color: #991b1b;
	font-size: var(--ocw-font-size-sm);
}

.oncloudwine-eligibility-warnings li::before {
	content: '!';
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fecaca;
	color: #991b1b;
	font-size: 0.7rem;
	font-weight: 700;
	flex-shrink: 0;
}

.oncloudwine-eligibility-warnings a {
	color: #991b1b;
	font-weight: var(--ocw-font-weight-semibold);
	text-decoration: underline;
}

.oncloudwine-eligibility-warnings a:hover {
	color: #7f1d1d;
}

/* ===========================
   Order Minimum Notice
   =========================== */
.order-minimum-notice {
	background: var(--ocw-color-surface, #f8f9fa);
	border: 1px solid var(--ocw-color-border, #e5e7eb);
	border-radius: var(--ocw-border-radius-lg, 8px);
	padding: var(--ocw-spacing-sm) var(--ocw-spacing-md);
	margin: var(--ocw-spacing-md) 0;
}

.order-minimum-notice p {
	margin: 0;
	font-size: var(--ocw-font-size-sm);
	color: var(--ocw-color-text-muted);
}

.order-minimum-notice .order-total-display {
	font-weight: var(--ocw-font-weight-semibold);
	color: var(--ocw-color-text);
	margin-left: var(--ocw-spacing-xs);
}

.order-minimum-notice.below-minimum {
	background: #fef2f2;
	border-color: #fecaca;
}

.order-minimum-notice.below-minimum p {
	color: #991b1b;
}

/* ===========================
   Quantity Hint
   =========================== */
.quantity-hint {
	display: block;
	font-size: var(--ocw-font-size-xs);
	color: var(--ocw-color-text-muted);
	margin-top: 2px;
}

/* ===========================
   Validation Errors
   =========================== */
.product-item .validation-error {
	color: var(--ocw-color-error, #ef4444);
	font-size: var(--ocw-font-size-xs);
	margin-top: 4px;
}

.quantity-selector input.error {
	border-color: var(--ocw-color-error, #ef4444);
	box-shadow: 0 0 0 1px var(--ocw-color-error, #ef4444);
}

/* ===========================
   Status Modal
   =========================== */
.ocw-status-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
}

.ocw-status-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
}

.ocw-status-modal-content {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #fff;
	border-radius: 12px;
	padding: 32px 28px;
	min-width: 280px;
	max-width: 380px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
	z-index: 1;
}

.ocw-status-modal-close {
	position: absolute;
	top: 10px;
	right: 12px;
	background: none;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #999;
	padding: 4px;
}

.ocw-status-modal-close:hover {
	color: #333;
}

.ocw-status-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	margin-bottom: 16px;
}

.ocw-status-icon .dashicons {
	font-size: 32px;
	width: 32px;
	height: 32px;
}

.ocw-status-saving {
	background: #f0f4ff;
	color: #4f6df5;
}

.ocw-status-success {
	background: #ecfdf5;
	color: #10b981;
}

.ocw-status-success .dashicons {
	color: #10b981;
}

.ocw-status-error {
	background: #fef2f2;
	color: #ef4444;
}

.ocw-status-error .dashicons {
	color: #ef4444;
}

.ocw-status-modal-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 600;
	color: #111;
}

.ocw-status-modal-message {
	margin: 0;
	font-size: 14px;
	color: #666;
	line-height: 1.5;
}

/* Spinner for saving state */
.ocw-spinner {
	display: inline-block;
	width: 28px;
	height: 28px;
	border: 3px solid #e0e7ff;
	border-top-color: #4f6df5;
	border-radius: 50%;
	animation: ocw-spin 0.7s linear infinite;
}

@keyframes ocw-spin {
	to { transform: rotate(360deg); }
}