:root {
	--pk-brand: #7f0517;
	--pk-brand-hover: #5d0310;
}

* { box-sizing: border-box; }
body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	background: #f8fafc;
	color: #0f172a;
}
.pk-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 16px;
}

/* Header */
.pk-header {
	background: #fff;
	border-bottom: 1px solid #e2e8f0;
	padding: 14px 0;
}
.pk-header-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 16px;
	display: flex;
	align-items: center;
	gap: 24px;
	flex-wrap: wrap;
}
.pk-logo img {
	height: 44px;
	width: auto;
	display: block;
}
.pk-nav {
	display: flex;
	gap: 20px;
	flex: 1 1 auto;
}
.pk-nav a {
	color: #334155;
	font-weight: 600;
	font-size: 13.5px;
	text-decoration: none;
	padding: 6px 0;
	border-bottom: 2px solid transparent;
}
.pk-nav a:hover,
.pk-nav a.active {
	color: var(--pk-brand);
	border-bottom-color: var(--pk-brand);
}
.pk-back-link {
	color: #64748b;
	font-size: 13px;
	text-decoration: none;
	white-space: nowrap;
}
.pk-back-link:hover {
	color: var(--pk-brand);
}

/* Footer */
.pk-footer {
	margin-top: 40px;
	padding: 24px 0;
	border-top: 1px solid #e2e8f0;
	background: #fff;
}
.pk-footer-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 16px;
	text-align: center;
	color: #94a3b8;
	font-size: 12.5px;
}

.pkg-designer-section {
	padding: 30px 0 60px;
	max-width: 1200px;
	margin: 0 auto;
	padding-left: 16px;
	padding-right: 16px;
}
.pkg-header {
	text-align: center;
	max-width: 720px;
	margin: 0 auto 30px;
}
.pkg-header h1 {
	font-size: 28px;
	font-weight: 800;
	color: #0f172a;
	margin-bottom: 10px;
}
.pkg-header p {
	color: #64748b;
	font-size: 14.5px;
	line-height: 1.6;
}
.pkg-cross-links {
	margin-top: 10px;
	display: flex;
	justify-content: center;
	gap: 20px;
	flex-wrap: wrap;
}
.pkg-cross-links a {
	color: #7f0517;
	font-weight: 600;
	font-size: 13px;
	text-decoration: none;
}
.pkg-cross-links a:hover {
	text-decoration: underline;
}

/* Pouch 2D stage */
.pkg-pouch-stage {
	position: relative;
	width: 100%;
	height: 520px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0,0,0,0.04);
	display: flex;
	align-items: center;
	justify-content: center;
}
.pkg-pouch-photo {
	max-width: 90%;
	max-height: 90%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	transition: filter 0.2s ease;
	filter: drop-shadow(0 8px 20px rgba(0,0,0,0.08));
}
.pkg-pouch-logo-layer {
	position: absolute;
	transform: translate(-50%, -50%);
	cursor: grab;
	touch-action: none;
}
.pkg-pouch-logo-layer:active {
	cursor: grabbing;
}
.pkg-pouch-logo-layer img {
	display: block;
	width: 80px;
	height: auto;
	filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
	pointer-events: none;
	user-select: none;
}
.pkg-pouch-logo-controls {
	margin-top: 12px;
	padding: 0 4px;
}
.pkg-range {
	width: 100%;
}

.pkg-designer-grid {
	display: grid;
	grid-template-columns: 1.15fr 0.85fr;
	gap: 30px;
	align-items: start;
}
@media (max-width: 991px) {
	.pkg-designer-grid {
		grid-template-columns: 1fr;
	}
}

.pkg-canvas-wrap {
	position: relative;
	width: 100%;
	height: 520px;
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
#pkgCanvas {
	width: 100%;
	height: 100%;
	display: block;
	cursor: grab;
}
#pkgCanvas:active {
	cursor: grabbing;
}

/* Packdora 3D Badge & Fold Bar Overlay */
.pkg-3d-badge {
	position: absolute;
	top: 14px;
	right: 14px;
	background: rgba(15, 23, 42, 0.85);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 4px 10px;
	border-radius: 20px;
	letter-spacing: 0.05em;
	pointer-events: none;
	backdrop-filter: blur(4px);
}
.pkg-fold-bar {
	position: absolute;
	bottom: 14px;
	left: 50%;
	transform: translateX(-50%);
	background: rgba(255, 255, 255, 0.94);
	border: 1px solid #cbd5e1;
	border-radius: 30px;
	padding: 6px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
	box-shadow: 0 4px 14px rgba(0,0,0,0.08);
	z-index: 10;
}
.pkg-fold-label {
	font-size: 12px;
	font-weight: 700;
	color: #334155;
	user-select: none;
}
.pkg-fold-slider {
	width: 130px;
	accent-color: #7f0517;
	cursor: pointer;
}

