/* =============================================
 * Related Products Widget
 * ============================================= */
.rpw-widget {
	width: 100%;
}

.rpw-section-title {
	font-size: 22px;
	font-weight: 600;
	color: #333;
	margin: 0 0 16px;
}

/* =============================================
 * Product Grid
 * ============================================= */
.rpw-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
}

.rpw-cols-2 { grid-template-columns: repeat(2, 1fr); }
.rpw-cols-3 { grid-template-columns: repeat(3, 1fr); }
.rpw-cols-4 { grid-template-columns: repeat(4, 1fr); }
.rpw-cols-5 { grid-template-columns: repeat(5, 1fr); }

/* =============================================
 * Product Card
 * ============================================= */
.rpw-item {
	display: flex;
	flex-direction: column;
}

.rpw-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	border: 1px solid #e8e8e8;
	overflow: hidden;
	flex: 1;
	border-radius: 8px;
}

.rpw-card:hover {
	text-decoration: none;
}

/* =============================================
 * Product Image
 * ============================================= */
.rpw-image {
	display: block;
	width: 100%;
	height: 220px;
	overflow: hidden;
	flex-shrink: 0;
}

.rpw-image img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	object-position: center;
	transition: transform 0.3s ease;
}

.rpw-card:hover .rpw-image img {
	transform: scale(1.05);
}

.rpw-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: #f5f5f5;
}

/* =============================================
 * Product Info
 * ============================================= */
.rpw-info {
	display: flex;
	flex-direction: column;
	padding: 10px 12px;
	flex: 1;
}

.rpw-title {
	font-size: 13px;
	line-height: 1.5;
	color: #333;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-bottom: 6px;
}

/* =============================================
 * Price
 * ============================================= */
.rpw-price-row {
	display: flex;
	align-items: baseline;
	gap: 6px;
	margin-bottom: 4px;
}

.rpw-price-current {
	font-size: 16px;
	font-weight: 700;
	color: #222;
	white-space: nowrap;
	line-height: 1.3;
}

.rpw-price-old {
	font-size: 12px;
	color: #999;
	text-decoration: line-through;
	white-space: nowrap;
}

/* =============================================
 * MOQ
 * ============================================= */
.rpw-moq {
	font-size: 12px;
	color: #999;
	line-height: 1.4;
}

/* =============================================
 * Inquiry Button
 * ============================================= */
.rpw-inquiry-btn {
	display: block;
	text-align: center;
	padding: 8px 12px;
	margin: 8px 12px 12px;
	font-size: 13px;
	color: #333;
	background: #fff;
	border: 1px solid #e0e0e0;
	margin-top: auto;
	transition: all 0.2s ease;
}

.rpw-card:hover .rpw-inquiry-btn {
	background: #333;
	color: #fff;
	border-color: #333;
}

/* =============================================
 * Inquiry Modal Overlay
 * ============================================= */
.rpw-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	background: rgba(0,0,0,0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.rpw-modal {
	position: relative;
	background: #fff;
	border-radius: 12px;
	max-width: 860px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.rpw-modal-close {
	position: absolute;
	top: 12px;
	right: 16px;
	font-size: 28px;
	line-height: 1;
	color: #999;
	cursor: pointer;
	z-index: 2;
	transition: color 0.2s;
}

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

.rpw-modal-body {
	display: flex;
	min-height: 420px;
}

.rpw-modal-left {
	width: 40%;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	background: #f8f8f8;
	border-radius: 12px 0 0 12px;
}

.rpw-modal-product-img {
	width: 100%;
	max-width: 240px;
	aspect-ratio: 1;
	overflow: hidden;
	background: #eee;
	margin-bottom: 16px;
}

.rpw-modal-product-img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rpw-modal-product-name {
	font-size: 14px;
	color: #333;
	text-align: center;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

.rpw-modal-right {
	width: 60%;
	padding: 32px 28px;
}

.rpw-modal-title {
	font-size: 20px;
	font-weight: 600;
	color: #333;
	margin: 0 0 20px;
}

.rpw-form-fields {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.rpw-field-wrap {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.rpw-field-half {
	width: calc(50% - 8px);
}

.rpw-field-full {
	width: 100%;
}

.rpw-field-label {
	font-size: 13px;
	font-weight: 600;
	color: #555;
}

.rpw-field-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	font-size: 14px;
	color: #333;
	outline: none;
	transition: border-color 0.2s;
	box-sizing: border-box;
}

.rpw-field-input:focus {
	border-color: #666;
}

.rpw-textarea {
	min-height: 120px;
	resize: vertical;
}

.rpw-modal-submit {
	display: inline-block;
	margin-top: 20px;
	padding: 12px 35px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
	background: #000;
	border: none;
	cursor: pointer;
	transition: opacity 0.2s;
}

.rpw-modal-submit:hover {
	opacity: 0.85;
}

.rpw-form-message {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 4px;
	font-size: 13px;
}

.rpw-form-message.rpw-msg-success {
	background: #f0faf0;
	color: #2e7d32;
	border: 1px solid #c8e6c9;
}

.rpw-form-message.rpw-msg-error {
	background: #fef0f0;
	color: #c62828;
	border: 1px solid #ffcdd2;
}

/* =============================================
 * Mobile Responsive
 * ============================================= */
@media (max-width: 768px) {
	.rpw-grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	.rpw-image {
		height: 160px;
	}

	.rpw-title {
		font-size: 12px;
	}

	.rpw-price-current {
		font-size: 14px;
	}

	.rpw-inquiry-btn {
		font-size: 12px;
		padding: 6px 0;
	}

	.rpw-modal-body {
		flex-direction: column;
	}

	.rpw-modal-left {
		width: 100%;
		border-radius: 12px 12px 0 0;
		padding: 20px;
		flex-direction: row;
		gap: 16px;
	}

	.rpw-modal-product-img {
		width: 80px;
		max-width: 80px;
		aspect-ratio: 1;
		margin-bottom: 0;
		flex-shrink: 0;
	}

	.rpw-modal-product-name {
		text-align: left;
		-webkit-line-clamp: 2;
	}

	.rpw-modal-right {
		width: 100%;
		padding: 20px;
	}

	.rpw-field-half {
		width: 100%;
	}
}
