/* =========================================================
   فروشگاه (Shop) — page-specific styles. Only enqueued on
   page-shop.php (see functions.php), so this file has zero
   effect on the homepage or any other page. Every color/radius/
   spacing value below reuses the theme's own design tokens
   already defined in main.css's :root — layout structure takes
   cues from the client's reference screenshot (filter bar above
   a product grid, category label + title + rating + price +
   add-to-cart per card) but colors/radii/fonts are entirely the
   theme's own, not the reference's.
   ========================================================= */

.shop-page-main {
	background: var(--color-bg);
	padding-top: clamp(20px, 3vw, 50px);
	padding-bottom: clamp(50px, 6vw, 110px);
}

.shop-page-header {
	max-width: 1200px;
	margin: 0 auto clamp(24px, 2.8vw, 44px);
	padding: 0 var(--container-padding);
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
}

.shop-page-header__title {
	color: var(--color-yellow);
	font-size: clamp(20px, 2vw, 32px);
	margin: 0;
}

.shop-page-header__count {
	color: rgba(255, 255, 255, 0.6);
	font-size: clamp(12px, 0.85vw, 14px);
}

/* ---------- CATEGORY FILTER BAR ---------- */
.shop-filter-bar {
	max-width: 1200px;
	margin: 0 auto clamp(28px, 3.2vw, 48px);
	padding: 0 var(--container-padding);
	display: flex;
	align-items: center;
	justify-content: center;
	gap: clamp(8px, 1vw, 14px);
	flex-wrap: wrap;
}

.shop-filter-btn {
	border: 1.5px solid var(--color-yellow);
	background: transparent;
	color: var(--color-white);
	border-radius: var(--radius-pill);
	padding: clamp(8px, 0.8vw, 12px) clamp(20px, 2vw, 30px);
	font-family: inherit;
	font-size: clamp(12.5px, 0.9vw, 14.5px);
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.2s ease;
}

.shop-filter-btn:hover,
.shop-filter-btn:focus-visible {
	transform: translateY(-2px);
}

.shop-filter-btn.is-active {
	background: var(--color-yellow);
	color: var(--color-text-on-yellow);
}

/* ---------- PRODUCT GRID ---------- */
.shop-product-grid {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 var(--container-padding);
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(16px, 2vw, 28px);
}

.shop-product-grid.is-filtering .shop-product-card {
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.shop-product-card {
	background: var(--color-dark);
	border-radius: clamp(20px, 2.2vw, 36px);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.shop-product-card:hover,
.shop-product-card:focus-within {
	transform: translateY(-6px);
	box-shadow: 0 16px 34px rgba(0, 0, 0, 0.32);
}

.shop-product-card[hidden] { display: none; }

.shop-product-card__image-wrap {
	position: relative;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.06);
}

.shop-product-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

/* Hover zoom on the product image — requested explicitly in the brief. */
.shop-product-card:hover .shop-product-card__image,
.shop-product-card:focus-within .shop-product-card__image {
	transform: scale(1.08);
}

.shop-product-card__category {
	position: absolute;
	top: 12px;
	right: 12px;
	background: var(--color-yellow);
	color: var(--color-text-on-yellow);
	border-radius: var(--radius-pill);
	padding: 4px 12px;
	font-size: clamp(10px, 0.7vw, 11.5px);
	font-weight: 700;
}

.shop-product-card__body {
	padding: clamp(16px, 1.8vw, 24px);
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex-grow: 1;
}

.shop-product-card__title {
	margin: 0;
	color: var(--color-white);
	font-size: clamp(14px, 1vw, 17px);
	font-weight: 700;
	line-height: 1.4;
}

.shop-product-card__title a {
	color: inherit;
}

.shop-product-card__rating {
	display: flex;
	align-items: center;
	gap: 2px;
	color: var(--color-yellow);
	font-size: clamp(11px, 0.8vw, 13px);
}

.shop-product-card__rating .is-empty { color: rgba(255, 255, 255, 0.25); }

.shop-product-card__price {
	margin: 2px 0 0;
	color: var(--color-yellow);
	font-size: clamp(15px, 1.1vw, 19px);
	font-weight: 700;
}

.shop-product-card__price del {
	color: rgba(255, 255, 255, 0.4);
	font-weight: 400;
	font-size: 0.8em;
	margin-inline-end: 6px;
}

/* ---------- Add-to-cart button ----------
   For real WooCommerce products, this targets WooCommerce's own
   generated <a class="add_to_cart_button ...">, output by
   woocommerce_template_loop_add_to_cart() — the ajax add-to-cart
   behavior is entirely WooCommerce's own already-loaded script;
   only the appearance is themed here. The fallback (no WooCommerce)
   button below uses the same visual classes for a consistent look. */
.shop-product-card__body a.button,
.shop-product-card__btn {
	margin-top: auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background: var(--color-yellow);
	color: var(--color-text-on-yellow) !important;
	border: none;
	border-radius: var(--radius-pill);
	padding: clamp(9px, 0.85vw, 13px) clamp(16px, 1.6vw, 22px);
	font-family: inherit;
	font-size: clamp(12.5px, 0.9vw, 14.5px);
	font-weight: 700;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

.shop-product-card__body a.button:hover,
.shop-product-card__body a.button:focus-visible,
.shop-product-card__btn:hover,
.shop-product-card__btn:focus-visible {
	background: var(--color-white);
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.shop-product-card__body a.button.loading { opacity: 0.6; pointer-events: none; }
.shop-product-card__body a.button.added::after { content: ' ✓'; }

.shop-product-card__btn.is-added { opacity: 0.7; cursor: default; }

/* Empty-state (no products match the active filter, or WooCommerce has
   nothing published yet) */
.shop-product-grid__empty {
	grid-column: 1 / -1;
	text-align: center;
	color: rgba(255, 255, 255, 0.6);
	padding: clamp(30px, 4vw, 60px) 0;
	font-size: clamp(13px, 0.95vw, 15px);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
	.shop-product-grid { grid-template-columns: repeat(3, 1fr); }
}

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

@media (max-width: 480px) {
	.shop-product-grid { grid-template-columns: 1fr; }
	.shop-page-header { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
	.shop-product-card,
	.shop-product-card__image,
	.shop-filter-btn,
	.shop-product-card__body a.button,
	.shop-product-card__btn {
		transition: none !important;
	}
}

/* =========================================================
   PRODUCT DETAIL POPUP — opens on card click, real gallery
   (5+ images if uploaded in wp-admin) + real WooCommerce
   add-to-cart form (handles variations/models natively).
   ========================================================= */
.shop-product-card__image-wrap,
.shop-product-card__title {
	cursor: pointer;
}

.shop-product-popup {
	position: fixed;
	inset: 0;
	z-index: 300;
	display: none;
	align-items: center;
	justify-content: center;
	padding: clamp(12px, 3vw, 40px);
}

.shop-product-popup.is-open {
	display: flex;
}

.shop-product-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.72);
}

.shop-product-popup__box {
	position: relative;
	background: var(--color-dark);
	border-radius: clamp(20px, 2.2vw, 32px);
	width: min(980px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	padding: clamp(20px, 2.4vw, 40px);
}

.shop-product-popup__close {
	position: absolute;
	top: 14px;
	left: 14px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.08);
	color: var(--color-white);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	z-index: 2;
}

.shop-product-popup__close:hover {
	background: var(--color-yellow);
	color: var(--color-text-on-yellow);
}

.shop-product-popup__loading {
	color: rgba(255, 255, 255, 0.6);
	text-align: center;
	padding: 60px 0;
	font-size: 14px;
}

.shop-product-popup__content {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: clamp(20px, 3vw, 44px);
}

/* WooCommerce's own gallery output (woocommerce_show_product_images) —
   themed minimally so it fits the dark popup without fighting WC's
   own gallery/zoom JS, which keeps working since we reuse its real markup. */
.shop-product-popup__gallery img {
	border-radius: 16px;
	width: 100%;
	height: auto;
	display: block;
}

.shop-product-popup__gallery .flex-control-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
	padding: 0;
	list-style: none;
}

.shop-product-popup__gallery .flex-control-thumbs li {
	width: 64px;
	height: 64px;
}

.shop-product-popup__gallery .flex-control-thumbs img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 8px;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease;
}

