/* Package screens. Reuses the theme's tokens so it stays in step with the rest
   of the site; falls back to sane values if the plugin outlives the theme. */

.sp-pk {
	--pk-green: var(--green, #40b848);
	--pk-green-dark: var(--green-dark, #2e8a35);
	--pk-line: var(--line, #e8ebf0);
	--pk-muted: var(--muted, #7a8398);
	--pk-radius: var(--radius, 14px);
	--pk-surface: var(--surface, #f6f8fa);

	max-width: 1100px;
	margin-inline: auto;
}

.sp-pk__section { margin-bottom: 40px; }
.sp-pk__heading { font-size: 22px; margin: 0 0 6px; }
.sp-pk__lede { color: var(--pk-muted); margin: 0 0 18px; font-size: 14.5px; max-width: 62ch; }
.sp-pk__empty { color: var(--pk-muted); font-style: italic; }
.sp-pk__basics { display: inline-flex; margin: 10px 0 0; }
.sp-pk__back { margin: 0 0 12px; font-size: 14px; }
.sp-pk__back a { color: var(--pk-green-dark); font-weight: 500; }

.sp-pk__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.sp-pk__card {
	display: flex; flex-direction: column;
	border: 1px solid var(--pk-line); border-radius: var(--pk-radius);
	overflow: hidden; background: #fff;
	transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.sp-pk__card:hover {
	border-color: rgba(64, 184, 72, .5);
	box-shadow: 0 10px 26px rgba(19, 25, 40, .1);
	transform: translateY(-3px);
}
.sp-pk__thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.sp-pk__body { padding: 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sp-pk__name { font-size: 16px; margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-pk__meta { margin: 0; font-size: 12.5px; color: var(--pk-muted); }
.sp-pk__price { margin: 6px 0 0; font-size: 20px; font-weight: 600; color: var(--pk-green-dark); }
.sp-pk__note { margin: 2px 0 0; font-size: 12px; color: var(--pk-muted); }

.sp-pk__tag {
	font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
	background: var(--pk-green); color: #fff; padding: 3px 9px; border-radius: 999px;
}

/* What's actually in the package — the reason to pick one over another. */
.sp-pk__contents {
	list-style: none; margin: 12px 0 0; padding: 12px 0 0;
	border-top: 1px dashed var(--pk-line);
	font-size: 13px;
}
.sp-pk__contents li {
	display: flex; align-items: baseline; justify-content: space-between;
	gap: 10px; padding: 4px 0;
}
.sp-pk__item-name { color: var(--pk-muted); }
.sp-pk__item-qty { font-weight: 600; white-space: nowrap; }

.sp-pk__more {
	margin-top: 8px; padding: 0; border: 0; background: none;
	color: var(--pk-green-dark); font-family: inherit; font-size: 12.5px;
	font-weight: 600; cursor: pointer; text-decoration: underline;
}
.sp-pk__more:hover { color: var(--pk-green); }

.sp-pk__row { display: flex; gap: 8px; margin-top: auto; padding-top: 14px; flex-wrap: wrap; }
.sp-pk__row .sp-pk__btn { flex: 1; min-width: 130px; text-align: center; }
.sp-pk__inline { display: inline; margin: 0; }

.sp-pk__btn {
	display: inline-flex; align-items: center; justify-content: center;
	padding: 10px 18px; border: 1px solid var(--pk-green); border-radius: 10px;
	background: #fff; color: var(--pk-green-dark);
	font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
	transition: background .18s ease, color .18s ease;
}
.sp-pk__btn:hover { background: var(--pk-green); color: #fff; }
.sp-pk__btn--primary { background: var(--pk-green); border-color: var(--pk-green); color: #fff; }
.sp-pk__btn--primary:hover { background: var(--pk-green-dark); border-color: var(--pk-green-dark); }
.sp-pk__btn--ghost { border-color: var(--pk-line); color: inherit; }
.sp-pk__btn--danger { border-color: #f0b7b7; color: #c62828; }
.sp-pk__btn--danger:hover { background: #c62828; border-color: #c62828; color: #fff; }

.sp-pk__linkbtn {
	background: none; border: 0; padding: 0;
	color: var(--pk-green-dark); font-weight: 600; font-size: 13px;
	cursor: pointer; font-family: inherit;
}

.sp-pk__new { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.sp-pk__new input {
	flex: 1; min-width: 220px; min-height: 44px; padding: 10px 14px;
	border: 1px solid var(--pk-line); border-radius: 10px; font-family: inherit; font-size: 14px;
}

/* ---------- editor ---------- */

.sp-pk__table { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.sp-pk__table td { padding: 12px 8px; border-bottom: 1px solid var(--pk-line); vertical-align: middle; }
.sp-pk__cell-img { width: 64px; }
.sp-pk__cell-img img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; }
.sp-pk__cell-name { font-size: 14px; }
.sp-pk__cell-name a { font-weight: 500; }
.sp-pk__size { display: block; font-size: 11.5px; color: var(--pk-muted); }
.sp-pk__cell-price { white-space: nowrap; font-size: 14px; }
.sp-pk__cell-qty { width: 90px; }
.sp-pk__cell-qty input {
	width: 72px; min-height: 42px; padding: 8px; text-align: center;
	border: 1px solid var(--pk-line); border-radius: 8px; font-family: inherit; font-size: 15px;
}
.sp-pk__cell-remove { width: 44px; text-align: right; }
.sp-pk__remove {
	width: 32px; height: 32px; border: 0; border-radius: 50%;
	background: var(--pk-surface); color: var(--pk-muted);
	font-size: 19px; line-height: 1; cursor: pointer;
	transition: background .18s ease, color .18s ease;
}
.sp-pk__remove:hover { background: #fdecec; color: #c62828; }

.sp-pk__add { position: relative; margin: 18px 0; }
.sp-pk__add label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.sp-pk__add input {
	width: 100%; min-height: 46px; padding: 10px 14px;
	border: 1px solid var(--pk-line); border-radius: 10px; font-family: inherit; font-size: 15px;
}
.sp-pk__add input:focus { outline: none; border-color: var(--pk-green); box-shadow: 0 0 0 3px rgba(64, 184, 72, .13); }

.sp-pk__results {
	position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
	background: #fff; border: 1px solid var(--pk-line); border-radius: 10px;
	box-shadow: 0 12px 30px rgba(19, 25, 40, .14);
	max-height: 320px; overflow-y: auto; margin-top: 6px;
}
.sp-pk__result {
	display: flex; align-items: center; gap: 10px; width: 100%;
	padding: 10px 12px; border: 0; background: none; cursor: pointer;
	text-align: left; font-family: inherit; font-size: 14px;
	border-bottom: 1px solid var(--pk-line);
}
.sp-pk__result:last-child { border-bottom: 0; }
.sp-pk__result:hover { background: var(--pk-surface); }
.sp-pk__result img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; }
.sp-pk__result-name { flex: 1; }
.sp-pk__result-price { font-weight: 600; color: var(--pk-green-dark); white-space: nowrap; }
.sp-pk__noresult { margin: 0; padding: 14px; color: var(--pk-muted); font-size: 14px; }

.sp-pk__total {
	display: flex; align-items: baseline; justify-content: space-between;
	padding: 16px; border-radius: var(--pk-radius); background: var(--pk-surface);
	font-size: 15px; margin-top: 10px;
}
.sp-pk__total strong { font-size: 22px; color: var(--pk-green-dark); }

.sp-pk__repeat { margin: 16px 0 0; font-size: 14px; }
.sp-pk__repeat label { display: flex; align-items: center; gap: 9px; cursor: pointer; }

.sp-pk__rename { margin: 14px 0 0; }
.sp-pk__rename label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.sp-pk__rename input {
	width: 100%; max-width: 380px; min-height: 44px; padding: 10px 14px;
	border: 1px solid var(--pk-line); border-radius: 10px; font-family: inherit; font-size: 15px;
}

.sp-pk__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 22px; }

/* Edit link on the cart line */
.sp-pk__editlink {
	display: inline-block; margin-top: 6px;
	font-size: 12.5px; font-weight: 600; color: var(--pk-green-dark);
	text-decoration: underline;
}
.sp-pk__editlink:hover { color: var(--pk-green); }

.sp-pk__editing {
	margin: 0 0 14px; padding: 10px 14px;
	border-left: 3px solid var(--pk-green); background: rgba(64, 184, 72, .08);
	border-radius: 0 8px 8px 0; font-size: 13.5px;
}

@media (max-width: 600px) {
	.sp-pk__cell-img { display: none; }
	.sp-pk__table td { padding: 10px 5px; }
	.sp-pk__cell-qty { width: 74px; }
	.sp-pk__cell-qty input { width: 62px; }
	.sp-pk__actions .sp-pk__btn { flex: 1; }
}
