/**
 * NexaShop Product Key Attributes Widget Styles (Cards Grid Layout)
 * Pixel-perfect match for media_1791032306266.png.
 */

.nexashop-attributes-cards-widget {
	width: 100%;
	box-sizing: border-box;
	direction: rtl;
	margin-bottom: 24px;
	position: relative;
	font-family: inherit;
}

/* Header: Title & Mobile View All Link (media_1791032306266.png) */
.nexashop-attr-cards-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 14px;
	width: 100%;
	box-sizing: border-box;
}

.nexashop-attr-cards-title {
	font-size: 16px;
	font-weight: 800;
	color: #0f172a;
	margin: 0;
	line-height: 1.3;
	letter-spacing: -0.3px;
}

/* Mobile Header View All Button "مشاهده همه ›" */
.nexashop-attr-mobile-view-all {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: transparent;
	border: none;
	font-size: 13px;
	font-weight: 600;
	color: #4b5563;
	cursor: pointer;
	padding: 4px 6px;
	border-radius: 6px;
	transition: color 0.15s ease, background-color 0.15s ease;
	outline: none;
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
}

.nexashop-attr-mobile-view-all:hover {
	color: #0f172a;
	background-color: #f1f5f9;
}

.nexashop-attr-mobile-view-all .chevron-icon {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	transform: rotate(0deg);
}

/* Cards Track & Grid */
.nexashop-attr-cards-track-wrap {
	width: 100%;
	box-sizing: border-box;
	position: relative;
}

.nexashop-attr-cards-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
	width: 100%;
	box-sizing: border-box;
}

/* Individual Card (Desktop: Flat Light Gray matching media_1791047627360.png) */
.nexashop-attr-card {
	background-color: #f2f4f7;
	border: none;
	border-radius: 8px;
	padding: 12px 16px;
	min-height: 64px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	position: relative;
	transition: background-color 0.2s ease, box-shadow 0.2s ease;
	cursor: pointer;
	outline: none;
	-webkit-tap-highlight-color: transparent;
}

.nexashop-attr-card:hover {
	background-color: #eaedf1;
}

.nexashop-attr-card.is-collapsed {
	display: none;
}

/* Line 1: Attribute Key/Name on Right (Muted Gray, 500 weight) */
.nexashop-attr-card-name {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	font-size: 13px;
	font-weight: 500;
	color: #81858b;
	line-height: 1.3;
	direction: rtl;
	width: 100%;
	box-sizing: border-box;
}

.nexashop-attr-card-name .attr-name-text {
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	max-width: 100%;
}

/* On desktop, hide chevron inside card */
.nexashop-attr-card-name .attr-name-chevron {
	display: none;
}

/* Line 2: Attribute Value (Bold, Left Aligned in media_1791047627360.png) */
.nexashop-attr-card-value {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	text-align: left;
	line-height: 1.3;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	max-width: 100%;
	margin-top: 6px;
}

/* Dark Tooltip Badge matching media_1790775549508.png */
.nexashop-attr-card-tooltip {
	position: absolute;
	bottom: -36px;
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	background-color: #2e2d4d;
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	padding: 5px 12px;
	border-radius: 6px;
	white-space: nowrap;
	pointer-events: none;
	z-index: 1000;
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.nexashop-attr-card:hover .nexashop-attr-card-tooltip,
.nexashop-attr-card:focus .nexashop-attr-card-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(-50%) translateY(0);
}

.nexashop-attr-card-tooltip.is-inverted {
	bottom: auto;
	top: -36px;
	transform: translateX(-50%) translateY(-4px);
}

.nexashop-attr-card:hover .nexashop-attr-card-tooltip.is-inverted,
.nexashop-attr-card:focus .nexashop-attr-card-tooltip.is-inverted {
	transform: translateX(-50%) translateY(0);
}

/* Footer: View All Button Flanked by Divider Lines (Desktop) */
.nexashop-attr-footer-divider-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	margin-top: 18px;
	width: 100%;
	box-sizing: border-box;
}

.nexashop-attr-divider-line {
	flex: 1 1 auto;
	height: 1px;
	background-color: #e5e7eb;
}

.nexashop-btn-view-all-attrs {
	background-color: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	padding: 7px 18px;
	font-size: 13px;
	font-weight: 700;
	color: #1e293b;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
	white-space: nowrap;
	flex-shrink: 0;
	outline: none;
}

