
/* ==========================================================================
   Digital Product Display — cards, preview, shop
   ========================================================================== */

.products-grid-wrap {
	display: block;
	width: 100%;
}

.products-grid .products,
.products-grid--home,
.products-grid--catalog,
.products-grid--related,
ul.products.products-grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none;
	width: 100% !important;
	max-width: none;
}

/* Catalog pages use 3 columns (sidebar layout) */
.products-grid--catalog,
.shop-catalog-page ul.products,
.shop-catalog-page .products-grid--catalog {
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 24px;
}

@media (max-width: 1100px) {
	.products-grid .products,
	.products-grid--home,
	.products-grid--related,
	ul.products.products-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 20px;
	}

	.products-grid--catalog,
	.shop-catalog-page ul.products,
	.shop-catalog-page .products-grid--catalog {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 16px;
	}
}

@media (max-width: 768px) {
	.products-grid .products,
	.products-grid--home,
	.products-grid--catalog,
	.products-grid--related,
	ul.products.products-grid,
	.shop-catalog-page ul.products,
	.shop-catalog-page .products-grid--catalog {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 12px;
	}
}

.product-card-item { list-style: none; }

.product-card-thumb-link {
	display: block;
	position: absolute;
	inset: 0;
	z-index: 1;
}

.product-digital-preview {
	height: 100%;
	min-height: 0;
	display: flex;
	flex-direction: column;
	background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
	border-radius: 0;
}

/* Inside product cards: fill fixed image frame only (no tall overflow) */
.product-card-image .product-digital-preview {
	min-height: 0;
	position: absolute;
	inset: 0;
}

