/**
 * Quick Order Product List - Styles V2.0
 *
 * @package Quick_Order_Product_List
 * Clean, responsive, theme-inherited styles
 */

.qopl-wrapper {
	max-width: 100%;
	margin: 0 auto;
}

/* Filter Section */
.qopl-filter {
	margin-bottom: 15px;
	padding: 15px;
	border: 1px solid;
	border-radius: 6px;
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
	align-items: center;
}

.qopl-filter label {
	font-weight: 600;
	font-size: 14px;
}

.qopl-filter select,
.qopl-filter input[type="text"] {
	padding: 8px 12px;
	border: 1px solid;
	border-radius: 4px;
	font-size: 14px;
	min-width: 180px;
	cursor: pointer;
}

.qopl-filter input[type="text"] {
	flex: 1;
	min-width: 150px;
}

/* Product List */
.qopl-product-list {
	border: 1px solid;
	border-radius: 6px;
	overflow: hidden;
}

/* Header Row */
.qopl-product-header {
	display: flex;
	padding: 12px 15px;
	font-weight: 600;
	font-size: 13px;
}

.qopl-header-field {
	flex-shrink: 0;
	padding: 0 8px;
}

.qopl-header-image { width: 70px; }
.qopl-header-sku { width: 100px; }
.qopl-header-name { flex: 1; min-width: 150px; }
.qopl-header-desc { flex: 1; min-width: 180px; }
.qopl-header-price { width: 100px; text-align: right; }
.qopl-header-quantity { width: 80px; text-align: center; }
.qopl-header-variation { width: 160px; }

/* Product Rows */
.qopl-product-item {
	display: flex;
	padding: 10px 15px;
	border-bottom: 1px solid;
	align-items: center;
	justify-content: flex-start;
}

.qopl-product-item:last-child {
	border-bottom: none;
}

.qopl-product-item:nth-child(even) {
	background-color: inherit;
}

.qopl-product-item:hover {
	background-color: inherit;
}

.qopl-product-field {
	flex-shrink: 0;
	padding: 0 8px;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.qopl-field-image { width: 70px; }
.qopl-field-image img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; }
.qopl-field-sku { width: 100px; }
.qopl-field-name { flex: 1; min-width: 150px; }
.qopl-field-desc { flex: 1; min-width: 180px; }
.qopl-field-price { width: 100px; text-align: right; }
.qopl-field-variation { width: 160px; }
.qopl-field-quantity { width: 80px; text-align: center; }

.qopl-field-value {
	font-size: inherit;
	line-height: 1.4;
	word-wrap: break-word;
}

.qopl-field-name .qopl-field-value { font-weight: 600; }
.qopl-field-sku .qopl-field-value { font-family: monospace; font-size: 12px; }
.qopl-field-price .qopl-field-value { font-weight: 600; }
.qopl-field-desc .qopl-field-value { font-size: 12px; }

.qopl-out-of-stock-label {
	font-size: 11px;
	color: #dc3545;
	margin-left: 5px;
}

.qopl-out-of-stock {
	opacity: 0.7;
}

.qopl-variation-select {
	width: 100%;
	min-width: 120px;
	padding: 6px 10px;
	border: 1px solid;
	border-radius: 4px;
	font-size: 13px;
	cursor: pointer;
}

.qopl-quantity-input {
	width: 70px;
	padding: 8px 6px;
	border: 1px solid;
	border-radius: 4px;
	font-size: inherit;
	text-align: center;
}

.qopl-quantity-input:focus {
	outline: none;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.2);
}

.qopl-quantity-input:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Footer */
.qopl-footer {
	margin-top: 15px;
	padding: 20px;
	border-radius: 6px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 15px;
	flex-wrap: wrap;
}

.qopl-subtotal {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 18px;
}

.qopl-subtotal-label { font-weight: 600; }
.qopl-subtotal-amount { font-weight: 700; }