.nexashop-btn-view-all-attrs:hover {
	background-color: #f8fafc;
	border-color: #cbd5e1;
	color: #0f172a;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.nexashop-btn-view-all-attrs .nexashop-btn-icon {
	width: 15px;
	height: 15px;
	transition: transform 0.25s ease;
	stroke: currentColor;
}

.nexashop-btn-view-all-attrs.is-expanded .nexashop-btn-icon {
	transform: rotate(-90deg);
}

/* Desktop specific display rules (min-width: 769px) */
@media (min-width: 769px) {
	/* Hide mobile header link on desktop */
	.nexashop-attr-mobile-view-all {
		display: none !important;
	}

	.nexashop-attr-footer-divider-wrap {
		display: flex;
	}
}

/* Responsive: Tablet (< 900px) */
@media (max-width: 900px) {
	.nexashop-attr-cards-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}

/* Responsive: Mobile overrides (<= 768px) matching media_1791032306266.png */
@media (max-width: 768px) {
	.nexashop-attr-card {
		background-color: #ffffff;
		border: 1px solid #eaecf0;
		border-radius: 12px;
		padding: 10px 14px;
		min-height: 58px;
	}

	.nexashop-attr-card:hover {
		background-color: #fafafa;
		border-color: #cbd5e1;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	}

	.nexashop-attr-card-name {
		justify-content: space-between;
		font-size: 12px;
		color: #71717a;
	}

	.nexashop-attr-card-name .attr-name-chevron {
		display: block;
		width: 12px;
		height: 12px;
		flex-shrink: 0;
		stroke: #9ca3af;
	}

	.nexashop-attr-card-value {
		text-align: right;
		font-size: 13.5px;
		color: #18181b;
	}

	/* On mobile, prefer header view all button and hide desktop footer divider */
	.nexashop-attr-mobile-view-all {
		display: inline-flex;
	}

	.nexashop-attr-footer-divider-wrap {
		display: none !important;
	}
}

/* Responsive: Mobile Touch Drag Scroll (< 640px) */
@media (max-width: 640px) {
	.mode-mobile-scroll .nexashop-attr-cards-grid {
		display: flex;
		flex-wrap: nowrap;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		gap: 10px;
		padding: 4px 2px 8px 2px;
		scrollbar-width: none;
		cursor: grab;
		user-select: none;
	}

	.mode-mobile-scroll .nexashop-attr-cards-grid::-webkit-scrollbar {
		display: none;
	}

	.mode-mobile-scroll .nexashop-attr-cards-grid.is-dragging {
		cursor: grabbing;
		scroll-behavior: auto;
		scroll-snap-type: none;
	}

	.mode-mobile-scroll .nexashop-attr-card {
		flex: 0 0 162px;
		min-width: 158px;
		scroll-snap-align: start;
		min-height: 58px;
	}

	.mode-mobile-grid .nexashop-attr-cards-grid {
		grid-template-columns: repeat(1, minmax(0, 1fr));
		gap: 8px;
	}
}

/* Empty State for Product Attributes */
.nexashop-attributes-cards-widget.is-empty-state {
	margin-bottom: 24px;
}

.nexashop-attr-empty-box {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px 20px;
	background-color: #fafbfc;
	border: 1px dashed #cbd5e1;
	border-radius: 12px;
	margin-top: 10px;
}

.nexashop-attr-empty-icon {
	width: 44px;
	height: 44px;
	border-radius: 10px;
	background-color: #ffffff;
	border: 1px solid #e2e8f0;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	color: #94a3b8;
}

.nexashop-attr-empty-info {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.nexashop-attr-empty-title {
	font-size: 13.5px;
	font-weight: 600;
	color: #475569;
	margin: 0;
	line-height: 1.5;
}

.nexashop-attr-empty-sub {
	font-size: 12px;
	color: #64748b;
	margin: 0;
	line-height: 1.5;
}

/* ====================================================
   Strict Clean Boundary: Prevent any specifications table,
   bottom sheet, or legacy box from rendering inside attributes widget
   ==================================================== */
.nexashop-attributes-cards-widget .nx-specs-modal-wrapper,
.nexashop-attributes-cards-widget #nexashop-specs-bottomsheet,
.nexashop-attributes-cards-widget .nexashop-specs-preview-box,
.nexashop-attributes-cards-widget .nexashop-specs-mobile-container,
.nexashop-attributes-cards-widget table,
.nexashop-attributes-cards-widget .nx-specs-table-box,
.nexashop-attributes-cards-widget .nexashop-product-specifications-wrapper {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	overflow: hidden !important;
}