.product-digital-preview.type-theme { background: linear-gradient(145deg, #eef2ff, #c7d2fe); }
.product-digital-preview.type-plugin { background: linear-gradient(145deg, #ecfdf5, #a7f3d0); }
.product-digital-preview.type-template { background: linear-gradient(145deg, #fff7ed, #fed7aa); }
.product-digital-preview.type-ebook { background: linear-gradient(145deg, #fdf4ff, #f5d0fe); }
.product-digital-preview.type-graphics { background: linear-gradient(145deg, #fef2f2, #fecaca); }
.product-digital-preview.type-video { background: linear-gradient(145deg, #ecfeff, #a5f3fc); }

.product-browser-chrome {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 10px 12px;
	background: rgba(15, 23, 42, 0.08);
	border-bottom: 1px solid rgba(15, 23, 42, 0.06);
}

.product-browser-chrome span {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.15);
}

.product-browser-chrome span:first-child { background: #ef4444; }
.product-browser-chrome span:nth-child(2) { background: #f59e0b; }
.product-browser-chrome span:nth-child(3) { background: #22c55e; }

.product-browser-body {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 24px;
	color: var(--wp-store-navy, #0f172a);
}

.product-browser-icon { opacity: 0.35; }
.product-browser-label {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.product-badge.sale {
	left: 12px;
	right: auto;
	top: auto;
	bottom: 12px;
	background: var(--wp-store-danger);
	color: #fff;
}

.product-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0 0 4px;
	min-height: 22px;
	font-size: 12px;
	color: var(--wp-store-text-light);
}

.product-card-rating {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.product-stars {
	color: #f59e0b;
	letter-spacing: 1px;
	font-size: 12px;
}

.product-rating-num { font-weight: 700; color: var(--wp-store-text); }

.product-card-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	width: 100%;
	margin: 0;
	padding: 0;
}

.product-card-footer {
	flex-direction: column;
	align-items: stretch;
	flex-wrap: nowrap;
	gap: 8px;
}

.product-card-footer .product-price {
	flex: 0 0 auto;
	width: 100%;
	margin: 0;
	padding: 0 !important;
}

.product-card-footer .product-card-actions {
	flex: 0 0 auto;
	width: 100%;
	max-width: 100%;
	justify-content: stretch;
}

.product-price .price-current,
.product-price-block .price-current,
.sidebar-price .price-current {
	font-size: 20px;
	font-weight: 800;
	color: var(--wp-store-text);
}

.product-price .price-sale,
.product-price-block .price-sale,
.sidebar-price .price-sale {
	font-size: 20px;
	font-weight: 800;
	color: var(--wp-store-success);
}

.product-price .price-regular,
.product-price-block .price-regular,
.sidebar-price .price-regular {
	font-size: 14px;
	color: var(--wp-store-text-light);
	text-decoration: line-through;
	margin-left: 6px;
}

.product-price-block .price-current,
.product-price-block .price-sale {
	font-size: 2.2rem;
}

.sidebar-price .price-current,
.sidebar-price .price-sale {
	font-size: 1.8rem;
}

.btn-live-preview,
.btn-live-preview-main {
	cursor: pointer;
	font-family: inherit;
}

.badge-download {
	background: #ecfdf5;
	color: #047857;
}

.product-preview-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.live-preview-link {
	font-size: 14px;
	font-weight: 600;
	color: var(--wp-store-primary);
}

.btn-live-preview-main {
	flex: 1;
	min-width: 200px;
	border: none;
}

.product-browser-frame .woocommerce-product-gallery,
.product-image-fallback .product-digital-preview {
	border-radius: var(--wp-store-radius);
	overflow: hidden;
}

.product-live-embed {
	border: 1px solid var(--wp-store-border);
	border-radius: 16px;
	overflow: hidden;
	background: #fff;
	box-shadow: var(--wp-store-shadow);
}

.product-live-embed-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 16px;
	background: #f8fafc;
	border-bottom: 1px solid var(--wp-store-border);
	font-size: 14px;
	font-weight: 600;
}

.product-live-embed iframe {
	display: block;
	width: 100%;
	min-height: 520px;
	border: 0;
	background: #fff;
}

.sidebar-card--preview {
	background: linear-gradient(180deg, #fffbeb 0%, #fff 40%);
}

.sidebar-preview-desc {
	font-size: 14px;
	color: var(--wp-store-text-light);
	margin: -8px 0 16px;
}

.btn-block { width: 100%; justify-content: center; }

/* Live preview modal */
.live-preview-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.live-preview-modal[hidden] { display: none !important; }

.live-preview-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.72);
	backdrop-filter: blur(4px);
}

.live-preview-dialog {
	position: relative;
	width: min(1200px, 100%);
	height: min(86vh, 900px);
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
	display: flex;
	flex-direction: column;
}

.live-preview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px 18px;
	background: var(--wp-store-navy, #0f172a);
	color: #fff;
}

.live-preview-header h2 {
	margin: 0;
	font-size: 16px;
	color: #fff;
}

.live-preview-header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.live-preview-buy-now-form {
	margin: 0;
}

.live-preview-header .live-preview-buy-now,
.live-preview-header .btn-primary.live-preview-buy-now {
	background: var(--wp-store-primary, #0d9488);
	color: #fff;
	border: none;
	white-space: nowrap;
}

.live-preview-header .live-preview-buy-now:hover {
	background: var(--wp-store-primary-dark, #0f766e);
	color: #fff;
}

.live-preview-header .btn-outline {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.45);
	background: transparent;
}

.live-preview-header .btn-outline:hover {
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	border-color: rgba(255, 255, 255, 0.65);
}

.live-preview-close {
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 8px;
	background: rgba(255,255,255,0.12);
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
}

.live-preview-frame-wrap { flex: 1; background: #f1f5f9; position: relative; min-height: 0; }
.live-preview-frame {
	width: 100%;
	height: 100%;
	border: 0;
	background: #fff;
	display: block;
}

.live-preview-fallback {
	position: absolute;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 32px 24px;
	background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
	text-align: center;
}

.live-preview-fallback.is-visible,
.live-preview-fallback:not([hidden]) {
	display: flex;
}

.live-preview-fallback-inner {
	max-width: 420px;
}

.live-preview-fallback-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	margin: 0 auto 18px;
	border-radius: 18px;
	background: rgba(13, 148, 136, 0.1);
	color: var(--wp-store-primary, #0d9488);
}

.live-preview-fallback h3 {
	margin: 0 0 10px;
	font-size: 1.15rem;
	color: var(--wp-store-navy, #0f172a);
}

.live-preview-fallback p {
	margin: 0;
	font-size: 14px;
	line-height: 1.6;
	color: var(--wp-store-text-light, #64748b);
}

body.live-preview-open { overflow: hidden; }

body.wp-store-live-preview-page {
	margin: 0;
	overflow: hidden;
	background: #0f172a;
}

.live-preview-page-shell {
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	background: #fff;
}

.live-preview-page-shell .live-preview-frame-wrap {
	flex: 1;
	min-height: 0;
}

.live-preview-close-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.shop-hero {
	background: linear-gradient(135deg, var(--wp-store-navy, #0f172a) 0%, #1e293b 100%);
	color: #fff;
	padding: 40px 0 36px;
	margin-bottom: 0;
	text-align: center;
}

.shop-hero .container {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.shop-hero-badge {
	display: inline-block;
	background: rgba(45, 212, 191, 0.2);
	color: #5eead4;
	padding: 5px 14px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 12px;
}

.shop-hero-title {
	color: #fff;
	font-size: 2.2rem;
	margin: 0 0 10px;
	text-align: center;
	width: 100%;
}

.shop-hero-desc {
	color: rgba(255,255,255,0.78);
	max-width: 640px;
	width: 100%;
	margin: 0 auto;
	font-size: 16px;
	line-height: 1.6;
	text-align: center;
}

.shop-hero .checkout-progress {
	width: 100%;
	align-self: center;
}

@media (max-width: 768px) {
	.product-card-footer .product-card-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 6px;
	}
	.product-card-footer .product-card-actions .btn {
		width: 100%;
		text-align: center;
		justify-content: center;
		min-height: 40px;
		padding: 8px 10px;
		font-size: 12px;
	}
	.products-grid .product,
	.products-grid--home .product,
	ul.products .product-card-item {
		margin: 0;
	}
	.product-card-item .woocommerce-loop-product__title,
	.products .product .woocommerce-loop-product__title {
		font-size: 13px;
		line-height: 1.35;
	}
	.product-card-footer .product-price {
		font-size: 13px;
	}
	.product-live-embed iframe { min-height: 360px; }
	.live-preview-dialog { height: 92vh; }
}