.qopl-checkout-btn {
	padding: 14px 32px;
	font-size: 16px;
	font-weight: 600;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.qopl-checkout-btn:hover { opacity: 0.9; }
.qopl-checkout-btn:disabled { cursor: not-allowed; opacity: 0.6; }

.qopl-no-products {
	padding: 40px;
	text-align: center;
	font-size: 16px;
	border-radius: 6px;
	margin-top: 15px;
}

.qopl-message {
	padding: 15px 20px;
	margin-bottom: 15px;
	border-radius: 6px;
	font-size: 14px;
}

/* Responsive - Tablet */
@media ( max-width: 1024px ) {
	.qopl-header-desc, .qopl-field-desc { display: none; }
	.qopl-header-price, .qopl-field-price { width: 80px; }
}

/* Responsive - Mobile (768px and below) */
@media ( max-width: 768px ) {
	.qopl-product-header { display: none; }
	
	.qopl-product-item {
		flex-wrap: wrap;
		gap: 10px;
		padding: 12px;
	}
	
	/* Row 1: Image (30%) + Name (70%) */
	.qopl-field-image {
		width: 30%;
		flex-shrink: 0;
	}
	.qopl-field-image img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
	
	.qopl-field-name {
		width: 70%;
		flex: unset;
		min-width: unset;
		padding-left: 10px;
		align-self: center;
	}
	
	/* Row 2: Price + SKU + Qty (equal width, side by side) */
	.qopl-field-price {
		width: 33.33%;
		text-align: center;
		order: 3;
		padding: 0 4px;
	}
	
	.qopl-field-sku {
		width: 33.33%;
		text-align: center;
		order: 4;
		padding: 0 4px;
	}
	
	.qopl-field-quantity {
		width: 33.33%;
		order: 5;
		padding: 0 4px;
	}
	
	.qopl-field-quantity .qopl-quantity-input {
		width: 100%;
		min-width: unset;
	}
	
	.qopl-field-variation {
		width: 100%;
		order: 6;
	}
	
	/* Footer */
	.qopl-footer {
		flex-direction: column;
		gap: 12px;
		padding: 15px;
	}
	
	.qopl-subtotal {
		width: 100%;
		justify-content: space-between;
	}
	
	.qopl-checkout-btn {
		width: 100%;
		padding: 14px 20px;
	}
}

/* Responsive - Small Mobile (480px and below) */
@media ( max-width: 480px ) {
	.qopl-filter {
		flex-direction: column;
		align-items: stretch;
		gap: 10px;
		padding: 12px;
	}
	
	.qopl-filter label { font-size: 13px; }
	
	.qopl-filter select,
	.qopl-filter input[type="text"] {
		width: 100%;
		min-width: unset;
		font-size: 13px;
		padding: 8px 10px;
	}
	
	.qopl-product-item {
		gap: 8px;
		padding: 10px;
	}
	
	/* Row 1: Image (30%) + Name (70%) */
	.qopl-field-image { width: 30%; }
	.qopl-field-image img { width: 100%; aspect-ratio: 1; object-fit: cover; }
	
	.qopl-field-name {
		width: 70%;
		padding-left: 8px;
		align-self: center;
	}
	
	.qopl-field-name .qopl-field-value { font-size: 13px; }
	
	/* Row 2: Price + SKU + Qty */
	.qopl-field-price,
	.qopl-field-sku,
	.qopl-field-quantity {
		padding: 0 3px;
	}
	
	.qopl-field-price .qopl-field-value { font-size: 13px; }
	.qopl-field-sku .qopl-field-value { font-size: 10px; }
	
	.qopl-quantity-input {
		font-size: 13px;
		padding: 6px 3px;
	}
	
	.qopl-footer { padding: 12px; }
	.qopl-subtotal { font-size: 14px; }
	.qopl-subtotal-amount { font-size: 16px; }
	.qopl-checkout-btn { padding: 12px 16px; font-size: 14px; }
}

/* Grid Layout */
.qopl-layout-grid .qopl-product-list {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 15px;
	border: none;
	border-radius: 0;
}

.qopl-layout-grid .qopl-product-header { display: none; }

.qopl-layout-grid .qopl-product-item {
	flex-direction: column;
	align-items: stretch;
	text-align: center;
	padding: 15px;
	border: 1px solid;
	border-radius: 6px;
}

.qopl-layout-grid .qopl-field-image {
	width: 100%;
	margin-bottom: 10px;
}

.qopl-layout-grid .qopl-field-image img {
	width: 100%;
	max-height: 150px;
	object-fit: contain;
}

.qopl-layout-grid .qopl-product-field {
	align-items: center;
	width: 100% !important;
	flex: unset !important;
}

.qopl-layout-grid .qopl-field-price { text-align: center; }
.qopl-layout-grid .qopl-field-quantity { justify-content: center; }
.qopl-layout-grid .qopl-quantity-input { width: 60px; }

.qopl-layout-grid .qopl-columns-1 { grid-template-columns: repeat(1, 1fr); }
.qopl-layout-grid .qopl-columns-2 { grid-template-columns: repeat(2, 1fr); }
.qopl-layout-grid .qopl-columns-3 { grid-template-columns: repeat(3, 1fr); }
.qopl-layout-grid .qopl-columns-4 { grid-template-columns: repeat(4, 1fr); }
.qopl-layout-grid .qopl-columns-5 { grid-template-columns: repeat(5, 1fr); }
.qopl-layout-grid .qopl-columns-6 { grid-template-columns: repeat(6, 1fr); }

@media ( max-width: 1024px ) {
	.qopl-layout-grid .qopl-product-list { grid-template-columns: repeat(3, 1fr); }
}

@media ( max-width: 768px ) {
	.qopl-layout-grid .qopl-product-list { grid-template-columns: repeat(2, 1fr); }
}

@media ( max-width: 480px ) {
	.qopl-layout-grid .qopl-product-list { grid-template-columns: 1fr; }
}