.shop-product-popup__gallery .flex-control-thumbs img.flex-active,
.shop-product-popup__gallery .flex-control-thumbs img:hover {
	opacity: 1;
	outline: 2px solid var(--color-yellow);
}

/* This theme's own simpler gallery markup (built in JS from the AJAX
   response's image URL list) — used instead of WooCommerce's flexslider
   template, since the popup fetches product data via AJAX rather than
   rendering WooCommerce's single-product template server-side. */
.shop-product-popup__main-image {
	width: 100%;
	aspect-ratio: 1 / 1;
	border-radius: 16px;
	background-size: cover;
	background-position: center;
	background-color: rgba(255, 255, 255, 0.05);
}

.shop-product-popup__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 10px;
}

.shop-product-popup__thumb {
	width: 64px;
	height: 64px;
	border-radius: 8px;
	border: none;
	padding: 0;
	background-size: cover;
	background-position: center;
	cursor: pointer;
	opacity: 0.6;
	transition: opacity 0.2s ease, outline-color 0.2s ease;
	outline: 2px solid transparent;
}

.shop-product-popup__thumb:hover,
.shop-product-popup__thumb.is-active {
	opacity: 1;
	outline-color: var(--color-yellow);
}

.shop-product-popup__title {
	color: var(--color-white);
	font-size: clamp(19px, 1.8vw, 26px);
	font-weight: 800;
	margin: 0 0 10px;
}

.shop-product-popup__price {
	color: var(--color-yellow);
	font-size: clamp(17px, 1.4vw, 21px);
	font-weight: 700;
	margin-bottom: 18px;
}

.shop-product-popup__price del {
	color: rgba(255, 255, 255, 0.4);
	font-weight: 400;
	margin-inline-end: 8px;
}

.shop-product-popup__addtocart {
	margin-bottom: 22px;
}

.shop-product-popup__addtocart form.cart {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
}

.shop-product-popup__addtocart .quantity input {
	width: 60px;
	background: rgba(255, 255, 255, 0.07);
	border: 1.5px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	color: var(--color-white);
	padding: 9px;
	text-align: center;
}

.shop-product-popup__addtocart table.variations {
	width: 100%;
	margin-bottom: 14px;
}

.shop-product-popup__addtocart table.variations td {
	padding: 6px 0;
}

.shop-product-popup__addtocart table.variations select {
	width: 100%;
	background: rgba(255, 255, 255, 0.07);
	border: 1.5px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	color: var(--color-white);
	padding: 9px 12px;
}

.shop-product-popup__addtocart .button,
.shop-product-popup__addtocart .single_add_to_cart_button {
	background: var(--color-yellow);
	color: var(--color-text-on-yellow) !important;
	border: none;
	border-radius: var(--radius-pill);
	padding: 12px 28px;
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none !important;
}

.shop-product-popup__addtocart .woocommerce-variation-price {
	color: var(--color-yellow);
	font-weight: 700;
	margin-bottom: 10px;
}

.shop-product-popup__desc {
	color: rgba(255, 255, 255, 0.75);
	font-size: 13.5px;
	line-height: 1.9;
}

@media (max-width: 760px) {
	.shop-product-popup__content { grid-template-columns: 1fr; }
}
