/* PressNative wp-admin live preview */

.pressnative-preview-wrapper {
	box-sizing: border-box;
}

/* Device switcher */
.pressnative-device-switcher {
	display: flex;
	gap: 0;
	margin-bottom: 10px;
	border-radius: 8px;
	overflow: hidden;
	background: #1e293b;
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
}

.pressnative-device-btn {
	padding: 6px 16px;
	font-size: 13px;
	font-weight: 500;
	border: none;
	background: transparent;
	color: #94a3b8;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.pressnative-device-btn:hover {
	color: #f1f5f9;
	background: rgba(255, 255, 255, 0.06);
}

.pressnative-device-btn.active {
	background: #3b82f6;
	color: #fff;
}

/* Device frame wrapper */
.pressnative-device-frame {
	width: 336px;
	margin: 0 auto;
	padding: 12px;
	border-radius: 44px;
	background: linear-gradient(180deg, #1b1b1d 0%, #0b0b0c 100%);
	box-shadow:
		0 0 0 3px rgba(255, 255, 255, 0.06),
		0 0 0 7px rgba(0, 0, 0, 0.35),
		0 20px 60px rgba(0, 0, 0, 0.4);
	box-sizing: border-box;
}

.pressnative-device-android.pressnative-device-frame {
	border-radius: 40px;
}

.pressnative-device-screen {
	position: relative;
	border-radius: 32px;
	overflow: hidden;
	background: #000;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.06);
	aspect-ratio: 9 / 19.5;
}

/* iPhone: notch (Dynamic Island style) */
.pressnative-device-iphone .pressnative-device-notch {
	position: absolute;
	top: 8px;
	left: 50%;
	transform: translateX(-50%);
	width: 92px;
	height: 26px;
	background: #000;
	border-radius: 999px;
	z-index: 3;
	display: block;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.pressnative-device-android .pressnative-device-notch {
	display: none;
}

/* Android: punch-hole */
.pressnative-device-punch {
	display: none;
	position: absolute;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	width: 12px;
	height: 12px;
	background: #000;
	border-radius: 50%;
	z-index: 3;
	box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12);
}

.pressnative-device-android .pressnative-device-punch {
	display: block;
}

.pressnative-device-iphone .pressnative-device-punch {
	display: none;
}

/* iPhone: home indicator bar */
.pressnative-device-home {
	display: none;
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX(-50%);
	width: 100px;
	height: 4px;
	background: rgba(255, 255, 255, 0.35);
	border-radius: 2px;
	z-index: 3;
}

.pressnative-device-iphone .pressnative-device-home {
	display: block;
}

.pressnative-device-android .pressnative-device-home {
	display: none;
}

/* Inner preview frame (screen content) */
.pressnative-preview-frame {
	width: 100%;
	margin: 0;
	border-radius: 0;
	overflow: hidden;
	box-shadow: none;
	border: none;
	background: #000;
	height: 100%;
}

.pressnative-preview-viewport {
	background: var(--pn-preview-bg, #fff);
	background-image: var(--pn-preview-bg-img, none);
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	font-family: var(--pn-font-family, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif);
	font-size: var(--pn-base-font-size, 16px);
	height: 100%;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;          /* Firefox */
	-ms-overflow-style: none;       /* IE / Edge */
}

.pressnative-preview-viewport::-webkit-scrollbar {
	display: none;                  /* Chrome, Safari, Opera */
}

/* Header extends to top; only bottom safe area for home bar (iPhone) */
.pressnative-device-iphone .pressnative-preview-viewport {
	padding-bottom: 20px;
}

.pressnative-preview-toolbar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 16px;
	min-height: 44px;
	font-size: 18px;
	font-weight: 600;
	color: #fff;
	background: var(--pn-header-bg, #1a1a1a);
	border-bottom: none;
	position: sticky;
	top: 0;
	z-index: 2;
	box-sizing: border-box;
}

/* Extend header color to top of screen; safe-area padding keeps logo/title below notch/punch */
.pressnative-device-iphone .pressnative-preview-toolbar {
	padding-top: 36px;
}

.pressnative-device-android .pressnative-preview-toolbar {
	padding-top: 28px;
}

.pressnative-preview-toolbar-logo {
	height: 28px;
	width: auto;
	max-width: 120px;
	object-fit: contain;
	object-position: left center;
	flex-shrink: 0;
	display: block;
}

.pressnative-preview-toolbar-title {
	flex: 1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pressnative-preview-content {
	padding: 12px 0;
}

/* Component blocks */
.pressnative-preview-component {
	margin-bottom: 16px;
}

.pressnative-preview-component:last-child {
	margin-bottom: 0;
}

/* HeroCarousel */
.pressnative-hero {
	padding: 16px;
}

.pressnative-hero-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 8px;
}

.pressnative-hero-track::-webkit-scrollbar {
	height: 4px;
}

.pressnative-hero-card {
	flex: 0 0 85%;
	scroll-snap-align: start;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
	background: var(--pn-card-bg, #fff);
	border: 1px solid var(--pn-border, rgba(0,0,0,0.08));
}

.pressnative-hero-card-img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
}

.pressnative-hero-card-body {
	padding: 14px 16px;
}

.pressnative-hero-card-title {
	font-size: 17px;
	font-weight: 600;
	color: var(--pn-card-text, #111);
	margin: 0 0 4px 0;
	line-height: 1.3;
}

.pressnative-hero-card-subtitle {
	font-size: 14px;
	color: var(--pn-card-text, #111);
	opacity: 0.85;
	margin: 0;
	line-height: 1.4;
}

.pressnative-hero-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 10px;
}

.pressnative-hero-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--pn-accent, #34c759);
	opacity: 0.4;
}

.pressnative-hero-dot.active {
	width: 8px;
	height: 8px;
	opacity: 1;
}

/* PostGrid */
.pressnative-postgrid {
	padding: 16px;
}

.pressnative-postgrid-inner {
	display: grid;
	gap: 12px;
}

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

.pressnative-postgrid-card {
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
	background: var(--pn-card-bg, #fff);
	background-image: var(--pn-tile-bg-img, none);
	background-size: cover;
	background-position: center;
	border: 1px solid var(--pn-border, rgba(0,0,0,0.08));
}

.pressnative-postgrid-card-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

.pressnative-postgrid-card-body {
	padding: 10px 12px;
}

.pressnative-postgrid-card-title {
	font-size: 14px;
	font-weight: 600;
	color: var(--pn-card-text, #111);
	margin: 0 0 4px 0;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pressnative-postgrid-card-excerpt {
	font-size: 12px;
	color: var(--pn-card-text, #111);
	opacity: 0.75;
	margin: 0;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* CategoryList */
.pressnative-categories {
	padding: 12px 16px;
}

.pressnative-categories-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pressnative-category-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--pn-card-bg, #fff);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	border: 1px solid var(--pn-border, rgba(0,0,0,0.08));
}

.pressnative-category-chip-img {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	object-fit: cover;
}

.pressnative-category-chip-name {
	font-size: 14px;
	font-weight: 500;
	color: var(--pn-card-text, #111);
}

/* PageList */
.pressnative-pages {
	padding: 12px 16px;
}

.pressnative-pages-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pressnative-page-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--pn-card-bg, #fff);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	border: 1px solid var(--pn-border, rgba(0,0,0,0.08));
}

.pressnative-page-chip-img {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	object-fit: cover;
}

.pressnative-page-chip-name {
	font-size: 14px;
	font-weight: 500;
	color: var(--pn-card-text, #111);
}

/* AdPlacement */
.pressnative-ad {
	padding: 16px;
}

.pressnative-ad-banner {
	padding: 20px;
	border-radius: 12px;
	background: var(--pn-card-bg, #f6f7f9);
	background-image: var(--pn-tile-bg-img, none);
	background-size: cover;
	background-position: center;
	border: 1px dashed var(--pn-border, rgba(0, 0, 0, 0.15));
	text-align: center;
	font-size: 13px;
	color: var(--pn-card-text, #111);
	opacity: 0.85;
}

/* ProductGrid */
.pressnative-productgrid {
	padding: 16px;
}

.pressnative-productgrid-inner {
	display: grid;
	gap: 12px;
}

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

.pressnative-product-card {
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
	background: var(--pn-card-bg, #fff);
	background-image: var(--pn-tile-bg-img, none);
	background-size: cover;
	background-position: center;
	position: relative;
	border: 1px solid var(--pn-border, rgba(0,0,0,0.08));
}

.pressnative-product-card-img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	display: block;
}

.pressnative-product-card-body {
	padding: 10px 12px 12px 12px;
}

.pressnative-product-card-title {
	font-size: 13px;
	font-weight: 600;
	color: var(--pn-card-text, #111);
	margin: 0 0 4px 0;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.pressnative-product-card-price {
	font-size: 12px;
	font-weight: 600;
	color: var(--pn-accent, #34c759);
	margin: 0;
}

.pressnative-product-card-cta {
	position: absolute;
	right: 10px;
	bottom: 10px;
	height: 26px;
	padding: 0 10px;
	border-radius: 999px;
	background: var(--pn-accent, #34c759);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ProductCategoryList */
.pressnative-productcategories {
	padding: 12px 16px;
}

.pressnative-productcategories-list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pressnative-productcategory-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--pn-card-bg, #fff);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
	border: 1px solid var(--pn-border, rgba(0,0,0,0.08));
}

.pressnative-productcategory-chip-img {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	object-fit: cover;
}

.pressnative-productcategory-chip-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--pn-accent, #34c759);
	opacity: 0.9;
}

.pressnative-productcategory-chip-name {
	font-size: 14px;
	font-weight: 500;
	color: var(--pn-card-text, #111);
}

/* ProductCarousel */
.pressnative-productcarousel {
	padding: 16px;
}

.pressnative-productcarousel-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding-bottom: 8px;
}

.pressnative-productcarousel-card {
	flex: 0 0 70%;
	scroll-snap-align: start;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
	background: var(--pn-card-bg, #fff);
	border: 1px solid var(--pn-border, rgba(0,0,0,0.08));
}

.pressnative-productcarousel-card-img {
	width: 100%;
	height: 150px;
	object-fit: cover;
	display: block;
}

.pressnative-productcarousel-card-body {
	padding: 12px 14px;
}

.pressnative-productcarousel-card-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--pn-card-text, #111);
	margin: 0 0 4px 0;
	line-height: 1.3;
}

.pressnative-productcarousel-card-price {
	font-size: 13px;
	font-weight: 700;
	color: var(--pn-accent, #34c759);
	margin: 0;
}

/* Loading / error */
.pressnative-preview-loading,
.pressnative-preview-error {
	padding: 32px 16px;
	text-align: center;
	font-size: 14px;
	color: var(--pn-preview-text, #111);
	opacity: 0.7;
}

.pressnative-preview-error {
	color: #b32d2e;
}