/* Packdora File Formats & You Will Get Card */
.pkg-format-card {
	margin-top: 20px;
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 20px;
	box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}
.pkg-format-title {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 12px;
}
.pkg-format-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
}
.pkg-format-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	color: #334155;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}
.pkg-format-btn:hover {
	border-color: #7f0517;
	color: #7f0517;
	background: #fff5f6;
}
.pkg-fmt-badge {
	font-size: 9px;
	font-weight: 800;
	padding: 3px 5px;
	border-radius: 4px;
	text-transform: uppercase;
}
.pkg-fmt-badge.ai { background: #ff9a00; color: #fff; }
.pkg-fmt-badge.pdf { background: #e11d48; color: #fff; }
.pkg-fmt-badge.dxf { background: #4f46e5; color: #fff; }
.pkg-fmt-badge.jpg { background: #10b981; color: #fff; }

.pkg-you-will-get {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid #f1f5f9;
}
.pkg-ywg-heading {
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
	margin-bottom: 10px;
}
.pkg-you-will-get ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.pkg-you-will-get li {
	font-size: 12px;
	color: #64748b;
	line-height: 1.55;
	margin-bottom: 8px;
	position: relative;
	padding-left: 14px;
}
.pkg-you-will-get li::before {
	content: "•";
	position: absolute;
	left: 0;
	color: #7f0517;
	font-weight: bold;
}

.pkg-dieline-btn {
	width: 100%;
	height: 46px;
	margin-top: 14px;
	border: 1.5px solid #7f0517;
	border-radius: 8px;
	background: #fff;
	color: #7f0517;
	font-size: 13px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
}
.pkg-dieline-btn:hover {
	background: #7f0517;
	color: #fff;
}
.pkg-dieline-hint {
	margin: 10px 4px 0;
	font-size: 12px;
	color: #94a3b8;
	line-height: 1.5;
	text-align: center;
}

.pkg-controls-col {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 16px;
	padding: 24px;
	box-shadow: 0 4px 15px rgba(0,0,0,0.04);
}
.pkg-field-group {
	margin-bottom: 18px;
}
.pkg-label {
	display: block;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #64748b;
	margin-bottom: 8px;
}
.pkg-input {
	width: 100%;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	padding: 10px 12px;
	font-size: 14px;
	color: #0f172a;
	background: #fff;
}
.pkg-input:focus {
	outline: none;
	border-color: #7f0517;
}
.pkg-dims-row {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px;
}

.pkg-type-options {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}
.pkg-type-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 8px;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	background: #f8fafc;
	color: #334155;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.2s ease;
}
.pkg-type-btn i {
	font-size: 18px;
	color: #7f0517;
}
.pkg-type-btn.active {
	border-color: #7f0517;
	background: #fff5f6;
	color: #7f0517;
}

.pkg-color-options {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
}
.pkg-color-swatch {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	border: 2px solid transparent;
	cursor: pointer;
	padding: 0;
	box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.pkg-color-swatch.active {
	border-color: #0f172a;
	transform: scale(1.1);
}
.pkg-color-custom {
	width: 32px;
	height: 32px;
	border: 1.5px solid #e2e8f0;
	border-radius: 50%;
	padding: 0;
	cursor: pointer;
	background: none;
}

.pkg-logo-upload input[type="file"] {
	display: none;
}
.pkg-logo-preview {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border: 2px dashed #cbd5e1;
	border-radius: 10px;
	padding: 24px 12px;
	cursor: pointer;
	color: #94a3b8;
	font-size: 12.5px;
	text-align: center;
	transition: all 0.2s ease;
}
.pkg-logo-preview:hover {
	border-color: #7f0517;
	color: #7f0517;
}
.pkg-logo-preview i {
	font-size: 22px;
}
.pkg-logo-preview img {
	max-width: 100px;
	max-height: 80px;
	object-fit: contain;
	border-radius: 6px;
}

.pkg-divider {
	border: none;
	border-top: 1px solid #eef0f3;
	margin: 22px 0;
}

.pkg-submit-btn {
	width: 100%;
	height: 48px;
	border: none;
	border-radius: 50px;
	background: linear-gradient(135deg, #7f0517 0%, #a11226 100%);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	cursor: pointer;
	transition: all 0.25s ease;
}
.pkg-submit-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(127, 5, 23, 0.25);
}
.pkg-submit-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
	transform: none;
}

.pkg-form-msg {
	margin-top: 12px;
	font-size: 13px;
	text-align: center;
}
.pkg-form-msg-success {
	color: #15803d;
}
.pkg-form-msg-error {
	color: #b91c1c;
}

/* Per-side design tabs (Front/Back/Left/Right/Top/Bottom) */
.pkg-side-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}
.pkg-side-btn {
	flex: 1 1 auto;
	padding: 7px 10px;
	border: 1.5px solid #e2e8f0;
	border-radius: 8px;
	background: #fff;
	font-size: 12.5px;
	font-weight: 600;
	color: #475569;
	cursor: pointer;
	position: relative;
	transition: all 0.15s ease;
}
.pkg-side-btn.active {
	border-color: #7f0517;
	color: #7f0517;
	background: #fdf2f3;
}
.pkg-side-btn.has-design::after {
	content: '';
	position: absolute;
	top: 5px;
	right: 6px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #16a34a;
}
.pkg-canvas-wrap.pkg-stage-silver {
	background: radial-gradient(ellipse at center, #e9ebee 0%, #c4c8cf 100%);
}

/* Box colour: picker + HEX + CMYK boxes, text colour */
.pkg-colour-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.pkg-colour-picker { width: 46px; height: 42px; padding: 2px; border: 1px solid #cbd5e1; border-radius: 0; background: #fff; cursor: pointer; }
.pkg-mini { display: flex; flex-direction: column; font-size: 11px; font-weight: 700; color: #64748b; gap: 3px; margin: 0; }
.pkg-mini .pkg-input { margin: 0; height: 42px; padding: 6px 8px; border-radius: 0; }
.pkg-hex { width: 84px; text-transform: uppercase; font-family: monospace; }
.pkg-cmyk { width: 52px; text-align: center; padding-left: 4px !important; padding-right: 4px !important; -moz-appearance: textfield; }
.pkg-cmyk::-webkit-outer-spin-button, .pkg-cmyk::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pkg-colour-hint { font-size: 12px; color: #64748b; margin-top: 6px; }
.pkg-auto { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #334155; margin: 0 0 10px; cursor: pointer; }
@media (max-width: 480px) { .pkg-cmyk { width: 48px; } .pkg-hex { width: 80px; } }
.pkg-font-select { margin-top: 10px; border-radius: 0; height: 42px; }
/* Font picker: every font shows the customer's own text */
.pkg-font-grid { display: none; gap: 6px; margin-top: 10px; overflow-x: auto; overflow-y: hidden; padding: 2px 2px 6px; scroll-snap-type: x proximity; }
.pkg-font-grid.ready { display: flex; }
.pkg-font-grid.ready ~ .pkg-font-select-js { display: none; }
.pkg-font-card { flex: 0 0 132px; display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; padding: 6px 8px; border: 1px solid #cbd5e1; border-radius: 0; background: #fff; cursor: pointer; text-align: center; scroll-snap-align: start; }
.pkg-font-card:hover { border-color: #111; }
.pkg-font-card.active { border: 2px solid #111; padding: 5px 7px; }
.pkg-font-sample { font-size: 15px; font-weight: 700; line-height: 1.3; color: #111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pkg-font-name { font-size: 10px; color: #64748b; font-family: Arial, sans-serif; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


/* Side editor: hint, multi-line text, text size */
.pkg-side-hint { font-size: 12px; color: #64748b; margin: 8px 0 6px; line-height: 1.45; }
.pkg-side-text { font-family: inherit; font-size: 14px; min-height: 64px; resize: vertical; line-height: 1.4; margin-bottom: 8px; border-radius: 0; }
.pkg-size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.pkg-size-label { font-size: 12px; font-weight: 700; color: #64748b; margin-right: 4px; }
.pkg-size-btn { padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 0; background: #fff; color: #111; font-size: 13px; cursor: pointer; }
.pkg-size-btn:hover { border-color: #111; }
.pkg-size-btn.active { background: #111; border-color: #111; color: #fff; }

/* Watermark over the 3D preview: screenshots of a design always carry our name. Not in the print file. */
.pkg-canvas-wrap { position: relative; }
.pkg-canvas-wrap::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2;
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='170'><text x='130' y='95' text-anchor='middle' transform='rotate(-24 130 85)' font-family='Arial, sans-serif' font-size='17' font-weight='700' fill='rgba(15,23,42,0.11)'>AGATE EXPORT · PREVIEW</text></svg>");
	background-repeat: repeat;
}
.pkg-canvas-wrap canvas { position: relative; z-index: 1; }

/* grid children may shrink, so the scrolling font row cannot widen the page */
.pkg-designer-grid > * { min-width: 0; }
.pkg-font-grid { max-width: 100%; }

/* TEMPORARY office test: download buttons under the 3D preview */
.pkg-test-dl { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: 13px; font-weight: 700; color: #334155; }
.pkg-test-dl-btn { background: #111; color: #fff; border: 1px solid #111; border-radius: 0; padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.pkg-test-dl-btn:hover { background: #fff; color: #111; }
.pkg-test-dl-btn[disabled] { opacity: .45; cursor: not-allowed; }
